// Use this for initialization void Start() { range = GetComponentInChildren <DRange>(); angle = transform.rotation; laser = GetComponentInChildren <LaserShoot>(); startVector = transform.localRotation.eulerAngles; }
public override void InitStart(bool isThisMine) { base.InitStart(isThisMine); for (int i = 0; i < laserFieldGuns.Length; i++) { LaserShoot ls = laserFieldGuns[i].GetComponent <LaserShoot>(); ls.playerOwner = playerOwner; ls.InitStart(); } if (OperationNetwork.isServer) { randomLaserDefinition = new float[laserFieldGuns.Length * 4]; for (int i = 0; i < laserFieldGuns.Length; i++) { RotateLaser rL = laserFieldGuns[i].GetComponent <RotateLaser>(); rL.InitStartServer(); randomLaserDefinition [i * 4 + 0] = rL.rotX; randomLaserDefinition [i * 4 + 1] = rL.rotY; randomLaserDefinition [i * 4 + 2] = rL.changeX; randomLaserDefinition [i * 4 + 3] = rL.changeY; } } }
// Use this for initialization void Start() { if (slaveGun) { slaveGunExists = true; } if (slaveGunExists) { slaveLaserShoot = slaveGun.GetComponent <LaserShoot>(); } }
private void OnTriggerEnter2D(Collider2D collision) { LaserShoot laser = collision.gameObject.GetComponent <LaserShoot>(); if (laser) { health -= laser.getDamage(); laser.Hit(); if (health <= 0) { Die(); } } }
private void OnTriggerEnter2D(Collider2D collision) { LaserShoot laser = collision.gameObject.GetComponent <LaserShoot>(); if (laser) { health -= laser.getDamage(); laser.Hit(); if (health <= 0) { score.Score(scoreValue); Destroy(gameObject); Instantiate(explosionParticle, transform.position, transform.rotation); AudioSource.PlayClipAtPoint(explosion, transform.position); } } }
private void OnTriggerEnter2D(Collider2D collision) { if (collision.gameObject.name.Contains("Enemy")) { EnemyStart1 ES = collision.GetComponent <EnemyStart1>(); ES.move = false; CycleMove CM = collision.GetComponent <CycleMove>(); CM.enabled = true; EnemyShooting EnS = collision.GetComponent <EnemyShooting>(); if (EnS != null) { EnS.enabled = true; } LaserShoot las = collision.GetComponent <LaserShoot>(); if (las != null) { las.enabled = true; } } }
// Use this for initialization void Start() { laser = ship.GetComponent <LaserShoot> (); }