Пример #1
0
 void OnGUI()
 {
     // 試しにラベルを表示
     EditorGUILayout.LabelField(EditorSceneManager.GetActiveScene().name + " シーン ステートマシン一覧");
     if (GUILayout.Button("Reflesh"))
     {
         StatemachineInfo.Statemachines.Clear();
     }
     _pos = GUILayout.BeginScrollView(_pos);
     StatemachineInfo.Statemachines.ForEach((w) =>
     {
         IStatemachine t = null;
         w.TryGetTarget(out t);
         if (t != null)
         {
             GUILayout.BeginVertical(GUI.skin.box);
             GUILayout.Label(t.ToString(), new GUIStyle()
             {
                 fontSize = 14
             }, GUILayout.Width(300));
             GUILayout.BeginHorizontal();
             GUILayout.Label(t.StateName(), (GUIStyle)"OL Title", GUILayout.Width(150));
             GUILayout.Label(t.IsContinued() ? "継続" : "終了", (GUIStyle)"OL Title", GUILayout.Width(50));
             GUILayout.EndHorizontal();
             GUILayout.EndVertical();
             //EditorGUILayout.LabelField(t.ToString(),Color.white, Color.black, 18);
         }
     });
     GUILayout.EndScrollView();
 }
Пример #2
0
 void OnGUI()
 {
     // 試しにラベルを表示
     EditorGUILayout.LabelField(EditorSceneManager.GetActiveScene().name + " シーン ステートマシン一覧");
     if (GUILayout.Button("Reflesh"))
     {
         StatemachineInfo.Statemachines.Clear();
     }
     _pos = GUILayout.BeginScrollView(_pos);
     StatemachineInfo.Statemachines.ForEach((w) =>
     {
         IStatemachine t = null;
         w.TryGetTarget(out t);
         if (t != null)
         {
             GUILayout.BeginVertical("box", GUILayout.Height(20), GUILayout.Width(150), GUILayout.ExpandHeight(false), GUILayout.ExpandWidth(false));
             string list = Regex.Match(t.ToString(), "\\[([\\s\\S]*)\\]").Value;
             GUILayout.Label(list);//,GUILayout.Height(20));
             GUILayout.BeginHorizontal("box", GUILayout.ExpandHeight(false), GUILayout.ExpandWidth(false));
             GUILayout.Label(t.StateName(), GUILayout.Width(120));
             GUILayout.Label(t.IsContinued() ? "継続" : "終了", GUILayout.Width(30));
             GUILayout.EndHorizontal();
             GUILayout.EndVertical();
             //EditorGUILayout.LabelField(t.ToString(),Color.white, Color.black, 18);
         }
     });
     GUILayout.EndScrollView();
 }
Пример #3
0
    public static void Add(IStatemachine sm)
    {
        Statemachines.Add(new WeakReference <IStatemachine>(sm));

        //Statemachines.Clear();
    }