🎉 Celebrating 25 Years of GameDev.net! 🎉

Not many can claim 25 years on the Internet! Join us in celebrating this milestone. Learn more about our history, and thank you for being a part of our community!

State could not be found I need Help!

Started by
2 comments, last by Beosar 4 years, 3 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;
    }
}
Advertisement

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

-- Tom Sloper -- sloperama.com

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

This topic is closed to new replies.

Advertisement