public void RemoveClip(BbSpriteAnimationClip pClip)
 {
     animations.Remove(pClip);
     _animationsCheck.Remove(pClip);
     foreach (var entry in _animationsByName)
     {
         if (entry.Value == pClip)
         {
             _animationsByName.Remove(entry.Key);
             break;
         }
     }
 }
    public void Setup4X4()
    {
        animations.Clear();
        _animationsCheck.Clear();
        var clip_idle = BbSpriteAnimationClip.CreateAnimationClip(
            "idle",
            new int[] { 0 }
            );

        animations.Add(clip_idle);
        var clip_walk = BbSpriteAnimationClip.CreateAnimationClip(
            "walk",
            new int[] { 4, 8, 12, 8 },
            .2f,
            WrapMode.Loop
            );

        animations.Add(clip_walk);
        clip = clip_walk;
        SyncDictionary();
    }
Exemplo n.º 3
0
    static BbSpriteAnimationClip()
    {
        if (Idle_3X4 == null)
        {
            Idle_3X4 = Resources.Load <BbSpriteAnimationClip>("3x4_idle");
            if (Idle_3X4 != null)
            {
                Idle_3X4.hideFlags = HideFlags.NotEditable;
            }
        }
        if (Idle_4X4 == null)
        {
            Idle_4X4 = Resources.Load <BbSpriteAnimationClip>("4x4_idle");
            if (Idle_4X4 != null)
            {
                Idle_4X4.hideFlags = HideFlags.NotEditable;
            }
        }
        if (Walk_3X4 == null)
        {
            Walk_3X4 = Resources.Load <BbSpriteAnimationClip>("3x4_walk");
            if (Walk_3X4 != null)
            {
                Walk_3X4.hideFlags = HideFlags.NotEditable;
            }
        }
        if (Walk_4X4 == null)
        {
            Walk_4X4 = Resources.Load <BbSpriteAnimationClip>("4x4_walk");
            if (Walk_4X4 != null)
            {
                Walk_4X4.hideFlags = HideFlags.NotEditable;
            }
        }

        //if (Idle_3X4 == null) UnityEngine.Debug.Log("I.3.4 invalid");
        //if (Idle_4X4 == null) UnityEngine.Debug.Log("I.4.4 invalid");
        //if (Walk_3X4 == null) UnityEngine.Debug.Log("W.3.4 invalid");
        //if (Walk_4X4 == null) UnityEngine.Debug.Log("W.4.4 invalid");
    }
 public void AddClip(BbSpriteAnimationClip pClip, string pName)
 {
     animations.Add(pClip);
     _animationsCheck.Add(pClip);
     _animationsByName[pName] = pClip;
 }