Esempio n. 1
0
 void OnTriggerEnter(Collider other)
 {
     if (other.CompareTag("Target") && speed > 1f)
     {
         controllerVibration.setVibrationTime(0.1f);
         other.gameObject.GetComponent <TargetDestroyable> ().DestroyThisObject();
         scoreManager.addScore(100);
     }
 }
    private void SwitchWeapon()
    {
        controllerVibration.setVibrationTime(0.1f);
        Instantiate(SwitchEffect, transform.position, transform.rotation);

        Weapon[currentWeaponIdx].Uninstall();

        currentWeaponIdx = ++idx % Weapon.Length;
        if (weaponType == WeaponType.GUN)
        {
            weaponType = WeaponType.SWORD;
        }
        else if (weaponType == WeaponType.SWORD)
        {
            weaponType = WeaponType.GUN;
        }

        weaponView.changeUI();
        Weapon[currentWeaponIdx].Install();
    }
Esempio n. 3
0
 public override void Attack()
 {
     controllerVibration.setVibrationTime(0.2f);
     Instantiate(bullet, SpawnPoint.transform.position, SpawnPoint.transform.rotation);
     Instantiate(shotEffects, SpawnPoint.transform.position, Quaternion.identity);
 }