Beispiel #1
0
    // Update is called once per frame
    void Update()
    {
        if (playerManagerScript.ShowCurrentPlayerState() == Player_Manager.PlayerStatus.Weapon)
        {
            currentWeapon.SetActive(true);
            Club_Driver.SetActive(false);
            Club_Iron.SetActive(false);
            Club_Putter.SetActive(false);
            foreach (GameObject unusedWeapon in UnusedWeapons)
            {
                unusedWeapon.SetActive(false);
            }

            if (Input.GetKeyDown("joystick button 5"))
            {
                Fire();
            }
        }

        if (playerManagerScript.ShowCurrentPlayerState() == Player_Manager.PlayerStatus.Vanilla)
        {
            currentClub.SetActive(true);
            Weapon_Driver.SetActive(false);
            Weapon_Iron.SetActive(false);
            Weapon_Putter.SetActive(false);
            foreach (GameObject unusedClub in UnusedClubs)
            {
                unusedClub.SetActive(false);
            }
        }

        //Driver
        if (Input.GetKeyDown("joystick button 2"))
        {
            currentClub   = Club_Driver;
            currentWeapon = Weapon_Driver;
            UnusedClubs.Clear();
            UnusedClubs.Add(Club_Iron);
            UnusedClubs.Add(Club_Putter);
            UnusedWeapons.Clear();
            UnusedWeapons.Add(Weapon_Iron);
            UnusedWeapons.Add(Weapon_Putter);
            currentBulletState = BulletStates.DriverBullet;
            playerManagerScript.CurrentClubIsDriver();
        }

        //Iron
        if (Input.GetKeyDown("joystick button 3"))
        {
            currentClub   = Club_Iron;
            currentWeapon = Weapon_Iron;
            UnusedClubs.Clear();
            UnusedClubs.Add(Club_Driver);
            UnusedClubs.Add(Club_Putter);
            UnusedWeapons.Clear();
            UnusedWeapons.Add(Weapon_Driver);
            UnusedWeapons.Add(Weapon_Putter);
            currentBulletState = BulletStates.IronBullet;
            playerManagerScript.CurrentClubIsIron();
        }

        //Putter
        if (Input.GetKeyDown("joystick button 1"))
        {
            currentClub   = Club_Putter;
            currentWeapon = Weapon_Putter;
            UnusedClubs.Clear();
            UnusedClubs.Add(Club_Driver);
            UnusedClubs.Add(Club_Iron);
            UnusedWeapons.Clear();
            UnusedWeapons.Add(Weapon_Driver);
            UnusedWeapons.Add(Weapon_Iron);
            currentBulletState = BulletStates.PutterBullet;
            playerManagerScript.CurrentClubIsPutter();
        }
    }