Beispiel #1
0
        private static void DoMakeAnimationState(bool addGlobalTransition)
        {
            Skill         fsm           = SkillEditorMacros.droppedOnFsm;
            AnimationClip animationClip = SkillEditorMacros.droppedObject as AnimationClip;
            Vector2       position      = SkillEditorMacros.droppedPosition;

            if (fsm == null || animationClip == null)
            {
                return;
            }
            SkillEditor.RegisterUndo(fsm, "Drag and Drop");
            SkillEditorMacros.AddAnimationState(fsm, animationClip, position, addGlobalTransition);
            SkillEditor.SetFsmDirty(fsm, true, false, true);
        }
Beispiel #2
0
 public static void DropObjectOnGraphView(Skill targetFsm, Object obj, Vector2 position = default(Vector2))
 {
     SkillEditorMacros.droppedOnFsm    = targetFsm;
     SkillEditorMacros.droppedObject   = obj;
     SkillEditorMacros.droppedPosition = position;
     if (targetFsm == null)
     {
         GameObject   gameObject   = obj as GameObject;
         PlayMakerFSM fsmComponent = SkillBuilder.AddFsmToGameObject(gameObject, true, null);
         Selection.set_activeGameObject(gameObject);
         SkillEditor.SelectFsm(fsmComponent);
         return;
     }
     if (obj is AnimationClip)
     {
         SkillEditorMacros.DropAnimationClipOntoGraphView(SkillEditor.SelectedFsm, obj as AnimationClip, position);
         return;
     }
     if (obj is Animation)
     {
         SkillEditorMacros.DropAnimationComponentOntoGraphView(SkillEditor.SelectedFsm, obj as Animation, position);
     }
 }
Beispiel #3
0
        private static void DoMakeAnimationStates(bool addGlobalTransition)
        {
            Skill     fsm       = SkillEditorMacros.droppedOnFsm;
            Animation animation = SkillEditorMacros.droppedObject as Animation;
            Vector2   position  = SkillEditorMacros.droppedPosition;

            if (fsm == null || animation == null)
            {
                return;
            }
            SkillEditor.RegisterUndo(fsm, "Drag and Drop");
            AnimationClip[] animationClips = AnimationUtility.GetAnimationClips(animation.get_gameObject());
            AnimationClip[] array          = animationClips;
            for (int i = 0; i < array.Length; i++)
            {
                AnimationClip animationClip = array[i];
                if (animationClip != null)
                {
                    SkillEditorMacros.AddAnimationState(fsm, animationClip, position, addGlobalTransition);
                    position = new Vector2(position.x + 200f, position.y);
                }
            }
            SkillEditor.SetFsmDirty(fsm, true, false, true);
        }
Beispiel #4
0
 private static void MakeAnimationStatesWithGlobalTransitions()
 {
     SkillEditorMacros.DoMakeAnimationStates(true);
 }
Beispiel #5
0
 private static void MakeAnimationStatesFromComponent()
 {
     SkillEditorMacros.DoMakeAnimationStates(false);
 }
Beispiel #6
0
 private static void MakeAnimationStateFromClip()
 {
     SkillEditorMacros.DoMakeAnimationState(false);
 }