change: Removed dependencies and references to OLD_StateController
This commit is contained in:
		@@ -1,78 +0,0 @@
 | 
			
		||||
using System.Collections;
 | 
			
		||||
using System.Collections.Generic;
 | 
			
		||||
using UnityEngine;
 | 
			
		||||
 | 
			
		||||
public class OLD_StateController : MonoBehaviour {
 | 
			
		||||
 | 
			
		||||
    // this is mostly a placeholder for making the programmer HUD work properly
 | 
			
		||||
    // something like this will be needed later but like with real variables
 | 
			
		||||
 | 
			
		||||
    public bool canTrumpet = true;
 | 
			
		||||
    public bool canTambourine = true;
 | 
			
		||||
    public bool canClarinet = true;
 | 
			
		||||
    public bool canCymbal = true;
 | 
			
		||||
 | 
			
		||||
    public enum PlayerStates {
 | 
			
		||||
        Idle,
 | 
			
		||||
        Running,
 | 
			
		||||
        Jumping,
 | 
			
		||||
        Falling,
 | 
			
		||||
        TrumpetJumping,
 | 
			
		||||
        TambourineThrowing,
 | 
			
		||||
        SpiderGrappling,
 | 
			
		||||
        ClarinetDiving,
 | 
			
		||||
        CymbalParrying,
 | 
			
		||||
    }
 | 
			
		||||
    public PlayerStates currentState = PlayerStates.Idle;
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
    // Start is called before the first frame update
 | 
			
		||||
    void Start() {
 | 
			
		||||
        
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    // Update is called once per frame
 | 
			
		||||
    void Update() {
 | 
			
		||||
        if (Input.GetKeyDown(KeyCode.Q)) {
 | 
			
		||||
            canTrumpet = !canTrumpet;
 | 
			
		||||
            print("Q");
 | 
			
		||||
        }
 | 
			
		||||
        if (Input.GetKeyDown(KeyCode.W)) {
 | 
			
		||||
            canTambourine = !canTambourine;
 | 
			
		||||
        }
 | 
			
		||||
        if (Input.GetKeyDown(KeyCode.E)) {
 | 
			
		||||
            canClarinet = !canClarinet;
 | 
			
		||||
        }
 | 
			
		||||
        if (Input.GetKeyDown(KeyCode.R)) {
 | 
			
		||||
            canCymbal = !canCymbal;
 | 
			
		||||
        }
 | 
			
		||||
 | 
			
		||||
        if (Input.GetKeyDown("1")) {
 | 
			
		||||
            currentState = PlayerStates.Idle;
 | 
			
		||||
        }
 | 
			
		||||
        if (Input.GetKeyDown("2")) {
 | 
			
		||||
            currentState = PlayerStates.Running;
 | 
			
		||||
        }
 | 
			
		||||
        if (Input.GetKeyDown("3")) {
 | 
			
		||||
            currentState = PlayerStates.Jumping;
 | 
			
		||||
        }
 | 
			
		||||
        if (Input.GetKeyDown("4")) {
 | 
			
		||||
            currentState = PlayerStates.Falling;
 | 
			
		||||
        }
 | 
			
		||||
        if (Input.GetKeyDown("5")) {
 | 
			
		||||
            currentState = PlayerStates.TrumpetJumping;
 | 
			
		||||
        }
 | 
			
		||||
        if (Input.GetKeyDown("6")) {
 | 
			
		||||
            currentState = PlayerStates.TambourineThrowing;
 | 
			
		||||
        }
 | 
			
		||||
        if (Input.GetKeyDown("7")) {
 | 
			
		||||
            currentState = PlayerStates.SpiderGrappling;
 | 
			
		||||
        }
 | 
			
		||||
        if (Input.GetKeyDown("8")) {
 | 
			
		||||
            currentState = PlayerStates.ClarinetDiving;
 | 
			
		||||
        }
 | 
			
		||||
        if (Input.GetKeyDown("9")) {
 | 
			
		||||
            currentState = PlayerStates.CymbalParrying;
 | 
			
		||||
        }
 | 
			
		||||
    }
 | 
			
		||||
}
 | 
			
		||||
@@ -1,11 +0,0 @@
 | 
			
		||||
fileFormatVersion: 2
 | 
			
		||||
guid: 73653b02e42804d288eaaf881c511225
 | 
			
		||||
MonoImporter:
 | 
			
		||||
  externalObjects: {}
 | 
			
		||||
  serializedVersion: 2
 | 
			
		||||
  defaultReferences: []
 | 
			
		||||
  executionOrder: 0
 | 
			
		||||
  icon: {instanceID: 0}
 | 
			
		||||
  userData: 
 | 
			
		||||
  assetBundleName: 
 | 
			
		||||
  assetBundleVariant: 
 | 
			
		||||
@@ -102,13 +102,13 @@ public class PlayerBehavior : MonoBehaviour
 | 
			
		||||
            }
 | 
			
		||||
            if (!playerController.IsGrounded() && (currentDashTime < maxDashTime) && isDash)
 | 
			
		||||
            {
 | 
			
		||||
                if(forward == 1)
 | 
			
		||||
                {   
 | 
			
		||||
                    moveDirection = new Vector3(1f,-1f,0f) * dashDistance;
 | 
			
		||||
                if (forward == 1)
 | 
			
		||||
                {
 | 
			
		||||
                    moveDirection = new Vector3(1f, -1f, 0f) * dashDistance;
 | 
			
		||||
                }
 | 
			
		||||
                else
 | 
			
		||||
                {
 | 
			
		||||
                    moveDirection = new Vector3(-1f,-1f,0f) * dashDistance;
 | 
			
		||||
                    moveDirection = new Vector3(-1f, -1f, 0f) * dashDistance;
 | 
			
		||||
                }
 | 
			
		||||
                transform.position = transform.position + moveDirection;
 | 
			
		||||
                currentDashTime += dashStopSpeed;
 | 
			
		||||
 
 | 
			
		||||
@@ -3,7 +3,8 @@ using System.Collections.Generic;
 | 
			
		||||
using UnityEngine;
 | 
			
		||||
using TMPro;
 | 
			
		||||
 | 
			
		||||
public class ProgrammerHUDController : MonoBehaviour {
 | 
			
		||||
public class ProgrammerHUDController : MonoBehaviour
 | 
			
		||||
{
 | 
			
		||||
 | 
			
		||||
    // assigned in inspector
 | 
			
		||||
    [SerializeField] TMP_Text trumpetUI;
 | 
			
		||||
@@ -13,28 +14,30 @@ public class ProgrammerHUDController : MonoBehaviour {
 | 
			
		||||
    [SerializeField] TMP_Text stateText;
 | 
			
		||||
 | 
			
		||||
    [SerializeField] GameObject programmerHUD;
 | 
			
		||||
    [SerializeField] OLD_StateController stateController;
 | 
			
		||||
 | 
			
		||||
    // Start is called before the first frame update
 | 
			
		||||
    void Start() {
 | 
			
		||||
        trumpetUI.text = "Can Trumpet?\n" + stateController.canTrumpet;
 | 
			
		||||
        clarinetUI.text = "Can Clarinet?\n" + stateController.canClarinet;
 | 
			
		||||
        cymbalUI.text = "Can Cymbal?\n" + stateController.canCymbal;
 | 
			
		||||
        tambourineUI.text = "Can Tambourine?\n" + stateController.canTambourine;
 | 
			
		||||
        stateText.text = "Current State:\n" + stateController.currentState;
 | 
			
		||||
    void Start()
 | 
			
		||||
    {
 | 
			
		||||
        UpdateText();
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    void UpdateText()
 | 
			
		||||
    {
 | 
			
		||||
        trumpetUI.text = "Can Trumpet?\n" + StateController.Instance.HasTrumpet();
 | 
			
		||||
        clarinetUI.text = "Can Clarinet?\n" + StateController.Instance.HasClarinet();
 | 
			
		||||
        cymbalUI.text = "Can Cymbal?\n" + StateController.Instance.HasCymbal();
 | 
			
		||||
        tambourineUI.text = "Can Tambourine?\n" + StateController.Instance.HasTambourine();
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    // Update is called once per frame
 | 
			
		||||
    void Update() {
 | 
			
		||||
        trumpetUI.text = "Can Trumpet?\n" + stateController.canTrumpet;
 | 
			
		||||
        clarinetUI.text = "Can Clarinet?\n" + stateController.canClarinet;
 | 
			
		||||
        cymbalUI.text = "Can Cymbal?\n" + stateController.canCymbal;
 | 
			
		||||
        tambourineUI.text = "Can Tambourine?\n" + stateController.canTambourine;
 | 
			
		||||
        stateText.text = "Current State:\n" + stateController.currentState;
 | 
			
		||||
    void Update()
 | 
			
		||||
    {
 | 
			
		||||
        UpdateText();
 | 
			
		||||
 | 
			
		||||
        if (Input.GetKeyDown(KeyCode.H)) {
 | 
			
		||||
        if (Input.GetKeyDown(KeyCode.H))
 | 
			
		||||
        {
 | 
			
		||||
            programmerHUD.SetActive(!programmerHUD.activeSelf);
 | 
			
		||||
        }
 | 
			
		||||
        
 | 
			
		||||
 | 
			
		||||
    }
 | 
			
		||||
}
 | 
			
		||||
 
 | 
			
		||||
@@ -10,6 +10,7 @@ public enum UnlockedItems
 | 
			
		||||
    Trumpet,
 | 
			
		||||
    Tambourine,
 | 
			
		||||
    Clarinet,
 | 
			
		||||
    Cymbal,
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
public class StateController : MonoBehaviour
 | 
			
		||||
@@ -75,6 +76,11 @@ public class StateController : MonoBehaviour
 | 
			
		||||
        return this.itemProgression >= UnlockedItems.Clarinet;
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    public bool HasCymbal()
 | 
			
		||||
    {
 | 
			
		||||
        return this.itemProgression >= UnlockedItems.Cymbal;
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    void OnSceneLoaded(Scene scene, LoadSceneMode mode)
 | 
			
		||||
    {
 | 
			
		||||
 | 
			
		||||
@@ -132,6 +138,9 @@ public class StateController : MonoBehaviour
 | 
			
		||||
            case "ClarinetScene":
 | 
			
		||||
                this.itemProgression = UnlockedItems.Clarinet;
 | 
			
		||||
                break;
 | 
			
		||||
            case "MushroomForest":
 | 
			
		||||
                this.itemProgression = UnlockedItems.Cymbal;
 | 
			
		||||
                break;
 | 
			
		||||
        };
 | 
			
		||||
        #endregion
 | 
			
		||||
    }
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user