예제 #1
0
    // Start is called before the first frame update
    public virtual void Start()
    {
        playerNoiseManager = GetComponentInParent <PlayerNoise>();
        tpcc               = GetComponentInParent <ThirdPersonCharacterController>();
        currentCamera      = tpcc.currentCamera;
        thirdPersonCamFlag = tpcc.IsThirdPersonCameraActive();
        currentAmmo        = maxAmmo;

        //añadimos este observer ao subject pause
        GameHandler.instance.RegisterObserverPause(this);
    }
예제 #2
0
 private void Awake()
 {
     if (Instance == null)
     {
         Instance = this;
     }
     else
     {
         Destroy(gameObject);
     }
     // Cache references to all desired variables
     if (patrollZones == null)
     {
         patrollZones = GameObject.Find("PatrollPoints");
     }
     if (menuCanvas == null)
     {
         menuCanvas = GameObject.Find("MenuCanvas");
     }
     if (NavMesh == null)
     {
         NavMesh = GameObject.Find("NavMesh");
     }
     if (player == null)
     {
         player = GameObject.Find("Player");
     }
     if (playerNoise == null)
     {
         playerNoise = GameObject.Find("PlayerNoise").GetComponent <PlayerNoise>();
     }
     if (soungManager == null)
     {
         soungManager = GameObject.Find("SoundManager").GetComponent <SoundManager>();
     }
     if (objectivesData == null)
     {
         Debug.LogError("ObjRemaining Obj not Ini in the ObjectRef Class");
     }
     InitObjectiveList();
 }
예제 #3
0
 // Use this for initialization
 void Start()
 {
     playerCharacter = GameObject.Find("Player");
     PlayerNoise playerNoise = playerCharacter.GetComponent <PlayerNoise>();
 }