Exemple #1
0
 protected LevelManager()
 {
     this.ResetGlobalTimeScale();
     InLevelData.InitInLevelData();
     AvatarData.InitAvatarData();
     MonsterData.InitMonsterData();
     this.CreateInLevelManagers();
 }
Exemple #2
0
 public override void Init(BaseMonoEntity entity)
 {
     this.avatar       = (BaseMonoAvatar)entity;
     base.runtimeID    = this.avatar.GetRuntimeID();
     this.config       = AvatarData.GetAvatarConfig(this.avatar.AvatarTypeName);
     base.commonConfig = this.config.CommonConfig;
     base.Init(entity);
     this.skillInfoList      = new List <SKillInfo>();
     this._skillInfoMap      = new Dictionary <string, SKillInfo>();
     this.maskedSkillButtons = new List <string>();
     foreach (string str in this.config.Skills.Keys)
     {
Exemple #3
0
        private void DebugCreateStageWithFullDataSync_Impl(Packet_Level_CreateStageFullData fullData)
        {
            Singleton <LevelScoreManager> .Instance.SetDevLevelBeginIntent("Lua/Levels/Common/Level 0.lua", LevelActor.Mode.NetworkedMP, 10, 10, null);

            Singleton <LevelScoreManager> .Instance.memberList = new List <AvatarDataItem>();
            for (int i = 0; i < fullData.AvatarsLength; i++)
            {
                MoleMole.MPProtocol.MPAvatarDataItem avatars = fullData.GetAvatars(i);
                AvatarDataItem item         = new AvatarDataItem(avatars.AvatarID, avatars.Level, avatars.Star);
                ConfigAvatar   avatarConfig = AvatarData.GetAvatarConfig(item.AvatarRegistryKey);
                WeaponDataItem dummyFirstWeaponDataByRole = Singleton <StorageModule> .Instance.GetDummyFirstWeaponDataByRole(avatarConfig.CommonArguments.RoleName, 1);

                item.equipsMap[1] = dummyFirstWeaponDataByRole;
                Singleton <LevelScoreManager> .Instance.memberList.Add(item);
            }
            Singleton <LevelManager> .Instance.levelActor.SuddenLevelStart();

            Singleton <LevelManager> .Instance.levelActor.levelMode = LevelActor.Mode.NetworkedMP;
            Singleton <MPLevelManager> .Instance.mpMode             = fullData.MpMode;
            if (fullData.MpMode == MPMode.Normal)
            {
                Singleton <LevelManager> .Instance.gameMode = new NetworkedMP_Default_GameMode();
            }
            else if (fullData.MpMode == MPMode.PvP_ReceiveNoSend)
            {
                Singleton <LevelManager> .Instance.gameMode = new NetworkedMP_PvPTest_GameMode();
            }
            else if (fullData.MpMode == MPMode.PvP_SendNoReceive)
            {
                Singleton <LevelManager> .Instance.gameMode = new NetworkedMP_PvPTest_GameMode();
            }
            List <string> avatarSpawnNameList = new List <string> {
                "Born"
            };

            Singleton <StageManager> .Instance.CreateStage(fullData.StageData.StageName, avatarSpawnNameList, null, false);
        }
Exemple #4
0
        public uint CreateAvatar(AvatarDataItem avatarDataItem, bool isLocal, Vector3 initPos, Vector3 initDir, uint runtimeID, bool isLeader, bool leaderSkillOn, bool isHelper = false, bool useLow = false)
        {
            BaseMonoAvatar component         = null;
            string         avatarRegistryKey = avatarDataItem.AvatarRegistryKey;
            GameObject     obj2  = null;
            int            index = -1;

            for (int i = 0; i < this._preloadedAvatar.Count; i++)
            {
                if (this._preloadedAvatar[i].Item1 == avatarRegistryKey)
                {
                    obj2  = this._preloadedAvatar[i].Item2;
                    index = i;
                    break;
                }
            }
            if (obj2 != null)
            {
                obj2.GetComponent <BaseMonoAvatar>().Enable();
                this._preloadedAvatar.RemoveAt(index);
            }
            else
            {
                useLow = useLow || (!GlobalVars.AVATAR_USE_DYNAMIC_BONE || (Singleton <LevelManager> .Instance.levelActor.levelMode == LevelActor.Mode.Multi));
                obj2   = (GameObject)UnityEngine.Object.Instantiate(Miscs.LoadResource <GameObject>(AvatarData.GetPrefabResPath(avatarRegistryKey, useLow), BundleType.RESOURCE_FILE), InLevelData.CREATE_INIT_POS, Quaternion.Euler(0f, 200f, 0f));
            }
            component = obj2.GetComponent <BaseMonoAvatar>();
            if (runtimeID == 0)
            {
                runtimeID = Singleton <RuntimeIDManager> .Instance.GetNextRuntimeID(3);
            }
            component.Init(isLocal, runtimeID, avatarDataItem.AvatarRegistryKey, avatarDataItem.GetWeapon().ID, initPos, initDir, isLeader);
            bool isPlayerAvatar = !isHelper;

            this.RegisterAvatar(component, isLocal, isPlayerAvatar, isHelper);
            AvatarActor actor = Singleton <EventManager> .Instance.CreateActor <AvatarActor>(component);

            actor.InitAvatarDataItem(avatarDataItem, isLocal, isHelper, isLeader, leaderSkillOn);
            actor.InitGalTouchBuff(avatarDataItem);
            actor.PostInit();
            if (Singleton <LevelScoreManager> .Instance.LevelType == 4)
            {
                EndlessAvatarHp endlessAvatarHPData = Singleton <EndlessModule> .Instance.GetEndlessAvatarHPData(avatarDataItem.avatarID);

                actor.HP = (actor.maxHP * endlessAvatarHPData.get_hp_percent()) / 100f;
                actor.SP = (actor.maxSP * endlessAvatarHPData.get_sp_percent()) / 100f;
            }
            ConfigAvatar config = component.config;

            for (int j = 0; j < config.CommonArguments.PreloadEffectPatternGroups.Length; j++)
            {
                Singleton <EffectManager> .Instance.PreloadEffectGroup(config.CommonArguments.PreloadEffectPatternGroups[j], false);
            }
            if (component is MonoBronya)
            {
                if (actor.HasAppliedAbilityName("Weapon_Additional_BronyaLaser"))
                {
                    Singleton <EffectManager> .Instance.PreloadEffectGroup("Bronya_Laser_Effects", false);
                }
                else
                {
                    Singleton <EffectManager> .Instance.PreloadEffectGroup("Bronya_Gun_Effects", false);
                }
            }
            for (int k = 0; k < config.CommonArguments.RequestSoundBankNames.Length; k++)
            {
                Singleton <WwiseAudioManager> .Instance.ManualPrepareBank(config.CommonArguments.RequestSoundBankNames[k]);
            }
            return(component.GetRuntimeID());
        }
Exemple #5
0
        public uint CreateAvatarMirror(BaseMonoAvatar owner, Vector3 initPos, Vector3 initDir, string AIName, float hpRatio)
        {
            BaseMonoAvatar component = ((GameObject)UnityEngine.Object.Instantiate(Miscs.LoadResource <GameObject>(AvatarData.GetPrefabResPath(owner.AvatarTypeName, true), BundleType.RESOURCE_FILE), initPos, Quaternion.LookRotation(initDir))).GetComponent <BaseMonoAvatar>();

            component.Init(false, Singleton <RuntimeIDManager> .Instance.GetNextRuntimeID(3), owner.AvatarTypeName, owner.EquipedWeaponID, initPos, initDir, false);
            this.RegisterAvatar(component, false, false, false);
            AvatarMirrorActor actor = Singleton <EventManager> .Instance.CreateActor <AvatarMirrorActor>(component);

            actor.InitFromAvatarActor(Singleton <EventManager> .Instance.GetActor <AvatarActor>(owner.GetRuntimeID()), hpRatio);
            actor.PostInit();
            component.TriggerSwitchIn();
            BTreeAvatarAIController activeAIController = component.GetActiveAIController() as BTreeAvatarAIController;

            if (string.IsNullOrEmpty(AIName))
            {
                activeAIController.SetActive(false);
            }
            else
            {
                activeAIController.ChangeBehavior(AIName);
                component.ForceUseAIController();
            }
            return(component.GetRuntimeID());
        }
Exemple #6
0
        public ICinema GetCinemaDataByAvatar(string avatar, AvatarCinemaType type)
        {
            string str = AvatarData.GetAvatarConfig(avatar).CinemaPaths[type];

            return(this._loadedCinemaData[str]);
        }
Exemple #7
0
 private void PostAwakeTryLoadFromFile()
 {
     if (DevLevelConfigData.configFromScene)
     {
         this.TryDestroyTypeAll <BaseMonoAvatar>();
         this.TryDestroyTypeAll <BaseMonoMonster>();
         this.TryDestroyTypeAll <MonoBasePerpStage>();
         this.TryDestroyTypeAll <MonoStageEnv>();
         Resources.UnloadUnusedAssets();
         GC.Collect();
         GC.WaitForPendingFinalizers();
         StageEntry stageEntryByName = StageData.GetStageEntryByName(this.stageDevData.stageName);
         GameObject obj2             = UnityEngine.Object.Instantiate <GameObject>(Miscs.LoadResource <GameObject>(stageEntryByName.GetPerpStagePrefabPath(), BundleType.RESOURCE_FILE));
         obj2.transform.position = Vector3.zero;
         Transform transform = obj2.transform;
         transform.position -= obj2.transform.Find(stageEntryByName.LocationPointName).position;
         StageManager.SetPerpstageNodeVisibility(obj2.GetComponent <MonoBasePerpStage>(), stageEntryByName, false, false);
         StageManager.SetPerpstageNodeVisibility(obj2.GetComponent <MonoBasePerpStage>(), stageEntryByName, true, true);
         UnityEngine.Object.Instantiate <GameObject>(Miscs.LoadResource <GameObject>(stageEntryByName.GetEnvPrefabPath(), BundleType.RESOURCE_FILE));
         DevAvatarData data = this.avatarDevDatas[0];
         UnityEngine.Object.Instantiate <GameObject>(Miscs.LoadResource <GameObject>(AvatarData.GetPrefabResPath(data.avatarType, false), BundleType.RESOURCE_FILE));
         this.monsterInstanceIds = new List <int>();
         foreach (DevMonsterData data2 in this.monsterDevDatas)
         {
             this.monsterInstanceIds.Add(UnityEngine.Object.Instantiate <GameObject>(Miscs.LoadResource <GameObject>(MonsterData.GetPrefabResPath(data2.monsterName, data2.typeName, false), BundleType.RESOURCE_FILE)).GetInstanceID());
         }
     }
 }
        private void OnGUI()
        {
            GUILayout.BeginArea(new Rect(50f, 0f, (float)(Screen.width - 100), (float)Screen.height));
            GUILayout.Space(20f);
            GUILayout.BeginHorizontal(new GUILayoutOption[0]);
            GUILayoutOption[] options = new GUILayoutOption[] { GUILayout.ExpandWidth(false) };
            GUILayout.Label("Avatar : ", options);
            this._widgetAvatarType.List(GUILayoutUtility.GetRect((float)20f, (float)(this._style.lineHeight * 1.5f)), this._avatarTypes, this._style, this._style, 1);
            GUILayoutOption[] optionArray2 = new GUILayoutOption[] { GUILayout.ExpandWidth(false) };
            GUILayout.Label("AI : ", optionArray2);
            this._widgetAIType.List(GUILayoutUtility.GetRect((float)50f, (float)(this._style.lineHeight * 1.5f)), this._aiTypes, this._style, this._style, 1);
            GUILayoutOption[] optionArray3 = new GUILayoutOption[] { GUILayout.ExpandWidth(false), GUILayout.Width(100f) };
            if (GUILayout.Button("Add", optionArray3) && (DevLevelConfigData.avatarDevDatas.Count < 3))
            {
                string        text = this._avatarTypes[this._widgetAvatarType.GetSelectedItemIndex()].text;
                DevAvatarData item = new DevAvatarData {
                    avatarType = text
                };
                item.avatarTestSkills  = new string[] { "Test_UnlockAllAniSkill", "Test_Undamagable" };
                item.avatarAI          = "AI/Avatar/" + this._aiTypes[this._widgetAIType.GetSelectedItemIndex()].text;
                item.avatarWeapon      = WeaponData.GetFirstWeaponIDForRole(AvatarData.GetAvatarConfig(text).CommonArguments.RoleName);
                item.avatarLevel       = 1;
                item.avatarWeaponLevel = 1;
                item.avatarStigmata    = new int[] { -1, -1, -1 };
                DevLevelConfigData.avatarDevDatas.Add(item);
            }
            GUILayout.EndHorizontal();
            for (int i = 0; i < DevLevelConfigData.avatarDevDatas.Count; i++)
            {
                DevAvatarData data = DevLevelConfigData.avatarDevDatas[i];
                GUILayout.Label(string.Format("{0}: {1}", data.avatarType, data.avatarAI), new GUILayoutOption[0]);
            }
            GUILayout.BeginHorizontal(new GUILayoutOption[0]);
            GUILayoutOption[] optionArray4 = new GUILayoutOption[] { GUILayout.ExpandWidth(false) };
            GUILayout.Label("Monster: ", optionArray4);
            int index = this._widgetMonsterNames.List(GUILayoutUtility.GetRect((float)20f, (float)(this._style.lineHeight * 1.5f)), this._monsterNames, this._style, this._style, 1);

            GUILayoutOption[] optionArray5 = new GUILayoutOption[] { GUILayout.ExpandWidth(false) };
            GUILayout.Label("Type: ", optionArray5);
            this._widgetMonsterTypes.List(GUILayoutUtility.GetRect((float)20f, (float)(this._style.lineHeight * 1.5f)), this._monsterTypes[index], this._style, this._style, 1);
            GUILayoutOption[] optionArray6 = new GUILayoutOption[] { GUILayout.ExpandWidth(false), GUILayout.Width(100f) };
            if (GUILayout.Button("Add", optionArray6))
            {
                DevMonsterData data4 = new DevMonsterData {
                    monsterName = this._monsterNames[this._widgetMonsterNames.GetSelectedItemIndex()].text,
                    typeName    = this._monsterTypes[this._widgetMonsterNames.GetSelectedItemIndex()][this._widgetMonsterTypes.GetSelectedItemIndex()].text
                };
                data4.abilities = new string[] { "Test_Undamagable" };
                data4.level     = 1;
                DevLevelConfigData.monsterDevDatas.Add(data4);
            }
            GUILayout.EndHorizontal();
            for (int j = 0; j < DevLevelConfigData.monsterDevDatas.Count; j++)
            {
                DevMonsterData data2 = DevLevelConfigData.monsterDevDatas[j];
                GUILayout.Label(string.Format("{0}, {1}", data2.monsterName, data2.typeName), new GUILayoutOption[0]);
            }
            GUILayout.BeginHorizontal(new GUILayoutOption[0]);
            DevLevelConfigData.stageDevData.stageName = this._stages[this._widgetStages.GetSelectedItemIndex()].text;
            GUILayoutOption[] optionArray7 = new GUILayoutOption[] { GUILayout.ExpandWidth(false) };
            GUILayout.Label("Level: ", optionArray7);
            this._widgetLevels.List(GUILayoutUtility.GetRect((float)20f, (float)(this._style.lineHeight * 1.5f)), this._levels, this._style, this._style, 1);
            DevLevelConfigData.LEVEL_PATH = "Lua/Levels/" + this._levels[this._widgetLevels.GetSelectedItemIndex()].text;
            GUILayoutOption[] optionArray8 = new GUILayoutOption[] { GUILayout.ExpandWidth(false) };
            this._multiMode = GUILayout.Toggle(this._multiMode, "Multi Mode?", optionArray8);
            GUILayout.EndHorizontal();
            this._widgetStages.List(GUILayoutUtility.GetRect((float)20f, (float)(this._style.lineHeight * 1.5f)), this._stages, this._style, this._style, 3);
            GUILayout.Space(50f);
            GUILayoutOption[] optionArray9 = new GUILayoutOption[] { GUILayout.Height(this._style.lineHeight * 3f) };
            if (GUILayout.Button("Start", optionArray9))
            {
                this.LoadDevLevel();
            }
            GUILayoutOption[] optionArray10 = new GUILayoutOption[] { GUILayout.Height(this._style.lineHeight * 3f) };
            if (GUILayout.Button("Render Scene", optionArray10))
            {
                SceneManager.LoadScene("RenderScene");
            }
            GUILayout.EndArea();
        }