Beispiel #1
0
    public void ShootingHandler(int w)
    {
        if (shootCooldown <= 0)
        {
            switch (w)
            {
            case (0):
            {
                NormalMissile nm = new NormalMissile(50 + (MainScript.Player.NormalMissileLvl * 10));
                shootCooldown = nm.CoolDown;
                normalSound.GetComponent <AudioSource>().Play();
                break;
            }

            case (1):
            {
                RocketMissile rm = new RocketMissile(150 + (MainScript.Player.RocketMissileLvl * 10));
                shootCooldown = rm.CoolDown;
                rocketSound.GetComponent <AudioSource>().Play();
                break;
            }

            case (2):
            {
                LaserMissile lm = new LaserMissile(100 + (MainScript.Player.LaserMissileLvl * 10));
                shootCooldown = lm.CoolDown;
                laserSound.GetComponent <AudioSource>().Play();
                break;
            }
            }
        }
    }
Beispiel #2
0
    private void ReleaseLaserMissile(Vector3 newDestinationVector)
    {
        if (MissilePrefab == null)
        {
            return;
        }
//		GameObject laserMissileObject = ObjectPool.Spawn(laserMissilePrefab, GameController.Instance.transform, trans.position, trans.rotation);
        GameObject laserMissileObject = Instantiate(MissilePrefab, Trans.position, Trans.rotation);

        laserMissileObject.transform.parent = GameManager.Instance.transform;
        LaserMissile laserMissile = laserMissileObject.GetComponent <LaserMissile>();

        laserMissile.DestinationVector = newDestinationVector;
        //laserMissile.owner = owner;
        laserMissile.Weapon = this;
        laserMissile.Target = Target;
    }