Hi,
Maybe first a little on my background, I'm just a few weeks into Unity, C# & 2D Toolkit now. I've bin through a lot of tutorials and I'm seeing progress every day
I found there are many 2D Toolkit classes and functions, but for now I only need to use some basic 2Dtk functions. Still I've been not very successful at getting them working in my code. I might just need to read this page:
http://unikronsoftware.com/2dtoolkit/doc/html/index.html ..when it's done haha
But basically I'd love to find just a few more examples on how to use them to get things up and running. Maybe something similar to this one:
http://unikronsoftware.com/2dtoolkit/doc/tutorial/scripting_an_animated_sprite.html (where can I find the int clipId in this?)
I now have script attached to a game object, it creates and instantiated a new game object prefab that is an animated clip. Like this:
using UnityEngine;
using System.Collections;
public class Test : MonoBehaviour
{
public GameObject prefab_clip;
private tk2dAnimatedSprite anim;
// Use this for initialization
void Start ()
{
anim = GetComponent<tk2dAnimatedSprite>();
prefab_clip = Instantiate(prefab_clip, transform.position, transform.rotation) as GameObject;
}
// Update is called once per frame
void Update ()
{
if(Input.GetMouseButton(0))
{
prefab_clip.renderer.enabled = true;
}
else
{
prefab_clip.renderer.enabled = false;
}
}
}
It works fine, and I love how well the sprites are handled in the editor, but I guess it's not the way 2D Toolkit was meant to be used.
Any tips, hints, tutorials and practical examples on how to get the basic tk2D functions working in the scripts are very much appreciated.