Well you can see where I am looking for FSMStateTest’s below in the for each but they don’t show. No idea what I am doing wrong.
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
class FSMStateTest
{
}
class ChasePlayerStateTest : FSMStateTest
{
}
class AttackPlayerStateTest : FSMStateTest
{
}
public class TestScript : MonoBehaviour
{
private List<FSMStateTest> myList = new List<FSMStateTest>();
void Start ()
{
myList.Add(new ChasePlayerStateTest());
myList.Add(new AttackPlayerStateTest());
foreach (FSMStateTest state in myList)
{
Debug.Log("WHAY CAN'T I FIND ONE!");
}
}
}
I’ve had more than one case of simple, clearly correct code that simply didn’t run right in Unity until I exited and restarted and forced a rebuild. In one instance I did this many times before it mysteriously started working again. (It isn’t worth the effort, but if you searched all my posts you’d find a couple of hair-puller threads like this.)
I know this isn’t much help, but sometimes either Unity or Mono just flakes out like that.