public override Transform Realizes(Transform parent = null, int layer = -1) { if (instantiatedObject == null) { return(base.Realizes(parent, layer)); } return(InstantiateManager.Realizes(ref instantiatedObject, parent, layer)); }
//实例化添加组件 protected IEnumerator IE_InstantAndAddC() { yield return(ToolsScripts.StartCoroutine(InstantiateManager.GetInstance().IE_InstantiateObjMain())); yield return(ToolsScripts.StartCoroutine(InstantiateManager.GetInstance().IE_AddComponent())); yield return(null); }
public LoadAndInstantiateObject(MonoBehaviour mono_behaviour, RESOURCE_CATEGORY category, string resource_name) { Load(mono_behaviour, category, resource_name, false); if (MonoBehaviourSingleton <InstantiateManager> .IsValid() && !base.isLoading && loadedObject != null) { base.isLoading = true; InstantiateManager.Request(resLoad, loadedObject, OnInstantiate, true); } }
public void ClearPoolObjects() { EffectManager.ClearPoolObjects(); CoopNetworkManager.ClearPoolObjects(); ChatNetworkManager.ClearPoolObjects(); TargetMarkerManager.ClearPoolObjects(); EnemyLoader.ClearPoolObjects(); InstantiateManager.ClearPoolObjects(); ResourceObject.ClearPoolObjects(); PackageObject.ClearPoolObjects(); DelayUnloadAssetBundle.ClearPoolObjects(); }
protected virtual void OnLoadComplate(ResourceManager.LoadRequest request, ResourceObject[] objs) { if (objs != null && objs.Length >= 1 && objs[0] != null) { loadedObject = objs[0].obj; } loadedObjects = objs; isLoading = false; resLoad.SetReference(loadedObjects); if (IsStock(request)) { InstantiateManager.RequestStock(request.category, loadedObject, request.resourceNames[0], true); } }
protected override void OnLoadComplate(ResourceManager.LoadRequest request, ResourceObject[] objs) { if (!MonoBehaviourSingleton <InstantiateManager> .IsValid()) { base.OnLoadComplate(request, objs); } else if (objs != null && objs.Length == 1 && objs[0] != null) { loadedObject = objs[0].obj; loadedObjects = objs; resLoad.SetReference(loadedObjects); InstantiateManager.Request(resLoad, objs[0].obj, OnInstantiate, true); } else { base.isLoading = false; Log.Warning("LoadAndInstantiateObject : not support."); } }
private static Transform GetEffect(RESOURCE_CATEGORY category, string effect_name, Transform parent = null, int layer = -1, bool enable_stock = false) { //IL_006c: Unknown result type (might be due to invalid IL or missing references) //IL_0071: Expected O, but got Unknown //IL_0098: Unknown result type (might be due to invalid IL or missing references) //IL_009d: Expected O, but got Unknown //IL_00b5: Unknown result type (might be due to invalid IL or missing references) //IL_00ba: Expected O, but got Unknown //IL_00d6: Unknown result type (might be due to invalid IL or missing references) //IL_00db: Expected O, but got Unknown //IL_00f2: Unknown result type (might be due to invalid IL or missing references) //IL_00f7: Expected O, but got Unknown //IL_010e: Unknown result type (might be due to invalid IL or missing references) //IL_0113: Expected O, but got Unknown if (string.IsNullOrEmpty(effect_name)) { return(null); } if (MonoBehaviourSingleton <EffectManager> .IsValid()) { EffectManager i = MonoBehaviourSingleton <EffectManager> .I; effect_name = ResourceName.AddAttributID(effect_name); if (MonoBehaviourSingleton <ResourceManager> .IsValid()) { if (parent == null) { parent = i._transform; } GameObject val = null; GameObject inactive_inctance = null; Transform val2 = null; bool flag = i.enableStock && enable_stock; if (flag) { Transform val3 = i.stockParent.FindChild(effect_name); if (val3 != null) { val3.GetComponent <EffectStock>().Recycle(parent, layer); return(val3); } } inactive_inctance = InstantiateManager.FindStock(category, effect_name); if (inactive_inctance != null) { val2 = InstantiateManager.Realizes(ref inactive_inctance, parent, layer); inactive_inctance = val2.get_gameObject(); } else { val = ((!ResourceManager.enableLoadDirect) ? MonoBehaviourSingleton <ResourceManager> .I.cache.GetCachedObject(category, effect_name) : MonoBehaviourSingleton <ResourceManager> .I.LoadDirect(category, effect_name)); if (val != null) { val2 = ResourceUtility.Realizes(val, parent, layer); inactive_inctance = val2.get_gameObject(); } } if (inactive_inctance != null) { if (flag) { inactive_inctance.AddComponent <EffectStock>(); } return(val2); } } } return(null); }
void Awake() { m_Singleton = this; GameplayItemManager.Singleton.LoadDatabase(); }
public static UIBehaviour CreatePrefabUI(Object prefab, GameObject inactive_inctance, Type add_component_type, bool initVisible, Transform parent, int depth, GameSceneTables.SectionData section_data) { //IL_0059: Unknown result type (might be due to invalid IL or missing references) //IL_00a4: Unknown result type (might be due to invalid IL or missing references) //IL_00aa: Unknown result type (might be due to invalid IL or missing references) //IL_00af: Expected O, but got Unknown //IL_00bb: Unknown result type (might be due to invalid IL or missing references) if (parent == null && MonoBehaviourSingleton <UIManager> .IsValid()) { parent = MonoBehaviourSingleton <UIManager> .I._transform; } string text = prefab.get_name(); if (text.StartsWith("internal__")) { text = text.Substring(text.LastIndexOf("__") + 2); } Transform val = Utility.CreateGameObject(text, parent, 5); val.get_gameObject().AddComponent <UIPanel>(); Transform val2 = null; val2 = ((!(inactive_inctance != null)) ? ResourceUtility.Realizes(prefab, val, 5) : InstantiateManager.Realizes(ref inactive_inctance, val, 5)); if (add_component_type == null) { add_component_type = Type.GetType(val2.get_name()); } UIBehaviour uIBehaviour = (add_component_type == null) ? val.get_gameObject().AddComponent <UIBehaviour>() : (val.get_gameObject().AddComponent(add_component_type) as UIBehaviour); uIBehaviour.collectUI = val2; uIBehaviour.sectionData = section_data; TestTransitionAnim(val2, section_data); if (MonoBehaviourSingleton <UIManager> .I.common != null) { int num = 0; string text2 = uIBehaviour.GetCaptionText(); if (section_data != (GameSceneTables.SectionData)null) { if (text2 == null) { text2 = section_data.GetText("CAPTION"); } num = section_data.backButtonIndex; } if (num > 0) { MonoBehaviourSingleton <UIManager> .I.common.AttachBackButton(uIBehaviour, num - 1); } MonoBehaviourSingleton <UIManager> .I.common.AttachCaption(uIBehaviour, num, text2); } uIBehaviour.InitUI(); uIBehaviour.baseDepth = depth; if (!initVisible) { val2.GetComponentsInChildren <UIWidget>(Temporary.uiWidgetList); int i = 0; for (int count = Temporary.uiWidgetList.Count; i < count; i++) { Temporary.uiWidgetList[i]._Update(); } Temporary.uiWidgetList.Clear(); } uIBehaviour.uiVisible = initVisible; return(uIBehaviour); }