コード例 #1
0
ファイル: Manager.cs プロジェクト: NobuGaga/SkillEditor
        public static bool Exit()
        {
            if (!isEditorMode)
            {
                return(true);
            }
            ushort result = (ushort)EditorUtility.DisplayDialogComplex("退出技能编辑器", "是否保存当前动作的更改",
                                                                       Button[Save], Button[Cancel], Button[NotSave]);

            if (result == Cancel)
            {
                return(false);
            }
            if (result == Save)
            {
                Controller.WriteAnimClipData();
            }
            AnimatorControllerManager.RevertAnimatorControllerFile();
            Controller.Exit();
            ModelManager.Refresh();
            EditorApplication.wantsToQuit -= Exit;
            EditorSceneManager.OpenScene(Config.ExitScenePath);
            EditorApplication.ExecuteMenuItem(Config.ExitLayoutMenuPath);
            return(true);
        }
コード例 #2
0
        private static void SetEffectParticle(uint id, GameObject effectNode)
        {
            ParticleSystem[] particles = effectNode.GetComponentsInChildren <ParticleSystem>(true);
            if (particles == null || particles.Length == 0)
            {
                return;
            }
            m_dicIDEffects.Add(id, particles);
            for (ushort index = 0; index < particles.Length; index++)
            {
                ParticleSystem particle = particles[index];
                if (!FilterParticleObject(particle))
                {
                    continue;
                }
                SetUseAutoSeedEffect(effectNode, particle);
                string name       = particle.name;
                float  startDelay = particle.main.startDelayMultiplier;
                if (!m_dicIDObjectNameDelay.ContainsKey(id))
                {
                    m_dicIDObjectNameDelay.Add(id, new Dictionary <string, float>());
                }
                if (m_dicIDObjectNameDelay[id].ContainsKey(name))
                {
                    m_dicIDObjectNameDelay[id][name] = startDelay;
                }
                else
                {
                    m_dicIDObjectNameDelay[id].Add(name, startDelay);
                }
#pragma warning disable 0618
                particle.startDelay = 0;
#pragma warning restore 0618
            }
            Animator animator = effectNode.GetComponent <Animator>();
            if (animator == null)
            {
                return;
            }
            AnimatorState state = AnimatorControllerManager.GetAnimatorControllerFirstStateName(animator, Config.SkillEffectPath);
            if (state == null || state.motion == null)
            {
                return;
            }
            SkillAnimator animation = new SkillAnimator(animator);
            animation.Record(state);
            m_dicIDEffectAnimation.Add(id, animation);
        }
コード例 #3
0
        private static void InitModelAnimation()
        {
            AnimationModel.AnimationClips = GetAllAnimationClip();
            bool isGeneric = AnimationModel.GenericState();

            SetAnimation(ref m_modelAnimation, isGeneric, m_model);
            if (!isGeneric)
            {
                return;
            }
            string   sourcePath = Tool.FullPathToProjectPath(ModelDataModel.ControllerPath);
            Animator animator   = m_model.GetComponent <Animator>();
            var      controller = animator.runtimeAnimatorController;

            AnimatorControllerManager.RemoveAllAnimatorTransition(controller.name, sourcePath);
        }