using FairyGUI; namespace GFGGame { public class RedDotController : SingletonBase { public void SetComRedDot(GComponent parentCom, bool isRed) { GComponent comRedDot; if (parentCom.GetChild("comResDot") == null) { comRedDot = UIPackage.CreateObject("CommonGame", "ComRedDot").asCom; parentCom.AddChild(comRedDot); comRedDot.name = "comResDot"; comRedDot.SetPosition(parentCom.width - comRedDot.width, 0, 0); comRedDot.AddRelation(comRedDot, RelationType.TopExt_Top); comRedDot.AddRelation(comRedDot, RelationType.RightExt_Right); } else { comRedDot = parentCom.GetChild("comResDot").asCom; } comRedDot.visible = isRed; } } }