Exemplo n.º 1
0
 public void ReturnSprite(FlumpSprite i_Sprite)
 {
     //m_FlumpSpriteList.Add(i_Sprite);
     i_Sprite.gameObject.SetActive(false);
     i_Sprite.transform.SetParent(transform);
     i_Sprite.m_Available = true;
 }
Exemplo n.º 2
0
 public void RemoveLocator(FlumpSprite i_Sprite)
 {
     if (m_RemoveLocatorCallback != null)
     {
         m_RemoveLocatorCallback(i_Sprite);
     }
 }
Exemplo n.º 3
0
 public void AddLocator(FlumpSprite i_Sprite, int i_LocatorLayer)
 {
     if (m_AddLocatorCallback != null)
     {
         m_AddLocatorCallback(i_Sprite, i_LocatorLayer);
     }
 }
Exemplo n.º 4
0
        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);
             * }*/
        }
Exemplo n.º 5
0
    public FlumpSprite CreateSprite(float i_OffSetX, float i_OffSetY, string i_SpriteName)
    {
        GameObject  go          = (GameObject)GameObject.Instantiate(m_FlumpSpritePrefab);
        FlumpSprite flumpSprite = go.GetComponent <FlumpSprite>();

        flumpSprite.SetData(i_OffSetX, i_OffSetY, i_SpriteName);
        go.transform.parent = gameObject.transform;
        go.SetActive(false);

        m_FlumpSpriteList.Add(flumpSprite);

        return(flumpSprite);
    }
Exemplo n.º 6
0
    public FlumpSprite AddSprite(string i_SpriteName, float i_PosX, float i_PosY)
    {
        FlumpSprite sprite = GetSprite(i_SpriteName);

        if (sprite != null)
        {
            sprite.gameObject.SetActive(true);
            sprite.gameObject.transform.position = Vector2.zero;
            sprite.m_Available = false;
            return(sprite);
        }

        Debug.Log("Couldn't find : " + i_SpriteName);
        return(null);
    }
Exemplo n.º 7
0
    public FlumpSprite GetSprite(string i_Name)
    {
        FlumpSprite reference = null;

        for (int i = 0; i < m_FlumpSpriteList.Count; i++)
        {
            if (m_FlumpSpriteList[i].m_SpriteName == i_Name)
            {
                reference = m_FlumpSpriteList[i];
                if (m_FlumpSpriteList[i].m_Available)
                {
                    FlumpSprite returnSprite = m_FlumpSpriteList[i];
                    return(returnSprite);
                }
            }
        }

        if (reference != null)
        {
            return(CreateSprite(reference.m_OffSetX, reference.m_OffSetY, reference.m_SpriteName));
        }

        return(null);
    }
Exemplo n.º 8
0
 public Locator(int i_Layer, FlumpSprite i_Sprite)
 {
     m_Layer  = i_Layer;
     m_Sprite = i_Sprite;
 }