Hello Guest

Show Posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.


Topics - mrwallace

Pages: [1]
1
Support / Problem with setting a library dynamically
« on: August 20, 2013, 05:12:18 pm »
Hi all:

I want to change the sprite collection and get a clip in runtime.
I have search in the forum and there are some similar questions but i couldn't make my script work.
I have this:

private var tkScript : tk2dSpriteAnimator;
private var data : tk2dSpriteAnimation;

function Start () {
tkScript = gameObject.GetComponentInChildren (tk2dSpriteAnimator);
data= Resources.Load("TestChar", typeof(tk2dSpriteAnimation)) as tk2dSpriteAnimation;
tkScript.Library = data;
tkScript.Play("Test");

If i try with tk2dSpriteCollectionData i can pick sprites from my resources and it works, but when i try this to pick a clip its says Library not set on play windows in Unity

Pages: [1]