Hello guys, I need some help. I’m stuck at Section 3 Lecture 24 @06:20
I’ve followed the video and I’ve done everything as the video says, but State doesn’t exist. Auto-completion doesn’t occur in State.cs either. Do anyone know what I’ve done wrong or need to do?
Unity version: “2018.2.17f1 Personal”
Visual studio: “2017 Community”
“Type or namespace State could not be found (are you missing a using directive or an assembly reference?”
Suggestions from VS:
" using UnityEditorInternal "
" using static UnityEngine.Random "
" Fully qualify ‘State’ "
" Generate type ‘State’ "
" Fix typo ‘State’ "
Screenshot of unity:
https://drive.google.com/file/d/17YclDqYdWY9WgfWgCKZQbCJXaBKXu-95/view?usp=sharing
My scripts:
Adventure.cs
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.UI;
public class AdventureGame : MonoBehaviour {
[SerializeField] Text textComponent;
// Errors occur here
[SerializeField] State startingState;
State state;
// Use this for initialization
void Start () {
// and here
state = startingState;
textComponent.text = "This is added programatically";
}
// Update is called once per frame
void Update () {
}
}
State.cs
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
[CreateAssetMenu(menuName = "State")]
public class State : ScriptableObject {
[TextArea(14,10)] [SerializeField] string storyText;
public string GetStateStory()
{
return storyText;
}
}