// Use this for initialization private void Start() { if (pEnergy == null) pEnergy = gameObject.transform.parent.GetComponentInChildren<playerEnergy>(); if (Bullet == null) Bullet = GameObject.Find("Bullet"); attackTimer = 2.0f; }
private void Awake() { gPoints = GameObject.FindWithTag("Player").GetComponent <growPoints>(); pHealth = GameObject.FindGameObjectWithTag("Player").GetComponent <playerHealth>(); pEnergy = GameObject.FindGameObjectWithTag("Player").GetComponent <playerEnergy>(); Top = GameObject.Find("Top").GetComponent <BoxCollider>(); Bot = GameObject.Find("Bottom").GetComponent <BoxCollider>(); Left = GameObject.Find("Left").GetComponent <BoxCollider>(); Right = GameObject.Find("Right").GetComponent <BoxCollider>(); }
private void Awake() { gPoints = GameObject.FindWithTag("Player").GetComponent<growPoints>(); pHealth = GameObject.FindGameObjectWithTag("Player").GetComponent<playerHealth>(); pEnergy = GameObject.FindGameObjectWithTag("Player").GetComponent<playerEnergy>(); Top = GameObject.Find("Top").GetComponent<BoxCollider>(); Bot = GameObject.Find("Bottom").GetComponent<BoxCollider>(); Left = GameObject.Find("Left").GetComponent<BoxCollider>(); Right = GameObject.Find("Right").GetComponent<BoxCollider>(); }
// Use this for initialization private void Start() { if (pEnergy == null) { pEnergy = gameObject.transform.parent.GetComponentInChildren <playerEnergy>(); } if (Bullet == null) { Bullet = GameObject.Find("Bullet"); } attackTimer = 2.0f; }