public DisplayObj Instantiate(Vector3 goPos, Quaternion goRotation) { DisplayObj obj = new DisplayObj(name + "(copy)"); obj.SetObjAndInstantiate(go); obj.localPosition = goPos; obj.localRotation = goRotation; return(obj); }
public DisplayObj(string goName, bool createGO = true) { name = goName; if (createGO == true) { go = new GameObject(name); instance = this; go.SetDisplayObj(ref instance); tran = go.transform; } }
public virtual void SetGO(GameObject gameObject) { if (go == null) { go = gameObject; instance = this; go.SetDisplayObj(ref instance); tran = go.transform; } else { Debug.LogError("DisplayObj's GameObject is not null!"); } }