Exemplo n.º 1
0
 public override void DisableElement(bool hide)
 {
     inputButton.Lock(TrayInputButton.ButtonState.Disabled);
     changeVisibility(!hide);
     isLockedByActionSequence = false;
     isEnabled = false;
 }
        private void Start()
        {
            trayInputButton = GetComponentInParent <TrayInputButton>();
            if (trayInputButton == null)
            {
                Log.LogError(this, "Could not find TrayInputButton in parent");
            }
            CPDataEntityCollection cPDataEntityCollection = Service.Get <CPDataEntityCollection>();

            if (cPDataEntityCollection.TryGetComponent <MembershipData>(cPDataEntityCollection.LocalPlayerHandle, out membershipData))
            {
                IsPlayerAMember = membershipData.IsMember;
                IsLocked        = !membershipData.IsMember;
                membershipData.MembershipDataUpdated += onMembershipDataUpdated;
                if (IsLocked)
                {
                    Content.LoadAsync(onMemberLockLoaded, MemberLockContentKey);
                }
            }
            else
            {
                trayInputButton.Lock(TrayInputButton.ButtonState.Disabled);
                Content.LoadAsync(onMemberLockLoaded, MemberLockContentKey);
            }
        }