private void Shoot_Fireball() { Vector3 position = transform.parent.position; if (patrol.Moving_Right == false) { position.x -= 1.3f;//Starting point of mage ball } else { position.x += 1.3f;//Starting point of mage ball } position.y -= 0.1f; //Starting point of mage ball Enemy_Purple_Ball new_Purple_Ball = Instantiate(Mage_Ball, position, Mage_Ball.transform.rotation); if (patrol.Moving_Right == false) { new_Purple_Ball.transform.localScale = new Vector3(-1f, 1f, 1f); new_Purple_Ball.Direction = new_Purple_Ball.transform.right * (-1); } else { new_Purple_Ball.transform.localScale = new Vector3(1f, 1f, 1f); new_Purple_Ball.Direction = new_Purple_Ball.transform.right; } }
private void Start() { patrol = GetComponentInParent <Patrol>(); Mage_Ball = Resources.Load <Enemy_Purple_Ball>("Mage_Ball"); }