Esempio n. 1
0
 // Use this for initialization
 void Start()
 {
     range       = GetComponentInChildren <DRange>();
     angle       = transform.rotation;
     laser       = GetComponentInChildren <LaserShoot>();
     startVector = transform.localRotation.eulerAngles;
 }
Esempio n. 2
0
    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;
            }
        }
    }
Esempio n. 3
0
 // Use this for initialization
 void Start()
 {
     if (slaveGun)
     {
         slaveGunExists = true;
     }
     if (slaveGunExists)
     {
         slaveLaserShoot = slaveGun.GetComponent <LaserShoot>();
     }
 }
Esempio n. 4
0
    private void OnTriggerEnter2D(Collider2D collision)
    {
        LaserShoot laser = collision.gameObject.GetComponent <LaserShoot>();

        if (laser)
        {
            health -= laser.getDamage();
            laser.Hit();
            if (health <= 0)
            {
                Die();
            }
        }
    }
Esempio n. 5
0
    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);
            }
        }
    }
Esempio n. 6
0
 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;
         }
     }
 }
Esempio n. 7
0
 // Use this for initialization
 void Start()
 {
     laser = ship.GetComponent <LaserShoot> ();
 }