Esempio n. 1
0
    //private bool isLighting; //I commented it because you don't need a duplicate since you can access the variable directly

    private void Start()
    {
        _lifeTime      = lifetime;
        _playerLighter = FindObjectOfType <PlayerLighter>(); //Storing the Component in the variable
        //this work only because we know we have only one playerlighter in the scene, if there were more than one, this function will only return the first one it finds

        _graphsBounds = GetComponent <SphereCollider>().bounds;
    }
Esempio n. 2
0
 private void Awake()
 {
     if (instance == null)
     {
         instance = this;
     }
     if (instance != this)
     {
         Destroy(this);
     }
 }
 private void Start()
 {
     playerLighter = player.GetComponent <PlayerLighter>();
     torchLifetime = torches[0].lifetime;
 }
Esempio n. 4
0
 private void Start()
 {
     playerLighter  = player.GetComponent <PlayerLighter>();
     playerMovement = player.GetComponent <PlayerMovement>();
 }