private void Start() { isPlayerAgent = GameManager.Instance.playerMode == GameManager.PlayerMode.Client; cam.gameObject.SetActive(isPlayerAgent); MainCollider = transform.Find("Main Collider").gameObject; ColliderSize = new Vector3(0, 1, 0); animator = GetComponentInChildren <Animator>(); if (isPlayerAgent) { Cursor.lockState = CursorLockMode.Locked; } me = this; }
public override void Interact() { if (null == playa) { playa = FindObjectOfType <AgentPlayer>(); } if (playa.HasTreasure) { StartCoroutine(ChangeColor(true)); playa.CmdRaiseGlobalEvent(GameEvent.GameWon); AudioSource.PlayClipAtPoint(WinSound, transform.position); } else { StartCoroutine(ChangeColor(false)); } }
void Start() { player = GameObject.FindGameObjectWithTag("Agent").GetComponent <AgentPlayer>(); }