//--------------------------------------------------------------------------------------------------------- void Execute(EventAnimationType _type) { if (m_currentAnimation != null) { return; } for (int i = 0; i < m_eventAnimations.Count; i++) { if ((m_eventAnimations [i].Type & _type) != 0) { m_currentAnimation = StartCoroutine(Co_Animate(m_eventAnimations [i])); } } }
//--------------------------------------------------------------------------------------------------------- public void Editor_StartAnimation(EventAnimationType _type) { m_initialPosition = transform.position; m_initialRotation = transform.rotation; m_initialScale = transform.localScale; for (int i = 0; i < m_eventAnimations.Count; i++) { var animData = m_eventAnimations [i].GetAnimations(); for (int j = 0; j < animData.Length; j++) { m_editorRoutines.Add(animData[j].Co_Animate(transform, null)); } EditorApplication.update += Editor_Update; } }
//--------------------------------------------------------------------------------------------------------- void PlayAnimation(EventAnimationType _type) { var ea = serializedObject.targetObject as EventAnimator; ea.Editor_StartAnimation(_type); }