public float Play(string animName) { SpriteAnimationElement elem = null; if (m_AnimationStore.TryGetValue(animName, out elem)) { Stop(); m_CurrentStep = elem; m_CurrentStep.Play(); return m_CurrentStep.GetAnimLength(); } else { Debuger.LogError("can't play anim" + animName); } return 0.0f; }
public float Play(string animName) { SpriteAnimationElement elem = null; if (m_AnimationStore.TryGetValue(animName, out elem)) { Stop(); m_CurrentStep = elem; m_CurrentStep.Play(); return(m_CurrentStep.GetAnimLength()); } else { Debuger.LogError("can't play anim" + animName); } return(0.0f); }
public void Initialize(GameObject root) { if (null == root) { return; } m_ObjectRoot = root; m_AnimationStore = new Dictionary<string, SpriteAnimationElement>(m_ObjectRoot.transform.childCount); for (int i = 0; i < m_ObjectRoot.transform.childCount; ++i) { SpriteAnimationElement elem = new SpriteAnimationElement(m_ObjectRoot.transform.GetChild(i).gameObject); m_AnimationStore.Add(m_ObjectRoot.transform.GetChild(i).gameObject.name, elem); //deactive elem.Stop(); } }
public void Initialize(GameObject root) { if (null == root) { return; } m_ObjectRoot = root; m_AnimationStore = new Dictionary <string, SpriteAnimationElement>(m_ObjectRoot.transform.childCount); for (int i = 0; i < m_ObjectRoot.transform.childCount; ++i) { SpriteAnimationElement elem = new SpriteAnimationElement(m_ObjectRoot.transform.GetChild(i).gameObject); m_AnimationStore.Add(m_ObjectRoot.transform.GetChild(i).gameObject.name, elem); //deactive elem.Stop(); } }