コード例 #1
0
    private IEnumerator DoLoad(int npc_model_id, int layer, bool need_shadow, bool enable_light_probes, SHADER_TYPE shader_type, Action callback)
    {
        loadingQueue = new LoadingQueue(this);
        string     model_name = ResourceName.GetNPCModel(npc_model_id);
        LoadObject lo_model   = loadingQueue.LoadAndInstantiate(RESOURCE_CATEGORY.NPC_MODEL, model_name);
        string     anim_name  = ResourceName.GetNPCAnim(npc_model_id);
        LoadObject lo_anim    = loadingQueue.Load(RESOURCE_CATEGORY.NPC_ANIM, anim_name, new string[1]
        {
            anim_name + "Ctrl"
        }, false);

        if (loadingQueue.IsLoading())
        {
            yield return((object)loadingQueue.Wait());
        }
        model = lo_model.Realizes(this.get_transform(), layer);
        if (model != null)
        {
            head   = Utility.Find(model, "Head");
            facial = model.GetComponentInChildren <NPCFacial>();
            if (facial != null)
            {
                facial.animNode = Utility.Find(model, "Face");
            }
            animator = model.GetComponentInChildren <Animator>();
            if (lo_anim != null && animator != null)
            {
                animator.set_runtimeAnimatorController(lo_anim.loadedObjects[0].obj as RuntimeAnimatorController);
            }
        }
        PlayerLoader.SetLightProbes(model, enable_light_probes);
        renderers = model.GetComponentsInChildren <Renderer>();
        int j = 0;

        for (int i = renderers.Length; j < i; j++)
        {
            if (renderers[j] is SkinnedMeshRenderer)
            {
                (renderers[j] as SkinnedMeshRenderer).set_localBounds(BOUNDS);
            }
        }
        switch (shader_type)
        {
        case SHADER_TYPE.LIGHTWEIGHT:
            ShaderGlobal.ChangeWantLightweightShader(renderers);
            break;

        case SHADER_TYPE.UI:
            ShaderGlobal.ChangeWantUIShader(renderers);
            break;
        }
        if (need_shadow)
        {
            shadow = PlayerLoader.CreateShadow(this.get_transform(), true, -1, shader_type == SHADER_TYPE.LIGHTWEIGHT);
        }
        coroutine = null;
        callback?.Invoke();
    }
コード例 #2
0
        public LoadObject[] LoadUseResources(LoadingQueue load_queue)
        {
            LoadObject[] array = new LoadObject[useResourceList.Count];
            int          i     = 0;

            for (int count = useResourceList.Count; i < count; i++)
            {
                array[i] = load_queue.LoadAndInstantiate(RESOURCE_CATEGORY.UI, useResourceList[i]);
            }
            return(array);
        }
コード例 #3
0
    private IEnumerator DoInit(string resource_name)
    {
        isLoading = true;
        LoadingQueue load_queue  = new LoadingQueue(this);
        LoadObject   load_object = load_queue.LoadAndInstantiate(RESOURCE_CATEGORY.COMMON, resource_name);

        yield return((object)load_queue.Wait());

        model = load_object.Realizes(MonoBehaviourSingleton <AppMain> .I._transform, -1);
        if (model != null)
        {
            models.Add(model);
            UpdateModelOffset();
        }
        isLoading = false;
    }
コード例 #4
0
    private IEnumerator Start()
    {
        LoadingQueue load_queue      = new LoadingQueue(this);
        LoadObject   lo_event_banner = load_queue.LoadAndInstantiate(RESOURCE_CATEGORY.UI, "EventBanner");

        if (load_queue.IsLoading())
        {
            yield return((object)load_queue.Wait());
        }
        mEventBannerPrefab = (lo_event_banner.loadedObject as GameObject);
        AddPrefab(mEventBannerPrefab, lo_event_banner.PopInstantiatedGameObject());
        mCenterOnChild1          = GetCtrl(UI.WRP_EVENT_BANNER1).GetComponent <UICenterOnChild>();
        mCenterOnChild1.onCenter = OnCenter1;
        mCenterOnChild2          = GetCtrl(UI.WRP_EVENT_BANNER2).GetComponent <UICenterOnChild>();
        mCenterOnChild2.onCenter = OnCenter2;
    }
コード例 #5
0
    private IEnumerator DoLoadWeapon(EquipItemTable.EquipItemData data)
    {
        int    modelID = data.GetModelID(sexID);
        string name    = ResourceName.GetPlayerWeapon(modelID);
        byte   highTex = 0;

        if (MonoBehaviourSingleton <GlobalSettingsManager> .IsValid())
        {
            EquipModelHQTable hqTable = MonoBehaviourSingleton <GlobalSettingsManager> .I.equipModelHQTable;
            highTex = hqTable.GetWeaponFlag(modelID);
        }
        LoadObject lo = loadingQueue.LoadAndInstantiate(RESOURCE_CATEGORY.PLAYER_WEAPON, name);
        LoadObject lo_high_reso_tex = PlayerLoader.LoadHighResoTexs(loadingQueue, name, highTex);

        yield return((object)loadingQueue.Wait());

        Transform weapon = lo.Realizes(_transform, _transform.get_gameObject().get_layer());

        weapon.set_localPosition(Vector3.get_zero());
        weapon.set_localRotation(Quaternion.get_identity());
        Renderer[] renderers = weapon.GetComponentsInChildren <Renderer>();
        PlayerLoader.SetEquipColor3(renderers, NGUIMath.IntToColor(data.modelColor0), NGUIMath.IntToColor(data.modelColor1), NGUIMath.IntToColor(data.modelColor2));
        Material materialR = null;
        Material materialL = null;
        int      j         = 0;

        for (int i = renderers.Length; j < i; j++)
        {
            Renderer r = renderers[j];
            if (r.get_name().EndsWith("_L"))
            {
                materialL = r.get_material();
                nodeSub   = r.get_transform();
            }
            else
            {
                materialR = r.get_material();
                nodeMain  = r.get_transform();
            }
        }
        yield return((object)this.StartCoroutine(InitRoopEffect(loadingQueue, weapon, SHADER_TYPE.NORMAL)));

        PlayerLoader.ApplyWeaponHighResoTexs(lo_high_reso_tex, highTex, materialR, materialL);
        displayInfo = new GlobalSettingsManager.UIModelRenderingParam.DisplayInfo(MonoBehaviourSingleton <GlobalSettingsManager> .I.uiModelRendering.WeaponDisplayInfos[(int)data.type]);
        if (data.id == 50020201 || data.id == 50020200)
        {
            displayInfo.mainPos    = new Vector3(0f, 0f, -0.21f);
            displayInfo.mainRot.x += 180f;
            displayInfo.subRot.x  += 180f;
        }
        if (data.id == 60020200 || data.id == 60020201 || data.id == 60020202)
        {
            displayInfo.mainPos = new Vector3(0f, 0f, 0f);
            displayInfo.mainRot = new Vector3(-64.50903f, 93.68915f, -118.1268f);
        }
        OnLoadFinished();
    }
コード例 #6
0
    private IEnumerator DoLoad(int body_id, int anim_id, float scale, string base_effect, string base_effect_node, bool need_shadow, bool enable_light_probes, bool need_anim_event_res_cache, SHADER_TYPE shader_type, int layer, string foundation_name, bool need_stamp_effect, bool will_stock, OnCompleteLoad callback)
    {
        Enemy enemy = this.get_gameObject().GetComponent <Enemy>();

        if (enemy != null)
        {
            int id = enemy.id;
        }
        bodyID    = body_id;
        bodyScale = scale;
        bool is_boss = false;

        if (enemy != null)
        {
            is_boss = enemy.isBoss;
            if (enemy.controller != null)
            {
                enemy.controller.set_enabled(false);
            }
            if (enemy.packetReceiver != null)
            {
                enemy.packetReceiver.SetStopPacketUpdate(true);
            }
            enemy.OnLoadStart();
        }
        string    body_name = ResourceName.GetEnemyBody(body_id);
        string    mate_name = ResourceName.GetEnemyMaterial(body_id);
        string    anim_name = ResourceName.GetEnemyAnim(anim_id);
        Transform _this     = this.get_transform();

        isLoading = true;
        LoadingQueue load_queue = new LoadingQueue(this);
        LoadObject   lo_body    = load_queue.LoadAndInstantiate(RESOURCE_CATEGORY.ENEMY_MODEL, body_name);
        LoadObject   lo_mate    = (mate_name == null) ? null : load_queue.Load(RESOURCE_CATEGORY.ENEMY_MATERIAL, body_name, new string[1]
        {
            mate_name
        }, false);
        LoadObject lo_anim = load_queue.Load(RESOURCE_CATEGORY.ENEMY_ANIM, anim_name, new string[2]
        {
            anim_name + "Ctrl",
            anim_name + "Event"
        }, false);

        if (!string.IsNullOrEmpty(base_effect))
        {
            load_queue.CacheEffect(RESOURCE_CATEGORY.EFFECT_ACTION, base_effect);
        }
        LoadObject lo_foundation = null;

        if (!string.IsNullOrEmpty(foundation_name))
        {
            if (!MonoBehaviourSingleton <GlobalSettingsManager> .I.uiModelRendering.enableEnemyModelFoundationFromQuestStage)
            {
                foundation_name = "FST011";
            }
            lo_foundation = load_queue.LoadAndInstantiate(RESOURCE_CATEGORY.FOUNDATION_MODEL, foundation_name);
        }
        yield return((object)load_queue.Wait());

        body = lo_body.Realizes(_this, (layer != -1) ? layer : 11);
        if (layer == -1)
        {
            this.get_gameObject().set_layer(10);
        }
        body.set_localPosition(Vector3.get_zero());
        body.set_localRotation(Quaternion.get_identity());
        renderersBody = body.get_gameObject().GetComponentsInChildren <Renderer>();
        if (lo_mate != null && lo_mate.loadedObject != null && renderersBody.Length == 1)
        {
            Material mate = lo_mate.loadedObject as Material;
            if (mate != null)
            {
                renderersBody[0].set_sharedMaterial(mate);
            }
        }
        if (enemy != null)
        {
            enemy.body = body;
        }
        body.set_localScale(Vector3.Scale(body.get_localScale(), new Vector3(scale, scale, scale)));
        animator = body.get_gameObject().GetComponent <Animator>();
        if (animator != null && lo_anim.loadedObjects != null)
        {
            animator.set_runtimeAnimatorController(lo_anim.loadedObjects[0].obj);
            if (lo_anim.loadedObjects.Length >= 2 && lo_anim.loadedObjects[1] != null)
            {
                this.animEventData = (lo_anim.loadedObjects[1].obj as AnimEventData);
            }
            if (enemy != null)
            {
                body.get_gameObject().AddComponent <StageObjectProxy>().stageObject = enemy;
                enemy.animEventData = this.animEventData;
            }
        }
        if (!string.IsNullOrEmpty(base_effect))
        {
            string node_name = base_effect_node;
            if (string.IsNullOrEmpty(node_name))
            {
                node_name = "Root";
            }
            Transform node             = Utility.Find(body, node_name);
            Transform effect_transform = EffectManager.GetEffect(base_effect, node);
            if (effect_transform != null)
            {
                baseEffect = effect_transform;
                if (layer != -1)
                {
                    Utility.SetLayerWithChildren(effect_transform, layer);
                }
            }
        }
        if (shader_type == SHADER_TYPE.LIGHTWEIGHT)
        {
            ShaderGlobal.ChangeWantLightweightShader(renderersBody);
        }
        if (is_boss)
        {
            materialParamsList = new List <MaterialParams>();
            Shader.PropertyToID("_RimPower");
            Shader.PropertyToID("_RimWidth");
            Shader.PropertyToID("_Vanish_flag");
            Shader.PropertyToID("_Vanish_rate");
            Utility.MaterialForEach(renderersBody, delegate(Material material)
            {
                if (material != null)
                {
                    MaterialParams materialParams = new MaterialParams
                    {
                        material = material
                    };
                    if (materialParams.hasRimPower = material.HasProperty(((_003CDoLoad_003Ec__Iterator228) /*Error near IL_062d: stateMachine*/)._003CID_RIM_POWER_003E__16))
                    {
                        materialParams.defaultRimPower = material.GetFloat(((_003CDoLoad_003Ec__Iterator228) /*Error near IL_062d: stateMachine*/)._003CID_RIM_POWER_003E__16);
                    }
                    if (materialParams.hasRimWidth = material.HasProperty(((_003CDoLoad_003Ec__Iterator228) /*Error near IL_062d: stateMachine*/)._003CID_RIM_WIDTH_003E__17))
                    {
                        materialParams.defaultRimWidth = material.GetFloat(((_003CDoLoad_003Ec__Iterator228) /*Error near IL_062d: stateMachine*/)._003CID_RIM_WIDTH_003E__17);
                    }
                    materialParams.hasVanishFlag = material.HasProperty(((_003CDoLoad_003Ec__Iterator228) /*Error near IL_062d: stateMachine*/)._003CID_VANISH_FLAG_003E__18);
                    materialParams.hasVanishRate = material.HasProperty(((_003CDoLoad_003Ec__Iterator228) /*Error near IL_062d: stateMachine*/)._003CID_VANISH_RATE_003E__19);
                    ((_003CDoLoad_003Ec__Iterator228) /*Error near IL_062d: stateMachine*/)._003C_003Ef__this.materialParamsList.Add(materialParams);
                }
            });
        }
        int l = 0;

        for (int k = renderersBody.Length; l < k; l++)
        {
            renderersBody[l].set_useLightProbes(enable_light_probes);
        }
        EnemyParam param = body.get_gameObject().GetComponent <EnemyParam>();

        body.get_gameObject().SetActive(false);
        if (need_anim_event_res_cache && animator != null && lo_anim.loadedObjects != null && lo_anim.loadedObjects[1] != null)
        {
            AnimEventData tmpAnimEventData = lo_anim.loadedObjects[1].obj as AnimEventData;
            if (tmpAnimEventData != null)
            {
                if (enemy == null)
                {
                    load_queue.CacheAnimDataUseResource(tmpAnimEventData, null, null);
                }
                else
                {
                    LoadingQueue  loadingQueue  = load_queue;
                    AnimEventData animEventData = tmpAnimEventData;
                    Enemy         enemy2        = enemy;
                    loadingQueue.CacheAnimDataUseResource(animEventData, ((Character)enemy2).EffectNameAnalyzer, enemy.continusAtkEventDataList);
                }
                PreSetAnimationEventDataParamToEnemy(tmpAnimEventData, enemy);
            }
        }
        AnimEventData.ResidentEffectData[] residentEffectList = null;
        if (this.animEventData != null)
        {
            residentEffectList = this.animEventData.residentEffectDataList;
            if (residentEffectList != null)
            {
                int numEffect3 = residentEffectList.Length;
                for (int ef3 = 0; ef3 < numEffect3; ef3++)
                {
                    if (!string.IsNullOrEmpty(residentEffectList[ef3].effectName))
                    {
                        load_queue.CacheEffect(RESOURCE_CATEGORY.EFFECT_ACTION, residentEffectList[ef3].effectName);
                    }
                }
            }
        }
        if (param != null)
        {
            if (enemy != null || need_stamp_effect)
            {
                StageObject.StampInfo[] stampInfos = param.stampInfos;
                foreach (StageObject.StampInfo info4 in stampInfos)
                {
                    load_queue.CacheEffect(RESOURCE_CATEGORY.EFFECT_ACTION, info4.effectName);
                }
            }
            if (param.isHide)
            {
                FieldMapTable.GatherPointViewTableData viewData = Singleton <FieldMapTable> .I.GetGatherPointViewData(param.gatherPointViewId);

                if (viewData != null)
                {
                    if (!string.IsNullOrEmpty(viewData.targetEffectName))
                    {
                        load_queue.CacheEffect(RESOURCE_CATEGORY.EFFECT_ACTION, viewData.targetEffectName);
                    }
                    if (!string.IsNullOrEmpty(viewData.gatherEffectName))
                    {
                        load_queue.CacheEffect(RESOURCE_CATEGORY.EFFECT_ACTION, viewData.gatherEffectName);
                    }
                }
            }
            SystemEffectSetting sysEffectSetting2 = param.residentEffectSetting;
            if (sysEffectSetting2 != null)
            {
                SystemEffectSetting.Data[] effectDataList = sysEffectSetting2.effectDataList;
                if (effectDataList != null)
                {
                    int numEffect2 = effectDataList.Length;
                    for (int ef2 = 0; ef2 < numEffect2; ef2++)
                    {
                        if (!string.IsNullOrEmpty(effectDataList[ef2].effectName))
                        {
                            load_queue.CacheEffect(RESOURCE_CATEGORY.EFFECT_ACTION, effectDataList[ef2].effectName);
                        }
                    }
                }
            }
        }
        if (load_queue.IsLoading())
        {
            yield return((object)load_queue.Wait());
        }
        if (enemy != null)
        {
            if (param != null)
            {
                EnemyTable.EnemyData data           = enemy.enemyTableData;
                AttackHitInfo[]      attackHitInfos = param.attackHitInfos;
                foreach (AttackHitInfo temp_info in attackHitInfos)
                {
                    AttackHitInfo info = temp_info;
                    if (!string.IsNullOrEmpty(data.convertRegionKey))
                    {
                        string          convert_name          = info.name + "_" + data.convertRegionKey;
                        AttackHitInfo[] convertAttackHitInfos = param.convertAttackHitInfos;
                        foreach (AttackHitInfo convert_info in convertAttackHitInfos)
                        {
                            if (convert_info.name == convert_name)
                            {
                                info = convert_info;
                                break;
                            }
                        }
                    }
                    if (info.hitSEID != 0)
                    {
                        load_queue.CacheSE(info.hitSEID, null);
                    }
                    load_queue.CacheEffect(RESOURCE_CATEGORY.EFFECT_ACTION, info.hitEffectName);
                    load_queue.CacheEffect(RESOURCE_CATEGORY.EFFECT_ACTION, info.remainEffectName);
                    load_queue.CacheBulletDataUseResource(info.bulletData, null);
                    RestraintInfo restInfo = temp_info.restraintInfo;
                    if (restInfo.enable && !string.IsNullOrEmpty(restInfo.effectName))
                    {
                        load_queue.CacheEffect(RESOURCE_CATEGORY.EFFECT_ACTION, restInfo.effectName);
                        load_queue.CacheEffect(RESOURCE_CATEGORY.EFFECT_ACTION, "ef_btl_target_flick");
                        if (temp_info.toPlayer.reactionType != 0)
                        {
                            Log.Error(LOG.INGAME, "Can't use reactionType with RestraintInfo!! " + temp_info.name);
                        }
                    }
                    GrabInfo grabInfo = temp_info.grabInfo;
                    if (grabInfo != null && grabInfo.enable && temp_info.toPlayer.reactionType != 0)
                    {
                        Log.Error(LOG.INGAME, "Can't use reactionType with GrabInfo!! " + temp_info.name);
                    }
                    InkSplashInfo inkSplashInfo = temp_info.inkSplashInfo;
                    if (inkSplashInfo != null && inkSplashInfo.duration > 0f)
                    {
                        load_queue.CacheEffect(RESOURCE_CATEGORY.EFFECT_ACTION, "ef_btl_pl_blind_01");
                        load_queue.CacheEffect(RESOURCE_CATEGORY.EFFECT_ACTION, "ef_btl_pl_blind_02");
                        load_queue.CacheEffect(RESOURCE_CATEGORY.EFFECT_ACTION, "ef_btl_target_flick");
                    }
                }
                AttackContinuationInfo[] attackContinuationInfos = param.attackContinuationInfos;
                foreach (AttackContinuationInfo temp_info2 in attackContinuationInfos)
                {
                    AttackContinuationInfo info2 = temp_info2;
                    if (!string.IsNullOrEmpty(data.convertRegionKey))
                    {
                        string convert_name2 = info2.name + "_" + data.convertRegionKey;
                        AttackContinuationInfo[] convertAttackContinuationInfos = param.convertAttackContinuationInfos;
                        foreach (AttackContinuationInfo convert_info2 in convertAttackContinuationInfos)
                        {
                            if (convert_info2.name == convert_name2)
                            {
                                info2 = convert_info2;
                                break;
                            }
                        }
                    }
                    load_queue.CacheBulletDataUseResource(info2.bulletData, null);
                }
                Enemy.RegionInfo[] regionInfos = param.regionInfos;
                foreach (Enemy.RegionInfo temp_info3 in regionInfos)
                {
                    Enemy.RegionInfo info3 = temp_info3;
                    if (!string.IsNullOrEmpty(data.convertRegionKey))
                    {
                        string             convert_name3      = info3.name + "_" + data.convertRegionKey;
                        Enemy.RegionInfo[] convertRegionInfos = param.convertRegionInfos;
                        foreach (Enemy.RegionInfo convert_info3 in convertRegionInfos)
                        {
                            if (convert_info3.name == convert_name3)
                            {
                                info3 = convert_info3;
                                break;
                            }
                        }
                    }
                    load_queue.CacheEffect(RESOURCE_CATEGORY.EFFECT_ACTION, info3.breakEffect.effectName);
                }
                if (Singleton <EnemyHitMaterialTable> .IsValid())
                {
                    int j = 0;
                    for (int len2 = param.regionInfos.Length; j < len2 + 1; j++)
                    {
                        string hit_material_name = (j >= len2) ? param.baseHitMaterialName : param.regionInfos[j].hitMaterialName;
                        if (!string.IsNullOrEmpty(hit_material_name))
                        {
                            EnemyHitMaterialTable.MaterialData check_data = Singleton <EnemyHitMaterialTable> .I.GetData(hit_material_name);

                            if (check_data != null)
                            {
                                load_queue.CacheEffect(RESOURCE_CATEGORY.EFFECT_ACTION, check_data.addEffectName);
                                int[] typeSEIDs = check_data.typeSEIDs;
                                foreach (int type_se_id in typeSEIDs)
                                {
                                    if (type_se_id != 0)
                                    {
                                        load_queue.CacheSE(type_se_id, null);
                                    }
                                }
                            }
                        }
                    }
                }
            }
            if (MonoBehaviourSingleton <InGameSettingsManager> .IsValid())
            {
                load_queue.CacheEffect(RESOURCE_CATEGORY.EFFECT_ACTION, MonoBehaviourSingleton <GlobalSettingsManager> .I.linkResources.enemyParalyzeHitEffectName);
                load_queue.CacheEffect(RESOURCE_CATEGORY.EFFECT_ACTION, MonoBehaviourSingleton <GlobalSettingsManager> .I.linkResources.enemyPoisonHitEffectName);
            }
            load_queue.CacheEffect(RESOURCE_CATEGORY.EFFECT_ACTION, "ef_btl_enm_shock_01");
            load_queue.CacheEffect(RESOURCE_CATEGORY.EFFECT_ACTION, "ef_btl_enm_fire_01");
            load_queue.CacheEffect(RESOURCE_CATEGORY.EFFECT_ACTION, "ef_btl_pl_movedown_01");
            EffectPlayProcessor processor = body.get_gameObject().GetComponent <EffectPlayProcessor>();
            if (processor != null && processor.effectSettings != null)
            {
                enemy.effectPlayProcessor = processor;
                int i = 0;
                for (int len = processor.effectSettings.Length; i < len; i++)
                {
                    if (!string.IsNullOrEmpty(processor.effectSettings[i].effectName))
                    {
                        load_queue.CacheEffect(RESOURCE_CATEGORY.EFFECT_ACTION, processor.effectSettings[i].effectName);
                    }
                }
            }
            if (load_queue.IsLoading())
            {
                yield return((object)load_queue.Wait());
            }
        }
        body.get_gameObject().SetActive(true);
        if (residentEffectList != null)
        {
            int numEffect = residentEffectList.Length;
            for (int ef = 0; ef < numEffect; ef++)
            {
                AnimEventData.ResidentEffectData effectData = residentEffectList[ef];
                if (!string.IsNullOrEmpty(effectData.effectName) && !string.IsNullOrEmpty(effectData.linkNodeName))
                {
                    Transform parentTrans = Utility.Find(body.get_transform(), effectData.linkNodeName);
                    if (parentTrans == null)
                    {
                        parentTrans = body.get_transform();
                    }
                    Transform effectTrans = EffectManager.GetEffect(effectData.effectName, parentTrans);
                    if (effectTrans != null)
                    {
                        if (layer != -1)
                        {
                            Utility.SetLayerWithChildren(effectTrans, layer);
                        }
                        Vector3 basisScale = effectTrans.get_localScale();
                        effectTrans.set_localScale(basisScale * effectData.scale);
                        effectTrans.set_localPosition(effectData.offsetPos);
                        effectTrans.set_localRotation(Quaternion.Euler(effectData.offsetRot));
                        ResidentEffectObject residentEffect = effectTrans.get_gameObject().AddComponent <ResidentEffectObject>();
                        residentEffect.Initialize(effectData);
                        if (enemy != null)
                        {
                            enemy.RegisterResidentEffect(residentEffect);
                        }
                    }
                }
            }
        }
        if (param != null)
        {
            SystemEffectSetting sysEffectSetting = param.residentEffectSetting;
            SysEffectCreate(enemy, layer, sysEffectSetting);
        }
        if (need_shadow && param != null && param.shadowSize > 0f)
        {
            shadow = MonoBehaviourSingleton <GlobalSettingsManager> .I.linkResources.CreateShadow(param.shadowSize, param.bodyRadius, bodyScale, true, _this, shader_type == SHADER_TYPE.LIGHTWEIGHT);
        }
        if (enemy != null)
        {
            if (param != null)
            {
                param.SetParam(enemy);
                Object.DestroyImmediate(param);
            }
            if (enemy.controller != null)
            {
                enemy.controller.set_enabled(true);
            }
            enemy.willStock = will_stock;
            enemy.OnLoadComplete();
            if (enemy.packetReceiver != null)
            {
                enemy.packetReceiver.SetStopPacketUpdate(false);
            }
        }
        callback?.Invoke(enemy);
        if (lo_foundation != null)
        {
            foundation = lo_foundation.Realizes(_this, layer);
            foundation.SetParent(_this.get_parent(), true);
        }
        isLoading = false;
    }