Example #1
0
    public PlayerLoader[] CreatePlayerModels()
    {
        //IL_00d3: Unknown result type (might be due to invalid IL or missing references)
        //IL_0146: Unknown result type (might be due to invalid IL or missing references)
        //IL_016d: Unknown result type (might be due to invalid IL or missing references)
        //IL_0191: Unknown result type (might be due to invalid IL or missing references)
        //IL_0196: Expected O, but got Unknown
        //IL_019b: Unknown result type (might be due to invalid IL or missing references)
        //IL_01b7: Unknown result type (might be due to invalid IL or missing references)
        DeletePlayerModels();
        int anim_id = (!isVictory) ? 91 : (-1);
        List <PlayerRecord> list = players.FindAll((PlayerRecord x) => x.isShowModel);

        if (!isVictory)
        {
            pickupPlayer = GetSelfPlayerRecord();
        }
        if (pickupPlayer != null)
        {
            list = new List <PlayerRecord>();
            list.Add(pickupPlayer);
            pickupPlayer.playerLoadInfo.SetEquipWeapon(0, null);
        }
        PlayerLoader[] array = new PlayerLoader[list.Count];
        int            i     = 0;

        for (int count = list.Count; i < count; i++)
        {
            PlayerRecord playerRecord = list[i];
            Transform    val          = Utility.CreateGameObject("Player:" + i, MonoBehaviourSingleton <StageManager> .I._transform, -1);
            array[i] = val.get_gameObject().AddComponent <PlayerLoader>();
            array[i].StartLoad(playerRecord.playerLoadInfo, -1, anim_id, false, false, true, true, false, false, false, false, ShaderGlobal.GetCharacterShaderType(), null, true, -1);
            int num = MonoBehaviourSingleton <OutGameSettingsManager> .I.questResult.playerPoss.Length;
            if (MonoBehaviourSingleton <OutGameSettingsManager> .IsValid() && pickupPlayer == null && i < num)
            {
                val.set_position(MonoBehaviourSingleton <OutGameSettingsManager> .I.questResult.playerPoss[i]);
                val.set_eulerAngles(new Vector3(0f, MonoBehaviourSingleton <OutGameSettingsManager> .I.questResult.playerRots[i], 0f));
            }
        }
        if (pickupPlayer != null)
        {
            Transform val2 = array[0].get_transform();
            val2.set_position(pickupPlayerPos);
            val2.set_eulerAngles(new Vector3(0f, pickupPlayerRot, 0f));
        }
        playerModels = array;
        return(playerModels);
    }
Example #2
0
    public Enemy CreateEnemyWithAI(int id, Vector3 pos, float dir, int enemyId, int enemyLv, bool isBoss, EnemyLoader.OnCompleteLoad callback = null)
    {
        //IL_007e: Unknown result type (might be due to invalid IL or missing references)
        //IL_00e9: Unknown result type (might be due to invalid IL or missing references)
        //IL_0100: Unknown result type (might be due to invalid IL or missing references)
        //IL_013f: Unknown result type (might be due to invalid IL or missing references)
        //IL_014b: Unknown result type (might be due to invalid IL or missing references)
        //IL_017b: Unknown result type (might be due to invalid IL or missing references)
        //IL_0180: Expected O, but got Unknown
        //IL_026f: Unknown result type (might be due to invalid IL or missing references)
        //IL_0286: Unknown result type (might be due to invalid IL or missing references)
        Enemy enemy = null;

        for (int i = 0; i < enemyStokeList.Count; i++)
        {
            if (enemyStokeList[i].enemyID == enemyId)
            {
                if (QuestManager.IsValidInGameWaveMatch())
                {
                    if (enemyStokeList[i].isWaveMatchBoss != isBoss)
                    {
                        continue;
                    }
                }
                else if (enemyStokeList[i].isBoss != isBoss)
                {
                    continue;
                }
                enemy = enemyStokeList[i];
                enemy.ClearDead();
                enemy.get_gameObject().set_name("Enemy:" + id);
                enemyStokeList.Remove(enemy);
                break;
            }
        }
        if (enemy != null)
        {
            enemy.id = id;
            enemy._transform.set_parent(base._transform);
            enemy._transform.set_position(pos);
            enemy._transform.set_eulerAngles(new Vector3(0f, dir, 0f));
            if (QuestManager.IsValidInGame())
            {
                enemy.enemyReward = MonoBehaviourSingleton <QuestManager> .I.GetCurrentQuestEnemyReward();
            }
            callback = CreateWrappedEnemyLoadCompletedDelegate(callback);
            if (callback != null)
            {
                this.StartCoroutine(_OnCallback(enemy, callback));
            }
            else
            {
                enemy.get_gameObject().SetActive(true);
            }
            return(enemy);
        }
        EnemyTable.EnemyData enemyData = Singleton <EnemyTable> .I.GetEnemyData((uint)enemyId);

        uint growId = enemyData.growId;

        GrowEnemyTable.GrowEnemyData growEnemyData = Singleton <GrowEnemyTable> .I.GetGrowEnemyData(growId, enemyLv);

        GameObject val = new GameObject();

        val.set_name("Enemy:" + id);
        val.SetActive(false);
        enemy                 = val.AddComponent <Enemy>();
        enemy.id              = id;
        enemy.enemyID         = (int)enemyData.id;
        enemy.isBoss          = (!QuestManager.IsValidInGameWaveMatch() && isBoss);
        enemy.isWaveMatchBoss = isBoss;
        enemy.enemyTableData  = enemyData;
        enemy.growTableData   = growEnemyData;
        enemy.charaName       = enemyData.name;
        enemy.enemyLevel      = ((growEnemyData == null) ? ((int)enemyData.level) : ((int)growEnemyData.level));
        enemy.moveStopRange  *= enemyData.modelScale;
        enemy.AddController <EnemyController>();
        if (QuestManager.IsValidInGame())
        {
            enemy.enemyReward = MonoBehaviourSingleton <QuestManager> .I.GetCurrentQuestEnemyReward();
        }
        enemy._transform.set_parent(base._transform);
        enemy._transform.set_position(pos);
        enemy._transform.set_eulerAngles(new Vector3(0f, dir, 0f));
        callback = CreateWrappedEnemyLoadCompletedDelegate(callback);
        enemy.loader.StartLoad(enemyData.modelId, enemyData.animId, enemyData.modelScale, enemyData.baseEffectName, enemyData.baseEffectNode, true, true, true, ShaderGlobal.GetCharacterShaderType(), -1, null, false, false, callback);
        return(enemy);
    }
        public ModelLoaderBase LoadModel(GameObject go, bool need_shadow, bool enable_light_probe, Action <Animator> on_complete, bool useSpecialModel)
        {
            if (IsUsePlayerModel())
            {
                PlayerLoader   loader           = go.AddComponent <PlayerLoader>();
                PlayerLoadInfo player_load_info = CreatePlayerLoadInfo();
                loader.StartLoad(player_load_info, go.get_layer(), 99, false, false, need_shadow, enable_light_probe, false, false, FieldManager.IsValidInField(), true, (!enable_light_probe) ? SHADER_TYPE.UI : ShaderGlobal.GetCharacterShaderType(), delegate
                {
                    if (on_complete != null)
                    {
                        on_complete(loader.animator);
                    }
                }, true, -1);
                return(loader);
            }
            NPCLoader loader2 = go.AddComponent <NPCLoader>();

            HomeThemeTable.HomeThemeData homeThemeData = Singleton <HomeThemeTable> .I.GetHomeThemeData(TimeManager.GetNow());

            int num = Singleton <HomeThemeTable> .I.GetNpcModelID(homeThemeData, id);

            int num2         = (num <= 0) ? specialModelID : num;
            int npc_model_id = (!useSpecialModel || num2 <= 0) ? npcModelID : num2;

            loader2.Load(npc_model_id, go.get_layer(), need_shadow, enable_light_probe, (!enable_light_probe) ? SHADER_TYPE.UI : ShaderGlobal.GetCharacterShaderType(), delegate
            {
                if (on_complete != null)
                {
                    on_complete(loader2.animator);
                }
            });
            return(loader2);
        }