void Start() { Player.transform.position = Spawn.transform.position; fire = fireGroup.GetComponentInParent <HurtPlayer> ().GetInstance(); minDragDistance = Screen.height * 15 / 100; //15% of screen height endPos = transform.position; aStar = GameObject.FindGameObjectWithTag("aStar"); grid = aStar.GetComponent <Grid> ().GetInstance(); bubb = GameObject.FindObjectOfType <DeathBubble> ().GetInstance(); arUnwalkable = GameObject.FindGameObjectsWithTag("Unwalkable"); for (int i = 0; i < arUnwalkable.Length; i++) { currLPos = new Vector3(arUnwalkable [i].transform.position.x, arUnwalkable [i].transform.position.y, arUnwalkable [i].transform.position.z); unwalkablePos.Add(currLPos); } posArr = unwalkablePos.ToArray(); gm = GameObject.FindGameObjectWithTag("GM").GetComponent <GameManager> ().GetInstance(); sprrend = GetComponentInChildren <SpriteRenderer> () as SpriteRenderer; InitEnemies(); }
void Awake() { bubbleInstance = this; rend = this.gameObject.GetComponent <SpriteRenderer> (); rend.enabled = false; }