Esempio n. 1
0
 public static void SetPerpstageNodeVisibility(MonoBasePerpStage perpStage, StageEntry stageEntry, bool useShowNodes, bool visible)
 {
     if (!useShowNodes)
     {
         if (!string.IsNullOrEmpty(stageEntry.HideNodeNames))
         {
             SetPerpstageNodeVisibilityByNode(perpStage, stageEntry.HideNodeNames, visible);
         }
         if (!string.IsNullOrEmpty(stageEntry.HideNodePrefabPaths))
         {
             SetPerpstageNodeVisibilityByPrefab(perpStage, stageEntry.HideNodePrefabPaths, visible);
         }
     }
     else
     {
         if (!string.IsNullOrEmpty(stageEntry.ShowNodeNames))
         {
             SetPerpstageNodeVisibilityByNode(perpStage, stageEntry.ShowNodeNames, visible);
         }
         if (!string.IsNullOrEmpty(stageEntry.ShowNodePrefabPaths))
         {
             SetPerpstageNodeVisibilityByPrefab(perpStage, stageEntry.ShowNodePrefabPaths, visible);
         }
     }
 }
Esempio n. 2
0
 public static void SetPerpstageNodeVisibilityByNode(MonoBasePerpStage perpStage, string names, bool visible)
 {
     if (!string.IsNullOrEmpty(names))
     {
         char[]   separator = new char[] { ';' };
         string[] strArray  = names.Split(separator);
         for (int i = 0; i < strArray.Length; i++)
         {
             perpStage.transform.Find(strArray[i]).gameObject.SetActive(visible);
         }
         perpStage.transform.gameObject.SetActive(true);
     }
 }
Esempio n. 3
0
 public static void SetPerpstageNodeVisibilityByPrefab(MonoBasePerpStage perpStage, string prefabPathes, bool visible)
 {
     if (!string.IsNullOrEmpty(prefabPathes))
     {
         char[]   separator = new char[] { ';' };
         string[] strArray  = prefabPathes.Split(separator);
         for (int i = 0; i < strArray.Length; i++)
         {
             char[]   chArray2  = new char[] { '/' };
             string[] strArray2 = strArray[i].Split(chArray2);
             string   name      = strArray2[strArray2.Length - 1];
             if (!visible)
             {
                 Transform transform = perpStage.transform.Find(name);
                 if (transform != null)
                 {
                     transform.gameObject.SetActive(visible);
                 }
             }
             else
             {
                 Transform transform2 = perpStage.transform.Find(name);
                 if (transform2 != null)
                 {
                     transform2.gameObject.SetActive(visible);
                 }
                 else
                 {
                     GameObject obj2 = (GameObject)UnityEngine.Object.Instantiate(Miscs.LoadResource(strArray[i], BundleType.RESOURCE_FILE));
                     obj2.name = name;
                     obj2.transform.SetParent(perpStage.transform, false);
                 }
             }
         }
         perpStage.transform.gameObject.SetActive(true);
     }
 }
Esempio n. 4
0
        private void HandleAlreadyLoadedPrefabs()
        {
            RuntimeIDManager  instance         = Singleton <RuntimeIDManager> .Instance;
            StageEntry        stageEntryByName = StageData.GetStageEntryByName(this.stageDevData.stageName);
            MonoBasePerpStage perpStage        = UnityEngine.Object.FindObjectOfType <MonoBasePerpStage>();

            if (perpStage != null)
            {
                perpStage.Init(stageEntryByName, (string)null);
            }
            MonoStageEnv stageEnv = UnityEngine.Object.FindObjectOfType <MonoStageEnv>();

            Singleton <StageManager> .Instance.RegisterStage(stageEntryByName, perpStage, stageEnv);

            LevelActor actor = (LevelActor)Singleton <EventManager> .Instance.GetActor(0x21800001);

            actor.levelMode = this.LEVEL_MODE;
            BaseMonoAvatar avatar = UnityEngine.Object.FindObjectOfType <BaseMonoAvatar>();

            if (avatar != null)
            {
                DevAvatarData  devAvatarData  = this.avatarDevDatas[0];
                AvatarDataItem avatarDataItem = Singleton <AvatarModule> .Instance.GetDummyAvatarDataItem(this.avatarTypeNames[0], devAvatarData.avatarLevel, devAvatarData.avatarStar);

                this.SetUpAvatarDataItem(avatarDataItem, devAvatarData);
                uint nextRuntimeID = instance.GetNextRuntimeID(3);
                avatar.Init(true, nextRuntimeID, avatarDataItem.AvatarRegistryKey, avatarDataItem.GetWeapon().ID, avatar.transform.position, avatar.transform.forward, true);
                this.LoadAvatarWwiseSoundBank(avatar);
                AvatarActor actor2 = Singleton <EventManager> .Instance.CreateActor <AvatarActor>(avatar);

                actor2.InitAvatarDataItem(avatarDataItem, true, false, true, true);
                actor2.PostInit();
                Singleton <AvatarManager> .Instance.RegisterAvatar(avatar, true, true, false);

                this.SetUpAvatarSkill(actor2, devAvatarData);
                this.CheatForPariticleMode(actor2);
                for (int i = 1; i < this.avatarCount; i++)
                {
                    DevAvatarData  data2 = this.avatarDevDatas[i];
                    AvatarDataItem item2 = Singleton <AvatarModule> .Instance.GetDummyAvatarDataItem(this.avatarTypeNames[i], data2.avatarLevel, data2.avatarStar);

                    this.SetUpAvatarDataItem(item2, data2);
                    uint runtimeID = instance.GetNextRuntimeID(3);
                    Singleton <AvatarManager> .Instance.CreateAvatar(item2, false, avatar.XZPosition, avatar.FaceDirection, runtimeID, false, false, false, false);

                    AvatarActor actor3 = Singleton <EventManager> .Instance.GetActor <AvatarActor>(runtimeID);

                    this.SetUpAvatarSkill(actor3, data2);
                    this.CheatForPariticleMode(actor3);
                }
                if (this.useFakeHelper)
                {
                    this.CreateFakeFriendAvatar();
                }
                Singleton <CinemaDataManager> .Instance.Preload(avatar);
            }
            foreach (BaseMonoMonster monster in UnityEngine.Object.FindObjectsOfType <BaseMonoMonster>())
            {
                DevMonsterData data3      = null;
                int            instanceID = monster.gameObject.GetInstanceID();
                for (int j = 0; j < this.monsterInstanceIds.Count; j++)
                {
                    if (this.monsterInstanceIds[j] == instanceID)
                    {
                        data3 = this.monsterDevDatas[j];
                        break;
                    }
                }
                if (data3 == null)
                {
                    UnityEngine.Object.Destroy(monster.gameObject);
                }
                else
                {
                    string monsterName;
                    string typeName;
                    uint   num7 = instance.GetNextRuntimeID(4);
                    if (data3.uniqueMonsterID != 0)
                    {
                        UniqueMonsterMetaData uniqueMonsterMetaData = MonsterData.GetUniqueMonsterMetaData(data3.uniqueMonsterID);
                        monsterName = uniqueMonsterMetaData.monsterName;
                        typeName    = uniqueMonsterMetaData.typeName;
                    }
                    else
                    {
                        monsterName = data3.monsterName;
                        typeName    = data3.typeName;
                    }
                    bool isElite = data3.isElite;
                    monster.Init(monsterName, typeName, num7, monster.transform.position, data3.uniqueMonsterID, null, true, isElite, true, 0);
                    for (int k = 0; k < monster.config.CommonArguments.RequestSoundBankNames.Length; k++)
                    {
                        Singleton <WwiseAudioManager> .Instance.ManualPrepareBank(monster.config.CommonArguments.RequestSoundBankNames[k]);
                    }
                    MonsterActor actor4 = Singleton <EventManager> .Instance.CreateActor <MonsterActor>(monster);

                    actor4.InitLevelData(data3.level, data3.isElite);
                    actor4.PostInit();
                    Singleton <MonsterManager> .Instance.RegisterMonster(monster);

                    if (data3.abilities.Length > 0)
                    {
                        for (int m = 0; m < data3.abilities.Length; m++)
                        {
                            string str3 = data3.abilities[m];
                            if (!string.IsNullOrEmpty(str3))
                            {
                                actor4.abilityPlugin.InsertPreInitAbility(AbilityData.GetAbilityConfig(data3.abilities[m]));
                            }
                        }
                    }
                    if (data3.isStationary)
                    {
                        MonsterActor actor5 = Singleton <EventManager> .Instance.GetActor <MonsterActor>(monster.GetRuntimeID());

                        actor5.baseMaxHP = actor5.HP = actor5.maxHP = 999999f;
                        monster.GetActiveAIController().SetActive(false);
                    }
                }
            }
            Singleton <LevelManager> .Instance.levelActor.SuddenLevelStart();

            EvtStageReady evt = new EvtStageReady {
                isBorn = true
            };

            Singleton <EventManager> .Instance.FireEvent(evt, MPEventDispatchMode.Normal);

            Singleton <DetourManager> .Instance.LoadNavMeshRelatedLevel(this.stageDevData.stageName);

            Singleton <MainUIManager> .Instance.GetInLevelUICanvas().FadeInStageTransitPanel(0.18f, false, null, null);
        }
Esempio n. 5
0
 public RectPlatform(MonoBasePerpStage stageOwner, uint width, uint height) : base(stageOwner)
 {
     this.Width  = width;
     this.Height = height;
 }
Esempio n. 6
0
 public CirclePlatform(MonoBasePerpStage stageOwner, uint radius) : base(stageOwner)
 {
     this.Radius = radius;
 }
Esempio n. 7
0
 public BasePlatform(MonoBasePerpStage stageOwner)
 {
     this.StageOwner = stageOwner;
 }
Esempio n. 8
0
 public void RegisterStage(StageEntry stageEntry, MonoBasePerpStage perpStage, MonoStageEnv stageEnv)
 {
     this._activeStageEntry = stageEntry;
     this._perpStage        = perpStage;
     this._stageEnv         = stageEnv;
 }
Esempio n. 9
0
        private Vector3 InitAfterCreateStage(StageEntry stageEntry, MonoBasePerpStage perpStage, Vector3 preStagePos, bool isBorn, string baseWeatherName, MonoBasePerpStage.ContinueWeatherDataSettings continueData, bool isContinued)
        {
            Vector3 zero    = Vector3.zero;
            Vector3 vector2 = Vector3.zero;

            if (!string.IsNullOrEmpty(stageEntry.LocationPointName))
            {
                perpStage.transform.position = Vector3.zero;
                perpStage.transform.position = -perpStage.transform.Find(stageEntry.LocationPointName).localPosition;
                vector2 = perpStage.transform.position - preStagePos;
            }
            if (this._activeStageEntry == null)
            {
                perpStage.Init(stageEntry, baseWeatherName);
            }
            else
            {
                float             renderingTimer  = 0f;
                float             weatherTimer    = 0f;
                ConfigWeatherData fromWeatherData = null;
                ConfigWeatherData toWeatherData   = null;
                string            toWeatherName   = null;
                if (continueData != null)
                {
                    renderingTimer  = continueData.renderingDataContinueTimer;
                    weatherTimer    = continueData.weatherContinueTimer;
                    fromWeatherData = continueData.currentWeatherData;
                    toWeatherData   = continueData.continueWeatherData;
                    toWeatherName   = continueData.continueWeatherName;
                }
                if (this._activeStageEntry.PerpStagePrefabPath != stageEntry.PerpStagePrefabPath)
                {
                    if (isContinued)
                    {
                        if (renderingTimer > 0f)
                        {
                            if (toWeatherName != null)
                            {
                                perpStage.Init(stageEntry, fromWeatherData, toWeatherName, renderingTimer, weatherTimer);
                            }
                            else
                            {
                                perpStage.Init(stageEntry, fromWeatherData, toWeatherData, renderingTimer, weatherTimer);
                            }
                        }
                        else if (toWeatherName != null)
                        {
                            perpStage.Init(stageEntry, toWeatherName);
                        }
                        else
                        {
                            perpStage.Init(stageEntry, toWeatherData);
                        }
                    }
                    else
                    {
                        perpStage.Init(stageEntry, baseWeatherName);
                    }
                }
                else if (isContinued)
                {
                    if (renderingTimer > 0f)
                    {
                        perpStage.TransitWeatherData(toWeatherData, renderingTimer, weatherTimer);
                    }
                    else
                    {
                        perpStage.Reset(stageEntry, toWeatherData);
                    }
                }
                else
                {
                    perpStage.Reset(stageEntry, WeatherData.GetWeatherDataConfig(baseWeatherName));
                }
                this.CleanForStageTransit();
            }
            GameObject obj2 = (GameObject)UnityEngine.Object.Instantiate(Miscs.LoadResource(stageEntry.GetEnvPrefabPath(), BundleType.RESOURCE_FILE));

            obj2.transform.position = Vector3.zero;
            obj2.transform.rotation = Quaternion.identity;
            MonoStageEnv component = obj2.GetComponent <MonoStageEnv>();
            Vector3      vector3   = new Vector3(0f, -0.05f, 0f);
            Transform    transform = Miscs.FindFirstChildGivenLayerAndCollider(obj2.transform, LayerMask.NameToLayer("StageCollider"));

            if (transform != null)
            {
                transform.position += vector3;
            }
            this.RegisterStage(stageEntry, perpStage, component);
            return(vector2);
        }