using System; using System.Collections; using System.Collections.Generic; using UnityEngine; using UnityEngine.UI; public class PowerItemToggle : BaseToggle { public GameObject TargetGameObj; public Text label; //public bool HasAllot; public long OwnerUserId; public override void RespondFun(bool value) { //如果本客户端没有该力量的所有权 if (OwnerUserId != CurrentUserInfo.mySelf.Id) { return; } if (value) AllotButton.SelectToAllot.Add(TargetGameObj); else AllotButton.SelectToAllot.Remove(TargetGameObj); } public void Set(GameObject tar) { TargetGameObj = tar; CloneGameObjInfo info = TargetGameObj.GetComponent(); OwnerUserId = info.UserID; label = transform.Find("Label").GetComponent(); label.text = info.FullName; } }