void UpdateShow() { if (arrowImage != null) { UGUISpriteSelector selector = arrowImage.GetComponent <UGUISpriteSelector>(); if (selector == null) { arrowImage.gameObject.AddComponent <UGUISpriteSelector>(); selector = arrowImage.GetComponent <UGUISpriteSelector>(); } selector.index = group; } if (bgImage != null) { UGUISpriteSelector selector = bgImage.GetComponent <UGUISpriteSelector>(); if (selector == null) { bgImage.gameObject.AddComponent <UGUISpriteSelector>(); selector = bgImage.GetComponent <UGUISpriteSelector>(); } selector.index = group; } }
void UpdateIcon() { if (characterIcon != null) { characterIcon.gameObject.SetActive(_icon != ""); if (_icon != "") { if (_icon != "0") { characterIcon.LoadSprite(string.Format("icon/{0}", _icon)); } else//如果 icon为 0 使用特殊 Icon { UGUISpriteSelector selector = characterIcon.GetComponent <UGUISpriteSelector>(); if (selector == null) { characterIcon.gameObject.AddComponent <UGUISpriteSelector>(); selector = characterIcon.GetComponent <UGUISpriteSelector>(); } selector.index = 0; } } } }