public override void OnEnter() { mo = graph.Value as FsmPointGraph; //Debug.Log(typeof(mo)); if ((mo == null) || (mo.Value == null) || alwaysNew.Value) { AstarPath.active.astarData.AddGraph(mo.Value); g = FsmConverter.GetPointGraph(graph) as PointGraph; Debug.Log("Creating New Point Graph"); graph.Value = FsmConverter.SetPointGraph(g); } // create a PointGraph if the variable does not contain a valid one already. else { g = FsmConverter.GetPointGraph(graph) as PointGraph; } DoStuff(); Finish(); }