Advertisement

State could not be found I need Help!

Started by March 28, 2020 08:10 PM
2 comments, last by Beosar 4 years, 8 months ago

error CS0246: The type or namespace name 'State' could not be found (are you missing a using directive or an assembly reference?)

using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.UI;


public class AdventureGame : MonoBehaviour
{
    [SerializeField] Text textComponent;
    [SerializeField] State startingState;   

    // Start is called before the first frame update
    void Start()
    {
        textComponent.text = ("Next day you wake up in the morning in the jungles! you look around to ask your buddies," +
         "but you don see no one. horrified and baffled you dunno wut ta do. You grab your phone from your pocket \"damn it's broken\".");
    }

    // Update is called once per frame
    void Update()
    {
        
    }
}
/*

 [SerializeField] Text textComponent; using UnityEngine.UI;


    state machine
    scriptable obj
*/
using System.Collections;
using System.Collections.Generic;
using UnityEngine;

[CreateAssetMenu(menuName = "State")]
public class state : ScriptableObject
{
    [TextArea(10,14)] [SerializeField] string storyText;

    public string GetStateStory()
    {
        return storyText;
    }
}

Noureldin, you are not asking a question about Writing. Moving this thread to a more appropriate forum.

-- Tom Sloper -- sloperama.com

Advertisement

C# is case-sensitive. Name your class “State”, not “state”.

This topic is closed to new replies.

Advertisement