/// <summary> /// /// </summary> /// <typeparam name="T"></typeparam> /// <param name="prefabName"></param> /// <param name="flag"></param> /// <param name="parentGo"></param> /// <param name="name"></param> /// <returns></returns> static T _AddMainFrameFacilityPrefab <T>(string prefabName, MainFrameAddFlags flag, GameObject parentGo = null, string name = null) where T : Component { //_mainFrame.FacilityFlags |= flag; var prefab = ResourceManager.instance.Create(prefabName); var go = GameObject.Instantiate(prefab) as GameObject; go.transform.parent = (parentGo == null) ? EAMainFrame.instance.transform : parentGo.transform; go.transform.localPosition = new Vector3(0, 0, 0); go.transform.localRotation = Quaternion.identity; return(go.GetComponent <T>()); }
/// <summary> /// /// </summary> /// <param name="flag"></param> public void OnMainFrameFacilityCreated(MainFrameAddFlags flag) { // In the case of instant test, this is the code to determine when all GameObjects of MainFrame are awakened because MainFrame is already created. _facilityCreatedFlags |= flag; // When all MainFrame devices are awake, we immediately proceed with PostInit () of MainFrame. if (IsMainFramePosInitReady()) { TryPostInit(); } }