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.


Messages - djip123

Pages: [1]
1
Support / Re: tk2dSprite.SetSprite(newCollection, Sprite)
« on: October 31, 2013, 01:01:01 pm »
Wow, so sad, the script was attached to another Gameobject on the scene! Ok my bad ^_^

But anyway thanks for the fast reply, maybe i will need it later, keep up the good work with 2D ToolKit!

2
Support / Re: tk2dSprite.SetSprite(newCollection, Sprite)
« on: October 31, 2013, 12:38:23 pm »
This line gives Error:
int spriteID = CD.GetSpriteIdByName("infoBox");

And CD returns null, but i don't really understand since i have dragged it in the script, and it seems ok.

3
Support / tk2dSprite.SetSprite(newCollection, Sprite)
« on: October 31, 2013, 10:49:08 am »
Hey. I got some code that i think is right, but it gives a error: NullReferenceException: Object reference is not set to an instance of an object.
I have dragged the Datacollection into the script. But i guess there could be a issue there ?
Code: [Select]
public tk2dSpriteCollectionData CD;
public int i;

public List<GameObject> Servers = new List<GameObject>();

private RoomInfo[] oldList;
void Awake () {

}

// Update is called once per frame
void Update () {
if (oldList != PhotonNetwork.GetRoomList()){

// foreach(tk2dSprite obj in this.gameObject.GetComponentsInChildren<tk2dSprite>()){
// GameObject.Destroy(obj.gameObject);
// }

i = 0;

foreach (RoomInfo game in PhotonNetwork.GetRoomList()){
int spriteID = CD.GetSpriteIdByName("infoBox");
// GameObject tempObj = new GameObject("Server "+i.ToString());
GameObject obj = new GameObject();
tk2dSprite.AddComponent(obj, CD, spriteID);
// tk2dSprite tempSpr = tempObj.AddComponent<tk2dSprite>();
// tempSpr.SetSprite(CD,CD.);
// tempObj.GetComponent<tk2dSprite>().SetSprite
// tempObj.transform.position = new Vector3(0,0,-0.1f);

// this.gameObject.AddChild(tempObj.transform);
//Servers.Add(tempObj);
i++;

Debug.Log("Server Added");
}

oldList = PhotonNetwork.GetRoomList();

Debug.Log("GameList Updated");
}
}

Please check if something is wrong ?

Pages: [1]