Пример #1
0
    void _DrawArray(SerializedProperty pArray)
    {
        GUILayout.Label("Menu interactions", EditorStyles.boldLabel); //3
        for (int i = 0; i < pArray.arraySize; i++)
        {
            EditorGUILayout.BeginVertical(EditorStyles.helpBox);
            SerializedProperty animation = pArray.GetArrayElementAtIndex(i);

            UnityEngine.Object canvasGroup     = animation.FindPropertyRelative("menu").objectReferenceValue;
            AnimationOption    animationOption = (AnimationOption)animation.FindPropertyRelative("animation").enumValueIndex;
            SerializedProperty swipeDetection  = animation.FindPropertyRelative("swipeDetection");
            Ease ease = (Ease)animation.FindPropertyRelative("ease").enumValueIndex;
            GUILayout.Label("Destination settings", EditorStyles.miniBoldLabel);
            EditorGUILayout.PropertyField(animation.FindPropertyRelative("menu"));

            if (canvasGroup == null)
            {
                if (GUILayout.Button("Remove menu interaction", EditorStyles.toolbarButton))
                {
                    MenuBehaviour menu = (MenuBehaviour)target;
                    menu.animations.RemoveAt(i);
                }
                EditorGUILayout.EndVertical();
                continue;
            }

            EditorGUILayout.PropertyField(animation.FindPropertyRelative("stackOptions"));

            GUILayout.Label("Animation settings", EditorStyles.miniBoldLabel);
            EditorGUILayout.PropertyField(animation.FindPropertyRelative("animation"));
            if (animationOption != AnimationOption.INSTANT)
            {
                EditorGUILayout.PropertyField(animation.FindPropertyRelative("ease"));
                EditorGUILayout.PropertyField(animation.FindPropertyRelative("customCurve"));
                EditorGUILayout.PropertyField(animation.FindPropertyRelative("easeDuration"));
                if (animationOption != AnimationOption.FADEIN)
                {
                    EditorGUILayout.PropertyField(animation.FindPropertyRelative("direction"));
                }
            }

            GUILayout.Label("Animation triggers", EditorStyles.miniBoldLabel);
            EditorGUILayout.PropertyField(animation.FindPropertyRelative("triggerButton"));
            EditorGUILayout.PropertyField(animation.FindPropertyRelative("swipeDetection"));


            GUILayout.Space(5f);
            if (GUILayout.Button("Remove menu interaction", EditorStyles.toolbarButton))
            {
                MenuBehaviour menu = (MenuBehaviour)target;
                menu.animations.RemoveAt(i);
            }
            EditorGUILayout.EndVertical();

            GUILayout.Space(25f);
        }
    }
Пример #2
0
 void btn_Click(object sender, RoutedEventArgs e)
 {
     if (this.SelectedEvent != null)
     {
         Button          btn    = sender as Button;
         int             index  = this.grid.Children.IndexOf(btn);
         AnimationOption option = (AnimationOption)index;
         this.SelectedEvent(this, new OptionArg(option));
         this.Hide();
     }
 }
Пример #3
0
        private void SwithAnimation(AnimationOption option)
        {
            switch (option)
            {
            case AnimationOption.RotateLeft:
                this.CreateLRotateAnimation(this.strokesWillDoAnimation, center);
                break;

            case AnimationOption.RotateRight:
                this.CreateRRotateAnimation(this.strokesWillDoAnimation, center);
                break;

            case AnimationOption.SqueezeHorizontal:
                this.CreateHBlinkAnimation(this.strokesWillDoAnimation);
                break;

            case AnimationOption.SqueeezeVertical:
                this.CreateVBlinkAnimation(this.strokesWillDoAnimation);
                break;

            case AnimationOption.SwingTop:
                this.CreateTSwingAnimation(this.strokesWillDoAnimation);
                break;

            case AnimationOption.SwingBottom:
                this.CreateBSwingAnimation(this.strokesWillDoAnimation);
                break;

            case AnimationOption.SwingLeft:
                this.CreateLSwingAnimation(this.strokesWillDoAnimation);
                break;

            case AnimationOption.SwingRight:
                this.CreateRSwingAnimation(this.strokesWillDoAnimation);
                break;

            case AnimationOption.MoveTop:
                this.CreateGoTopAnimation(this.strokesWillDoAnimation);
                break;

            case AnimationOption.MoveBottom:
                this.CreateGoBottomAnimation(this.strokesWillDoAnimation);
                break;

            case AnimationOption.MoveLeft:
                this.CreateGoLeftAnimation(this.strokesWillDoAnimation);
                break;

            case AnimationOption.MoveRight:
                this.CreateGoRightAnimation(this.strokesWillDoAnimation);
                break;

            case AnimationOption.Jump:
                this.CreateJumpAnimation(this.strokesWillDoAnimation);
                break;

            case AnimationOption.Flash:
                this.CreateFlashAnimation(this.strokesWillDoAnimation);
                break;

            case AnimationOption.Shake:
                this.CreateShakeAnimation(this.strokesWillDoAnimation, AOrientation.Horizontal);
                break;

            default:
                break;
            }
            this.strokesWillDoAnimation = null;
        }
Пример #4
0
 public OptionArg(AnimationOption op)
     : base()
 {
     this.Option = op;
 }