示例#1
0
        private void CheckDoorAccess(IDCard cardID, DoorController doorController, GameObject originator)
        {
            Debug.Log("been here!");
            if (cardID.accessSyncList.Contains((int)doorController.restriction))
            {
// has access
                allowInput = false;
                if (!doorController.IsOpened)
                {
                    PlayerManager.LocalPlayerScript.playerNetworkActions.CmdTryOpenDoor(gameObject, originator);
                }
                else
                {
                    PlayerManager.LocalPlayerScript.playerNetworkActions.CmdTryCloseDoor(gameObject);
                }

                Debug.Log(doorController.restriction + " access granted");
                StartCoroutine(DoorInputCoolDown());
            }
            else
            {
// does not have access
                Debug.Log(doorController.restriction + " no access");
                allowInput = false;
                StartCoroutine(DoorInputCoolDown());
                PlayerManager.LocalPlayerScript.playerNetworkActions.CmdRestrictDoorDenied(gameObject);
            }
        }
示例#2
0
 public void Start()
 {
     doorController = GetComponent <DoorController>();
 }