Ejemplo n.º 1
0
        void Update()
        {
            ProcessMovement();
            SwitchWeapon();
            ReleaseDroneBot();
            caseSwitch = gun.currentWeapon;
            switch (caseSwitch)
            {
            case Gun.WeaponType.MG:
                gun.hasOpenedMGFire = Shooting();
                break;

            case Gun.WeaponType.MSL:
                LaunchMissile();
                break;

            case Gun.WeaponType.NB:
                ReleaseNanoBots();
                break;

            default:
                gun.hasOpenedMGFire = false;
                break;
            }

            if (Input.GetKeyDown(KeyCode.Escape))
            {
                SceneManager.LoadScene(2);
            }
        }
Ejemplo n.º 2
0
        private void UpdateCanvas()
        {
            canvas[0].SetActive(true);
            canvas[1].SetActive(false);

            canvas[0].GetComponent <InGameCanvas>().MG_reloadTime  = gun.MG_WeaponStats.reloadTime;
            canvas[0].GetComponent <InGameCanvas>().MSL_reloadTime = gun.MSL_WeaponStats.reloadTime;
            canvas[0].GetComponent <InGameCanvas>().NB_reloadTime  = gun.NB_WeaponStats.reloadTime;


            caseSwitch = gun.currentWeapon;
            switch (caseSwitch)
            {
            case Gun.WeaponType.MG:
                canvas[0].GetComponent <InGameCanvas>().selectedWeapon = 0;
                break;

            case Gun.WeaponType.MSL:
                canvas[0].GetComponent <InGameCanvas>().selectedWeapon = 1;
                break;

            case Gun.WeaponType.NB:
                canvas[0].GetComponent <InGameCanvas>().selectedWeapon = 2;
                break;
            }
        }