Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System.Collections;
- using System.Collections.Generic;
- using UnityEngine;
- public class StateManager : MonoBehaviour
- {
- [HideInInspector]
- public enum States { Default, Bucket, Block };
- public States states;
- // Start is called before the first frame update
- void Start()
- {
- states = States.Default;
- }
- // Update is called once per frame
- void Update()
- {
- if (states == States.Default)
- {
- print("Ohello Default");
- Default();
- // Kun for å plukke opp ting
- }
- else if(states == States.Bucket)
- {
- print("Bucket");
- Bucket();
- }
- else if(states == States.Block)
- {
- print("Bucket");
- Block();
- }
- }
- void Default()
- {
- }
- void Bucket()
- {
- DefaultCode();
- if (Input.GetKeyDown(KeyCode.Q))
- {
- states = States.Default;
- print("Dropping the Bucket");
- }
- }
- void Block()
- {
- }
- void DefaultCode()
- {
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement