Esempio n. 1
0
        public AnimationEventStates Clone(/*ReleaseStates releaseStates*/)
        {
            AnimationEventStates cloneAnimationEventStates = new AnimationEventStates();

            cloneAnimationEventStates.Init(m_releaseStates);
            for (int i = 0; i < m_stateList.Count; i++)
            {
                cloneAnimationEventStates.AddState(m_stateList[i].Clone());
            }
            cloneAnimationEventStates.StateSort();
            cloneAnimationEventStates.GraphName = m_graphName;

            //m_releaseStates = releaseStates;

            return(cloneAnimationEventStates);
        }
        public static bool Deserialize(AnimationEventScriptable eventScriptable,
                                       ref AnimationEventStates animationEventStates)
        {
            if (eventScriptable == null)
            {
                return(false);
            }

            //orcaAnimationStates = new OrcaAnimationStates();
            animationEventStates.GraphName = eventScriptable.name.Replace("_animationevent", string.Empty);
            animationEventStates.BoneList  = eventScriptable.boneNames;

            TextAsset graphAsset = eventScriptable.graphAsset;

            if (graphAsset != null)
            {
                DeserializeText(animationEventStates, graphAsset.text);
            }
            animationEventStates.StateSort();

            TextAsset sfxAsset = eventScriptable.sfxAsset;

            if (sfxAsset != null)
            {
                DeserializeText(animationEventStates, sfxAsset.text);
            }

            TextAsset vfxAsset = eventScriptable.vfxAsset;

            if (vfxAsset != null)
            {
                DeserializeText(animationEventStates, vfxAsset.text);
            }

            if (animationEventStates != null)
            {
                for (int i = 0; i < animationEventStates.StateList.Count; i++)
                {
                    AnimationEventState animationEventState = animationEventStates.StateList[i];
                    animationEventState.ConvertAnimationEvents();
                    animationEventState.SortAnimationEvent();
                }
            }
            return(true);
        }