Ejemplo n.º 1
0
 void Awake()
 {
     //Establish reference to "Player" gameobject.
     player = GameObject.FindGameObjectWithTag("Player");
     //Establish reference to "Playerhealth" script.
     PlayH = player.GetComponent <Playerhealth> ();
     //Establish reference to "Gun" gameobject.
     Gun = GameObject.FindGameObjectWithTag("Playergun");
     //Establish reference to the "Laserprefab" script.
     Ammo = Gun.GetComponent <LaserPrefab> ();
     //Establish reference to the Ship's animator
     anim = GetComponent <Animator> ();
 }
Ejemplo n.º 2
0
 // Start is called before the first frame update
 private void StartBeam()
 {
     _fireWaypoint = UnityEngine.Random.Range(0, Waypoints.GetWaypoints.Length - 1);
     _laserBeam    = LaserPrefab.GetComponent <LaserBeam>();
 }