示例#1
0
    static void Init()
    {
        LinkWindow window = (LinkWindow)EditorWindow.GetWindow(typeof(LinkWindow));

        window.Show();
    }
示例#2
0
 private void Button_Click(object sender, RoutedEventArgs e)
 {
     LinkWindow.Close();
 }
示例#3
0
    protected virtual void OnEnable()
    {
        stateList                 = new List <AnimatorState>();
        animationName             = serializedObject.FindProperty("animationStateName");
        length                    = serializedObject.FindProperty("length");
        frameRateProp             = serializedObject.FindProperty("frameRate");
        speed                     = serializedObject.FindProperty("playBackSpeed");
        damage                    = serializedObject.FindProperty("damage");
        hitStun                   = serializedObject.FindProperty("hitStun");
        hitStunFrame              = serializedObject.FindProperty("hitStunFrame");
        knockBack                 = serializedObject.FindProperty("knockBack");
        controllerProp            = serializedObject.FindProperty("controller");
        cFCurvesProp              = serializedObject.FindProperty("commonFlagsCurves");
        vFCurvesProp              = serializedObject.FindProperty("valueFlagCurves");
        vCurvesProp               = serializedObject.FindProperty("valueCurves");
        flagData                  = serializedObject.FindProperty("data");
        holdTime                  = serializedObject.FindProperty("holdTime");
        endTime                   = serializedObject.FindProperty("endTime");
        hitVisualEffect           = serializedObject.FindProperty("HitVisualEffect");
        EffectsOnEnter            = serializedObject.FindProperty("EffectsOnEnter");
        EffectsOnExit             = serializedObject.FindProperty("EffectsOnExit");
        ExitConditions            = serializedObject.FindProperty("ExitConditions");
        ExitMove                  = serializedObject.FindProperty("ExitMove");
        links                     = new ReorderableList(serializedObject, serializedObject.FindProperty("links"), true, true, true, true);
        links.drawElementCallback = (Rect rect, int index, bool isActive, bool isFocused) =>
        {
            SerializedProperty element = links.serializedProperty.GetArrayElementAtIndex(index);
            //rect.y += 2;
            //EditorGUI.LabelField(rect, new GUIContent("Move"));
            EditorGUI.PropertyField(new Rect(rect.x, rect.y, rect.width * 0.50f, rect.height), element.FindPropertyRelative("move"), GUIContent.none);
            EditorGUI.PropertyField(new Rect(rect.x + rect.width * 0.5f, rect.y, rect.width * 0.3f, rect.height), element.FindPropertyRelative("priority"), GUIContent.none);
            if (GUI.Button(new Rect(rect.width * 0.9f, rect.y, rect.width * 0.15f, rect.height), new GUIContent("detail")))
            {
                LinkWindow window = (LinkWindow)EditorWindow.GetWindow(typeof(LinkWindow));
                window.SetLink(element);
                window.Show();
            }
        };
        links.drawHeaderCallback = (Rect rect) =>
        {
            EditorGUI.LabelField(rect, "Links");
        };
        HitTargetEffects = serializedObject.FindProperty("HitTargetEffects");

        HitUserEffects = serializedObject.FindProperty("HitUserEffects");
        //TODO: better way of chacking that the curve sizes are correct
        SerializedProperty sp = cFCurvesProp.Copy();

        sp.Next(true);
        sp.Next(true);
        for (int i = 0; i < foldOuts.Length; i++)
        {
            foldOuts[i]    = new bool[2];
            foldOuts[i][0] = false;
            foldOuts[i][1] = false;
        }
        if (sp.intValue != Enum.GetValues(typeof(CommonFlags)).Length - 1)
        {
            MoveData data = (MoveData)target;
            data.ResizeCurves();
        }
        UpdateStateList();
    }