Jump to content

Chris

Members
  • Posts

    2
  • Joined

  • Last visited

Posts posted by Chris

  1. 13 minutes ago, wagnmich@gmail.com said:

    SpriterDotNet.Unity works great for me, but it seems it does not support spriter spritesheet animations at this point in time. I would be very interested in this feature as well. It looks like the importer is not telling unity to make the imported sprite a multiple images type, and hence unity cannot populate the sprites in the prefab with sprite references, since they are just not available by name from a single type sprite. This makes the sprite argument null at runtime throwing the exception. Using the original spriter project instead of the generated spritesheet project should solve your problem right away. I know it is far better to use atlases for performance reasons, but in the meantime we can use it this way and correct this lateron. Hopefully this feature is developed on and available sometime soon. :) If so, THANK YOU SO MUCH loodakrawa! Love your work!

    Thanks a bunch, wagnmich@gmail.com.  Guess I'll give the regular spriter projects a try then.

  2. Is there an example for handling everything at runtime that works with Unity 5.3?  I am asking as I have issues making things work.  I have simply created the Adventure Platformer Pack player as a spritesheeted project (File->"Generate spritesheets for project images" and selected "save spritesheeted project") and copied that to my assets.  Unity creates the prefab as expected, but that's where things come to a grinding halt.

    if(spriterAnimator == null) 
    {
    	spriterBehaviour = player.gameObject.GetComponentInChildren<SpriterDotNetBehaviour>();
    	spriterAnimator = spriterBehaviour.Animator;
    	spriterAnimator.EventTriggered += e => Debug.Log("Event Triggered. Source: " + spriterAnimator.CurrentAnimation.Name + ". Value: " + e);
                    
    	foreach(string key in spriterAnimator.GetAnimations())
    		Debug.Log("spriterAnimator.GetAnimations: " + key);
    
    	spriterAnimator.Speed = 1.0f;
    	spriterAnimator.Play("walk");
    }

    The code above seems to work, as in it produces valid objects and creates a debug output list of all animations, but nothing is ever rendered and an exception is thrown for every frame update:

    ArgumentNullException: Argument cannot be null.
    Parameter name: key
    System.Collections.Generic.Dictionary`2[UnityEngine.Sprite,System.Collections.Generic.KeyValuePair`2[System.Int32,System.Int32]].ContainsKey (UnityEngine.Sprite key) (at /Users/builduser/buildslave/mono-runtime-and-classlibs/build/mcs/class/corlib/System.Collections.Generic/Dictionary.cs:458)
    SpriterDotNet.SpriterAnimator`2[TSprite,TSound].GetSprite (SpriterDotNet.SpriterObject obj)
    SpriterDotNet.SpriterAnimator`2[TSprite,TSound].Animate (Single deltaTime)
    SpriterDotNetUnity.UnitySpriterAnimator.Animate (Single deltaTime) (at Assets/SpriterDotNet/UnitySpriterAnimator.cs:44)
    SpriterDotNet.SpriterAnimator`2[TSprite,TSound].Step (Single deltaTime)
    SpriterDotNetUnity.SpriterDotNetBehaviour.Update () (at Assets/SpriterDotNet/SpriterDotNetBehaviour.cs:72)

    I am certain I am doing things wrong, just not sure how or where ...  Any help or pointers are much appreciated!

×
×
  • Create New...