Can we use it as follows?

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

public class AdventureGame : MonoBehaviour
{

    [SerializeField] Text textComponent;
    [SerializeField] State startingState;

    State state;

    // Use this for initialization
    void Start()
    {
        state = startingState;
        textComponent.text = state.GetStateStory();
    }

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

    }
}
        state = startingState;
        textComponent.text = state.GetStateStory();

Can we use it as follows?

        textComponent.text = startingState.GetStateStory();

Hi Erhan,

Yes, that’s possible in the Start method. :slight_smile:

This topic was automatically closed 24 hours after the last reply. New replies are no longer allowed.

Privacy & Terms