源战役客户端
您最多选择25个主题 主题必须以字母或数字开头,可以包含连字符 (-),并且长度不得超过35个字符
 
 
 
 
 

47 行
1.1 KiB

using UnityEngine.UI;
using UnityEngine;
namespace LuaFramework
{
public class ImageExtend : Image
{
private float _alpha = 1.0F;
private Outline[] _outLine;
public float alpha
{
get { return _alpha; }
set { SetAlpha(value); }
}
private void SetAlpha(float value)
{
_alpha = value;
color = new UnityEngine.Color(color.r, color.g, color.b, _alpha);
}
private bool _gray = false;
public bool gray
{
get { return _gray; }
set { SetGray(value); }
}
private void SetGray(bool value)
{
_gray = value;
if (_gray)
{
material = Resources.Load("material/Gray") as Material;
}
else
{
material = null;
}
if (_outLine == null)
{
_outLine = GetComponentsInChildren<Outline>(true);
}
foreach (var line in _outLine)
{
line.enabled = !value;
}
}
}
}