public bool LoadObject() { PrefabGameObject = ResourcesManager.Instance.LoadGameObject(PrefabName); if (PrefabGameObject == null) { Debug.LogError("No prefab found at path:" + PrefabName); return(false); } else { PrefabGameObject.SetActive(false); PrefabGameObject.transform.parent = parent; return(true); } }
public void Add(string PrefabName, GameObject go) { if (this.m_PrefabGameObject == null) { this.m_PrefabGameObject = new List <PrefabGameObject>(); } PrefabGameObject prefabGameObject = null; foreach (PrefabGameObject current in this.m_PrefabGameObject) { if (current.m_PrefabName == PrefabName) { prefabGameObject = current; } } if (prefabGameObject == null) { prefabGameObject = new PrefabGameObject(); prefabGameObject.m_PrefabName = PrefabName; prefabGameObject.m_PrefabGameObjectList = new List <GameObject>(); this.m_PrefabGameObject.Add(prefabGameObject); } prefabGameObject.m_PrefabGameObjectList.Add(go); }