Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- //using System;
- //using System.Collections;
- //using System.Collections.Generic;
- //using UnityEngine;
- //using UnityEngine.UI;
- //public class AdventureGame : MonoBehaviour
- //{
- // [SerializeField] Text textComponente;
- // [SerializeField] State startingState;
- // State state;
- //
- // void Start()
- // {
- // state = startingState;
- // textComponente.text = state.GetStateStory();
- // }
- // // Update is called once per frame
- // void Update()
- // {
- // ManageState();
- // }
- // private void ManageState()
- // {
- // var nextStates = state.GetNextStates();
- // if (Input.GetKeyDown(KeyCode.Alpha1))
- // {
- // state = nextStates[0];
- // }
- // else if (Input.GetKeyDown(KeyCode.Alpha2))
- // {
- // state = nextStates[1];
- // }
- // else if (Input.GetKeyDown(KeyCode.Alpha3))
- // {
- // state = nextStates[2];
- // }
- // textComponente.text = state.GetStateStory();
- // }
- //}
- using System.Collections;
- using System.Collections.Generic;
- using UnityEngine;
- [CreateAssetMenu(menuName = "State")]
- public class State : ScriptableObject
- {
- [TextArea(10,14)] [SerializeField] string storyText;
- [SerializeField] State[] nextStates;
- public string GetStateStory()
- {
- return storyText;
- }
- public State[] GetNextStates()
- {
- return nextStates;
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement