1
TNet 3 Support / Re: Custom Object Creation functions (1.8.0+)
« on: February 22, 2015, 09:02:56 PM »
It would be kinda nice to have immediate access to the gameobjects. Kindof like
- class SpawnerButton :MonoBehavior
- {
- void OnMouseDown()
- {
- GameObject go=TNManager.Create ("Token",Vector3.zero,Quaternion.identity,false);
- //yield new WaitForSeconds(1);
- go.GetComponent<Token>().SetName("Random name "+r.Next(100).ToString());
- }
- }
- public class Token:TNBehavior
- {
- public void SetName(string newname)
- {
- tno.Send ("SetNameRFC",Target.AllSaved,newname);
- }
- [RFC]
- public void SetNameRFC(string newname)
- {
- name=newname;
- }
- }
