public void Activate(FlumpMovie i_FlumpMovie, int i_Layer) { if (string.IsNullOrEmpty(m_Ref)) { return; } m_Sprite = FlumpSpriteManager.Instance.AddSprite(m_Ref, 0, 0); m_Sprite.transform.SetParent(i_FlumpMovie.m_Transform); m_Sprite.transform.localPosition = GetPosition(); m_Sprite.transform.localRotation = Quaternion.identity; m_Sprite.SetLayer(i_FlumpMovie.m_SortingOrder, i_Layer, i_FlumpMovie.m_LocatorLayer); ApplyRotation(m_Sprite.transform, -m_Rotation.x); m_Sprite.transform.localScale = m_Scale; if (m_Sprite.m_SpriteName.Contains("Locator")) { i_FlumpMovie.AddLocator(m_Sprite, i_Layer); } /*if (m_Sprite.m_SpriteName == "Locator_Staff") * { * m_Movie = FlumpMovieManager.Instance.AddMovie ("Movie_Staff" , 0f , 0f); * m_Movie.transform.SetParent (m_Sprite.transform); * m_Movie.transform.localPosition = Vector2.zero; * m_Movie.transform.localRotation = Quaternion.identity; * m_Movie.Play(true , i_Layer); * }*/ }
public void Tween(int i_CurrentFrame, KeyFrame i_NextKeyFrame, int i_Layer, FlumpMovie i_FlumpMovie) { if (m_Sprite != null) { m_Sprite.transform.localPosition = GetPosition() + ((i_NextKeyFrame.GetPosition() - GetPosition()) * GetTweenPercentage(i_CurrentFrame)); m_Sprite.SetLayer(i_FlumpMovie.m_SortingOrder, i_Layer, i_FlumpMovie.m_LocatorLayer); ApplyRotation(m_Sprite.transform, -(m_Rotation.x + ((i_NextKeyFrame.m_Rotation.x - m_Rotation.x) * GetTweenPercentage(i_CurrentFrame)))); m_Sprite.transform.localScale = m_Scale + ((i_NextKeyFrame.m_Scale - m_Scale) * GetTweenPercentage(i_CurrentFrame)); } }