Пример #1
0
 private static StateMachine[] FindFsms()
 {
     StateMachine[]   fsms       = UnityEditorUtility.GetAssetsOfType <StateMachine> (".asset");
     ICodeBehaviour[] behaviours = UnityEditorUtility.FindInScene <ICodeBehaviour>().ToArray();
     fsms = ArrayUtility.AddRange <StateMachine>(fsms, behaviours.Where(x => !EditorUtility.IsPersistent(x.stateMachine)).Select(y => y.stateMachine).ToArray());
     return(fsms);
 }
Пример #2
0
 private void FindFsms()
 {
     if (location == Loaction.Project)
     {
         fsms = UnityEditorUtility.GetAssetsOfType <StateMachine> (".asset");
     }
     else
     {
         ICodeBehaviour[] behaviours = UnityEditorUtility.FindInScene <ICodeBehaviour>().ToArray();
         fsms    = behaviours.Select(x => x.stateMachine).ToArray();
         targets = behaviours.Select(x => x.gameObject).ToArray();
     }
 }