// ** Update Functions ** private void Start() { soundSource = GetComponent <LaserSound>(); //actualLaser = gameObject.GetComponentInChildren<KillBeam>(); actualLaser = gameObject.transform.Find("LaserBeam").GetComponent <KillBeam>(); laserTimer = gameObject.transform.Find("LaserCanvas").Find("LaserTimer").GetComponent <Image>(); time = maxTime; }
private void LaserShoot() { lock (Bullets) { LaserSound.Play(); LaserFired = true; var laser = new Laser { Shape = { Position = Center, Rotation = Sprite.Rotation } }; Lasers.Add(laser); } }
void Awake() { source = GetComponent <LaserSound>(); }
void OnTriggerEnter(Collider other) { LaserSound LaserSound = other.gameObject.GetComponent <LaserSound>(); }