/*public int ID * { * get { return id; } * }*/ void Start() { IDManager manager = GameObject.FindObjectOfType(typeof(IDManager)) as IDManager; //manager.AddID(this); manager.AddObject(gameObject); }
private void SpawnObject() { GameObject temp = GameObject.Instantiate(data.prefab, data.position, data.rotation) as GameObject; ObjectID id = temp.AddComponent <ObjectID>(); id.id = data.associatedID; idManager.AddObject(temp); Complete(); }
private Reference(object obj) { if (obj == null) { UnityEngine.Debug.LogWarning("Obj is null"); throw new NullReferenceException(); } ID = IDManager.AddObject(obj); }
public SerializableObject(UnityEngine.Object obj) { if (obj == null) { throw new NullReferenceException("Object cannot be null"); } _name = obj.name; _hideFlags = obj.hideFlags; _id = IDManager.AddObject(obj); }
public static int AddObject(object obj) { return(IDManager.AddObject(obj)); }