Exemplo n.º 1
0
        private static void LoadTouchBuffData()
        {
            List <string> list  = new List <string>();
            TextAsset     asset = Miscs.LoadResource("Data/_ExcelOutput/TouchBuffData", BundleType.DATA_FILE) as TextAsset;

            char[]   separator = new char[] { "\n"[0] };
            string[] strArray  = asset.text.Split(separator);
            for (int i = 0; i < strArray.Length; i++)
            {
                if (strArray[i].Length >= 1)
                {
                    list.Add(strArray[i]);
                }
            }
            int capacity = list.Count - 1;

            _touchBuffItemList = new List <TouchBuffItem>(capacity);
            for (int j = 1; j <= capacity; j++)
            {
                char[]        chArray2  = new char[] { "\t"[0] };
                string[]      strArray2 = list[j].Split(chArray2);
                TouchBuffItem item      = new TouchBuffItem {
                    buffId = int.Parse(strArray2[0]),
                    effect = strArray2[1],
                    detail = strArray2[2]
                };
                float.TryParse(strArray2[3], out item.param1);
                float.TryParse(strArray2[4], out item.param2);
                float.TryParse(strArray2[5], out item.param3);
                float.TryParse(strArray2[6], out item.param1Add);
                float.TryParse(strArray2[7], out item.param2Add);
                float.TryParse(strArray2[8], out item.param3Add);
                _touchBuffItemList.Add(item);
            }
        }
Exemplo n.º 2
0
        private static void LoadTouchMissionData()
        {
            List <string> list  = new List <string>();
            TextAsset     asset = Miscs.LoadResource("Data/_ExcelOutput/AvatarGoodfeelData", BundleType.DATA_FILE) as TextAsset;

            char[]   separator = new char[] { "\n"[0] };
            string[] strArray  = asset.text.Split(separator);
            for (int i = 0; i < strArray.Length; i++)
            {
                if (strArray[i].Length >= 1)
                {
                    list.Add(strArray[i]);
                }
            }
            int capacity = list.Count - 1;

            _touchMissionItemList = new List <TouchMissionItem>(capacity);
            for (int j = 1; j <= capacity; j++)
            {
                char[]           chArray2  = new char[] { "\t"[0] };
                string[]         strArray2 = list[j].Split(chArray2);
                TouchMissionItem item      = new TouchMissionItem {
                    avatarId      = int.Parse(strArray2[0]),
                    goodFeelLevel = int.Parse(strArray2[1]),
                    missionId     = int.Parse(strArray2[2])
                };
                _touchMissionItemList.Add(item);
            }
        }
Exemplo n.º 3
0
        private static void LoadTouchLevelData()
        {
            List <string> list  = new List <string>();
            TextAsset     asset = Miscs.LoadResource("Data/_ExcelOutput/TouchLevelData", BundleType.DATA_FILE) as TextAsset;

            char[]   separator = new char[] { "\n"[0] };
            string[] strArray  = asset.text.Split(separator);
            for (int i = 0; i < strArray.Length; i++)
            {
                if (strArray[i].Length >= 1)
                {
                    list.Add(strArray[i]);
                }
            }
            int capacity = list.Count - 1;

            _touchLevelItemList = new List <TouchLevelItem>(capacity);
            for (int j = 1; j <= capacity; j++)
            {
                char[]         chArray2  = new char[] { "\t"[0] };
                string[]       strArray2 = list[j].Split(chArray2);
                TouchLevelItem item      = new TouchLevelItem {
                    level      = int.Parse(strArray2[0]),
                    touchExp   = int.Parse(strArray2[1]),
                    prop       = float.Parse(strArray2[2]),
                    rate       = float.Parse(strArray2[3]),
                    battleGain = int.Parse(strArray2[4])
                };
                _touchLevelItemList.Add(item);
            }
        }
Exemplo n.º 4
0
        public void InitForReviveButton(BaseMonoAvatar avatar)
        {
            this._button         = base.GetComponent <Button>();
            this._hpBarImg       = base.transform.Find("HPBar/Inner").GetComponent <Image>();
            this._spBarImg       = base.transform.Find("SPBar/Inner").GetComponent <Image>();
            this._iconImage      = base.transform.Find("Icon").GetComponent <Image>();
            this._CDMaskImg      = base.transform.Find("CDMask").GetComponent <Image>();
            this.avatarRuntimeID = avatar.GetRuntimeID();
            this._avatar         = avatar;
            this._avatarActor    = (AvatarActor)Singleton <EventManager> .Instance.GetActor(this.avatarRuntimeID);

            GameObject obj2 = Miscs.LoadResource <GameObject>(this._avatarActor.avatarIconPath, BundleType.RESOURCE_FILE);

            this._iconImage.sprite = obj2.GetComponent <SpriteRenderer>().sprite;
            Transform transform = base.transform.Find("Attr");

            for (int i = 0; i < transform.childCount; i++)
            {
                transform.GetChild(i).gameObject.SetActive(false);
            }
            transform.Find(this._avatarActor.avatarDataItem.Attribute.ToString()).gameObject.SetActive(true);
            this.onlyForShow          = true;
            this._button.interactable = true;
            base.transform.Find("CDMask").gameObject.SetActive(true);
        }
Exemplo n.º 5
0
        public void PreloadMonster(string monsterName, string typeName, uint uniqueMonsterID = 0, bool disableBehaviorWhenInit = false)
        {
            string name = monsterName + typeName + uniqueMonsterID.ToString() + disableBehaviorWhenInit.ToString();

            for (int i = 0; i < this._preloadedMonsters.Count; i++)
            {
                if ((this._preloadedMonsters[i].name == name) && !this._preloadedMonsters[i].occupied)
                {
                    this._preloadedMonsters[i].occupied = true;
                    return;
                }
            }
            GameObject      gameObj   = (GameObject)UnityEngine.Object.Instantiate(Miscs.LoadResource <GameObject>(MonsterData.GetPrefabResPath(monsterName, typeName, !GlobalVars.MONSTER_USE_DYNAMIC_BONE || (Singleton <LevelManager> .Instance.levelActor.levelMode == LevelActor.Mode.Multi)), BundleType.RESOURCE_FILE), InLevelData.CREATE_INIT_POS, Quaternion.identity);
            BaseMonoMonster component = gameObj.GetComponent <BaseMonoMonster>();

            component.PreInit(monsterName, typeName, uniqueMonsterID, disableBehaviorWhenInit);
            gameObj.SetActive(false);
            PreloadMonsterItem item = new PreloadMonsterItem(name, gameObj, component.config);

            this._preloadedMonsters.Add(item);
            ConfigMonster monster2 = MonsterData.GetMonsterConfig(monsterName, typeName, string.Empty);

            for (int j = 0; j < monster2.CommonArguments.PreloadEffectPatternGroups.Length; j++)
            {
                Singleton <EffectManager> .Instance.PreloadEffectGroup(monster2.CommonArguments.PreloadEffectPatternGroups[j], false);
            }
            for (int k = 0; k < monster2.CommonArguments.RequestSoundBankNames.Length; k++)
            {
                Singleton <WwiseAudioManager> .Instance.ManualPrepareBank(component.config.CommonArguments.RequestSoundBankNames[k]);
            }
        }
Exemplo n.º 6
0
        private void PostStartHandleBenchmark()
        {
            if (this.isBenchmark)
            {
                Singleton <AvatarManager> .Instance.SetAutoBattle(true);

                List <BaseMonoAvatar> allPlayerAvatars = Singleton <AvatarManager> .Instance.GetAllPlayerAvatars();

                for (int i = 0; i < allPlayerAvatars.Count; i++)
                {
                    if (!string.IsNullOrEmpty(this.avatarDevDatas[i].avatarAI))
                    {
                        ExternalBehaviorTree tree = Miscs.LoadResource <ExternalBehaviorTree>(this.avatarDevDatas[i].avatarAI, BundleType.RESOURCE_FILE);
                        ((BTreeAvatarAIController)allPlayerAvatars[i].GetActiveAIController()).autoBattleBehavior   = tree;
                        ((BTreeAvatarAIController)allPlayerAvatars[i].GetActiveAIController()).autoMoveBehvior      = tree;
                        ((BTreeAvatarAIController)allPlayerAvatars[i].GetActiveAIController()).supporterBehavior    = tree;
                        allPlayerAvatars[i].GetComponent <BehaviorDesigner.Runtime.BehaviorTree>().ExternalBehavior = tree;
                        allPlayerAvatars[i].GetComponent <BehaviorDesigner.Runtime.BehaviorTree>().EnableBehavior();
                    }
                }
                Screen.sleepTimeout = -1;
                SuperDebug.CloseAllDebugs();
                new GameObject {
                    name = "__Benchmark"
                }.AddComponent <MonoBenchmarkSwitches>();
            }
        }
Exemplo n.º 7
0
        public void PreloadGroup(string groupName, bool isCommon)
        {
            for (int i = 0; i < this._preloadedEffectGroupNames.Count; i++)
            {
                if (this._preloadedEffectGroupNames[i].groupName == groupName)
                {
                    PreloadGroupEntry local1 = this._preloadedEffectGroupNames[i];
                    local1.refCount++;
                    return;
                }
            }
            this._preloadedEffectGroupNames.Add(new PreloadGroupEntry(groupName, isCommon));
            if (EffectData.HasEffectPattern(groupName))
            {
                foreach (EffectPattern pattern in EffectData.GetEffectGroupPatterns(groupName))
                {
                    for (int j = 0; j < pattern.subEffects.Length; j++)
                    {
                        SubEffect  effect    = pattern.subEffects[j];
                        GameObject prototype = Miscs.LoadResource <GameObject>(EffectData.GetPrefabResPath(effect.prefabPath), BundleType.RESOURCE_FILE);
                        if (prototype != null)
                        {
                            Singleton <EffectManager> .Instance.AddEffectPrototype(effect.prefabPath, prototype);

                            this.PreloadSingleEffect(prototype, isCommon);
                        }
                    }
                }
            }
        }
Exemplo n.º 8
0
        public void SetupViewWithIdentifyStatus(StigmataDataItem stigmata, bool forceLock)
        {
            this._stigmata = stigmata;
            Transform containerTrans = base.transform.Find("PrefContainer");
            Transform transform2     = base.transform.Find("Mask/PrefContainer");
            Transform transform3     = base.transform.Find("Mask");

            this.SetupPrefIntoContainer(containerTrans, stigmata);
            if (stigmata.IsAffixIdentify && !forceLock)
            {
                this.SetImageAttrForAllChildren(containerTrans, null, Color.white);
                containerTrans.gameObject.SetActive(true);
                transform3.gameObject.SetActive(false);
            }
            else
            {
                containerTrans.gameObject.SetActive(false);
                Material mat = Miscs.LoadResource <Material>("Material/ImageColorize", BundleType.RESOURCE_FILE);
                this.SetImageAttrForAllChildren(containerTrans, mat, Color.white);
                transform3.gameObject.SetActive(true);
                this.SetupPrefIntoContainer(transform2, stigmata);
                Material material2 = Miscs.LoadResource <Material>("Material/ImageMonoColor", BundleType.RESOURCE_FILE);
                this.SetImageAttrForAllChildren(transform2, material2, MiscData.GetColor("DarkBlue"));
            }
        }
Exemplo n.º 9
0
 private void InitCache()
 {
     this._selectedGameObject    = base.transform.Find("Selected").gameObject;
     this._unselectedGameObject  = base.transform.Find("Unselected").gameObject;
     this._hideGameObject        = base.transform.Find("Hide").gameObject;
     this._imageGameObject       = base.transform.Find("Image").gameObject;
     this._imageImage            = this._imageGameObject.GetComponent <Image>();
     this._hideDotGameObject     = base.transform.Find("TimeLineDots/HideDot").gameObject;
     this._selectDotGameObject   = base.transform.Find("TimeLineDots/SelectDot").gameObject;
     this._unselectDotGameObject = base.transform.Find("TimeLineDots/UnselectDot").gameObject;
     this._descTransform         = base.transform.Find("Desc");
     this._descText         = this._descTransform.GetComponent <Text>();
     this._descOutline      = this._descTransform.GetComponent <Outline>();
     this._preImage         = this._bgTrans.Find("Pre").GetComponent <Image>();
     this._preCanvasGroup   = this._bgTrans.Find("Pre").GetComponent <CanvasGroup>();
     this._postImage        = this._bgTrans.Find("Post").GetComponent <Image>();
     this._postCanvasGroup  = this._bgTrans.Find("Post").GetComponent <CanvasGroup>();
     this._exBGGameObject   = this._bgTrans.Find("ExBG").gameObject;
     this._exBGCanvasGroup  = this._bgTrans.Find("ExBG").GetComponent <CanvasGroup>();
     this._unselectMaterial = Miscs.LoadResource <Material>("Material/ImageMonoColor", BundleType.RESOURCE_FILE);
     if (this._actData != null)
     {
         this._bgImgSprite = Miscs.GetSpriteByPrefab(this._actData.BGImgPath);
     }
     if (this._activityDatta != null)
     {
         this._activityBgImgSprite = Miscs.GetSpriteByPrefab(this._activityDatta.GetBgImgPath());
     }
 }
Exemplo n.º 10
0
 public void SetupView(StorageDataItemBase data, Transform parentTrans, StorageItemAction action, int loadPosition, System.Type type, bool interactable = true)
 {
     this._originColor        = base.transform.GetComponent <Image>().color;
     this._data               = data;
     this._storageItemProcess = action;
     this._type               = type;
     this._loadPosition       = loadPosition;
     base.transform.SetParent(parentTrans, false);
     if (this._data == null)
     {
         this.RealClearContent();
     }
     else
     {
         base.transform.Find("Image").gameObject.SetActive(true);
         GameObject obj2 = Miscs.LoadResource <GameObject>(data.GetIconPath(), BundleType.RESOURCE_FILE);
         base.transform.Find("Image").GetComponent <Image>().sprite = obj2.GetComponent <SpriteRenderer>().sprite;
         if (this._data is MaterialDataItem)
         {
             base.transform.Find("LevelAndCost").gameObject.SetActive(false);
             base.transform.Find("Number").gameObject.SetActive(true);
             base.transform.Find("Number/Number").GetComponent <Text>().text = this._data.number.ToString();
         }
         else
         {
             base.transform.Find("LevelAndCost").gameObject.SetActive(true);
             base.transform.Find("Number").gameObject.SetActive(false);
             base.transform.Find("LevelAndCost/LevelNumber").GetComponent <Text>().text = this._data.level.ToString();
             base.transform.Find("LevelAndCost/CostNumber").GetComponent <Text>().text  = this._data.GetCost().ToString();
         }
         base.transform.GetComponent <Button>().interactable = interactable;
         this._setupAlready = true;
     }
 }
Exemplo n.º 11
0
        public void ChangeBehavior(string AIName)
        {
            ExternalBehaviorTree tree = Miscs.LoadResource <ExternalBehaviorTree>("AI/Avatar/" + AIName, BundleType.RESOURCE_FILE);

            this._btree.ExternalBehavior = tree;
            this._hasOverridenBehavior   = true;
        }
Exemplo n.º 12
0
        private void DoSetupView()
        {
            base.view.transform.Find("GroupPanel").gameObject.SetActive(true);
            this.InitAnimationAndDialogManager();
            Transform transform = base.view.transform.Find("GroupPanel/GroupInfotPanel");

            transform.Find("GroupName").GetComponent <Text>().text = LocalizationGeneralLogic.GetText(EndlessGroupMetaDataReader.GetEndlessGroupMetaDataByKey(Singleton <EndlessModule> .Instance.currentGroupLevel).groupName, new object[0]);
            Color color  = Miscs.ParseColor(MiscData.Config.EndlessGroupUnSelectColor[Singleton <EndlessModule> .Instance.currentGroupLevel]);
            Color color2 = Miscs.ParseColor(MiscData.Config.EndlessGroupBGColor[Singleton <EndlessModule> .Instance.currentGroupLevel]);

            transform.Find("GroupName").GetComponent <Text>().color = color;
            base.view.transform.Find("BG/GroupColor").GetComponent <Image>().color = color2;
            int currentFinishProgress = Singleton <EndlessModule> .Instance.CurrentFinishProgress;

            transform.Find("FloorNum").GetComponent <Text>().text = (currentFinishProgress != 0) ? currentFinishProgress.ToString() : "-";
            base.view.transform.Find("GroupPanel/Result/Win").gameObject.SetActive(this.isSuccess);
            base.view.transform.Find("GroupPanel/Result/Lost").gameObject.SetActive(!this.isSuccess);
            if (!this.isSuccess)
            {
                base.view.transform.Find("BG/TriangleFill").GetComponent <Image>().material = Miscs.LoadResource <Material>("Material/ImageGrayscale", BundleType.RESOURCE_FILE);
                base.view.transform.Find("BG").GetComponent <Image>().material = Miscs.LoadResource <Material>("Material/ImageGrayscale", BundleType.RESOURCE_FILE);
            }
            else
            {
                base.view.transform.Find("BG/TriangleFill").GetComponent <Image>().material = null;
                base.view.transform.Find("BG").GetComponent <Image>().material = null;
            }
            this.SetupReward();
            this._dropItemAnimationManager.StartPlay(0f, true);
        }
Exemplo n.º 13
0
        public void AddHintArrow(uint listenRuntimeID)
        {
            BaseMonoEntity listenEntity = Singleton <EventManager> .Instance.GetEntity(listenRuntimeID);

            string path = string.Empty;

            if (Singleton <RuntimeIDManager> .Instance.ParseCategory(listenRuntimeID) == 4)
            {
                path = "UI/HintArrowAlt/HintArrowMonsterAlt";
            }
            else if (Singleton <RuntimeIDManager> .Instance.ParseCategory(listenRuntimeID) == 3)
            {
                path = "UI/HintArrowAlt/HintArrowAvatarAlt";
            }
            else
            {
                if (!(listenEntity is BaseMonoDynamicObject) || (Singleton <EventManager> .Instance.GetActor(listenEntity.GetRuntimeID()) == null))
                {
                    throw new Exception("Invalid Type or State!");
                }
                path = "UI/HintArrowAlt/HintArrowExitAlt";
            }
            MonoHintArrow component = UnityEngine.Object.Instantiate <GameObject>(Miscs.LoadResource <GameObject>(path, BundleType.RESOURCE_FILE)).GetComponent <MonoHintArrow>();

            component.Init(listenRuntimeID, listenEntity);
            component.transform.SetParent(this._hintRing.transform, false);
            this._hintArrowLs.Add(component);
        }
Exemplo n.º 14
0
        public void SetupActView(ActDataItem actData, List <LevelDataItem> levels, Transform levelScrollTrans, LevelBtnClickCallBack OnLevelClick, Transform bgTrans, Dictionary <LevelDataItem, Transform> levelTransDict, int totalFinishChallengeNum)
        {
            this._actData = actData;
            this._bgTrans = bgTrans;
            this.InitCache();
            this._selectedGameObject.SetActive(true);
            this._unselectedGameObject.SetActive(true);
            this._hideGameObject.SetActive(false);
            this._imageGameObject.SetActive(true);
            if (!string.IsNullOrEmpty(actData.smallImgPath))
            {
                this._imageImage.sprite = Miscs.GetSpriteByPrefab(actData.smallImgPath);
            }
            this._descText.text = actData.actTitle;
            Transform transform = UnityEngine.Object.Instantiate <GameObject>(Miscs.LoadResource <GameObject>(actData.levelPanelPath, BundleType.RESOURCE_FILE)).transform;

            transform.SetParent(levelScrollTrans.Find("Content"), false);
            transform.GetComponent <MonoLevelPanel>().SetupView(levels, OnLevelClick, levelTransDict, null, totalFinishChallengeNum);
            base.transform.GetComponent <MonoItemStatus>().isValid = true;
            transform.GetComponent <MonoItemStatus>().isValid      = true;
            this._bgTrans.gameObject.SetActive(true);
            if (actData != null)
            {
                this._preImage.sprite       = this._bgImgSprite;
                this._preCanvasGroup.alpha  = 1f;
                this._postImage.sprite      = this._bgImgSprite;
                this._postCanvasGroup.alpha = 1f;
            }
        }
Exemplo n.º 15
0
        public static void LoadFromFile()
        {
            List <string> list  = new List <string>();
            TextAsset     asset = Miscs.LoadResource("Data/_ExcelOutput/PlotData", BundleType.DATA_FILE) as TextAsset;

            char[]   separator = new char[] { "\n"[0] };
            string[] strArray  = asset.text.Split(separator);
            for (int i = 0; i < strArray.Length; i++)
            {
                if (strArray[i].Length >= 1)
                {
                    list.Add(strArray[i]);
                }
            }
            int capacity = list.Count - 1;

            _itemDict = new Dictionary <int, PlotMetaData>();
            _itemList = new List <PlotMetaData>(capacity);
            for (int j = 1; j <= capacity; j++)
            {
                char[]       chArray2  = new char[] { "\t"[0] };
                string[]     strArray2 = list[j].Split(chArray2);
                PlotMetaData item      = new PlotMetaData(int.Parse(strArray2[0]), int.Parse(strArray2[1]), int.Parse(strArray2[2]), int.Parse(strArray2[3]));
                _itemList.Add(item);
                _itemDict.Add(item.plotID, item);
            }
        }
Exemplo n.º 16
0
        public void SetupActivityView(WeekDayActivityDataItem activityData, MonoActivityInfoPanel infoPanel, List <LevelDataItem> levels, Transform levelScrollTrans, LevelBtnClickCallBack OnLevelClick, Transform bgTrans, Dictionary <LevelDataItem, Transform> levelTransDict)
        {
            this._activityDatta = activityData;
            this._infoPanel     = infoPanel;
            this._bgTrans       = bgTrans;
            this.InitCache();
            this._selectedGameObject.SetActive(true);
            this._unselectedGameObject.SetActive(true);
            this._hideGameObject.SetActive(false);
            this._imageGameObject.SetActive(true);
            if (!string.IsNullOrEmpty(activityData.GetSmallImgPath()))
            {
                this._imageImage.sprite = Miscs.GetSpriteByPrefab(activityData.GetSmallImgPath());
            }
            this._descText.text = activityData.GetActitityTitle();
            Transform transform = UnityEngine.Object.Instantiate <GameObject>(Miscs.LoadResource <GameObject>(((activityData == null) || (activityData.GetStatus() != ActivityDataItemBase.Status.InProgress)) ? "UI/Menus/Widget/Map/LevelPanelActivity" : activityData.GetLevelPanelPath(), BundleType.RESOURCE_FILE)).transform;

            transform.SetParent(levelScrollTrans.Find("Content"), false);
            transform.GetComponent <MonoLevelPanel>().SetupView(levels, OnLevelClick, levelTransDict, activityData, 0);
            base.transform.GetComponent <MonoItemStatus>().isValid = true;
            transform.GetComponent <MonoItemStatus>().isValid      = true;
            this._bgTrans.gameObject.SetActive(true);
            if (this._activityDatta != null)
            {
                this._preImage.sprite  = Miscs.GetSpriteByPrefab(this._activityDatta.GetBgImgPath());
                this._postImage.sprite = Miscs.GetSpriteByPrefab(this._activityDatta.GetBgImgPath());
                this._infoPanel.SetupView(this._activityDatta);
            }
        }
Exemplo n.º 17
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());
         }
     }
 }
Exemplo n.º 18
0
        public uint CreateMonster(string monsterName, string typeName, int level, bool isLocal, Vector3 initPos, uint runtimeID, bool isElite = false, uint uniqueMonsterID = 0, bool checkOutsideWall = true, bool disableBehaviorWhenInit = false, int tagID = 0)
        {
            BaseMonoMonster component = null;
            GameObject      gameObj   = null;

            if (uniqueMonsterID != 0)
            {
                UniqueMonsterMetaData uniqueMonsterMetaData = MonsterData.GetUniqueMonsterMetaData(uniqueMonsterID);
                monsterName = uniqueMonsterMetaData.monsterName;
                typeName    = uniqueMonsterMetaData.typeName;
            }
            string str   = monsterName + typeName + uniqueMonsterID.ToString() + disableBehaviorWhenInit.ToString();
            int    index = 0;
            int    num2  = 0;
            int    count = this._preloadedMonsters.Count;

            while (num2 < count)
            {
                if (this._preloadedMonsters[num2].name == str)
                {
                    gameObj = this._preloadedMonsters[num2].gameObj;
                    index   = num2;
                    break;
                }
                num2++;
            }
            if (gameObj != null)
            {
                gameObj.SetActive(true);
                this._preloadedMonsters.RemoveAt(index);
            }
            else
            {
                gameObj = (GameObject)UnityEngine.Object.Instantiate(Miscs.LoadResource <GameObject>(MonsterData.GetPrefabResPath(monsterName, typeName, !GlobalVars.MONSTER_USE_DYNAMIC_BONE || (Singleton <LevelManager> .Instance.levelActor.levelMode == LevelActor.Mode.Multi)), BundleType.RESOURCE_FILE), InLevelData.CREATE_INIT_POS, Quaternion.identity);
            }
            component = gameObj.GetComponent <BaseMonoMonster>();
            if (runtimeID == 0)
            {
                runtimeID = Singleton <RuntimeIDManager> .Instance.GetNextRuntimeID(4);
            }
            bool flag = checkOutsideWall;

            component.Init(monsterName, typeName, runtimeID, initPos, uniqueMonsterID, null, flag, isElite, disableBehaviorWhenInit, tagID);
            this.RegisterMonster(component);
            MonsterActor actor = Singleton <EventManager> .Instance.CreateActor <MonsterActor>(component);

            actor.InitLevelData(level, isElite);
            actor.PostInit();
            int num4   = 0;
            int length = component.config.CommonArguments.RequestSoundBankNames.Length;

            while (num4 < length)
            {
                Singleton <WwiseAudioManager> .Instance.ManualPrepareBank(component.config.CommonArguments.RequestSoundBankNames[num4]);

                num4++;
            }
            return(component.GetRuntimeID());
        }
Exemplo n.º 19
0
        protected override bool SetupView()
        {
            base.view.transform.Find("Btn").gameObject.SetActive(false);
            this._animationManager = new SequenceAnimationManager(new Action(this.StartTimer), null);
            LevelScoreManager instance = Singleton <LevelScoreManager> .Instance;
            int level                = (instance == null) ? this._levelBefore_no_scoremanager : instance.playerLevelBefore;
            int teamLevel            = Singleton <PlayerModule> .Instance.playerData.teamLevel;
            PlayerLevelMetaData data = PlayerLevelMetaDataReader.TryGetPlayerLevelMetaDataByKey(level);

            SuperDebug.VeryImportantAssert(data != null, string.Format("Cannot get player level data for player level:{0}", level));
            if (data == null)
            {
                data = PlayerLevelMetaDataReader.TryGetPlayerLevelMetaDataByKey(1);
            }
            base.view.transform.Find("Dialog/Content/LevelInfo/LvBefore/Lv").GetComponent <Text>().text = level.ToString();
            base.view.transform.Find("Dialog/Content/LevelInfo/LvAfter/Lv").GetComponent <Text>().text  = teamLevel.ToString();
            int       maxStamina = Singleton <PlayerModule> .Instance.playerData.MaxStamina;
            int       stamina    = data.stamina;
            Transform transform  = base.view.transform.Find("Dialog/Content/MaxStamina");

            if (maxStamina > stamina)
            {
                transform.gameObject.SetActive(true);
                transform.Find("Num").GetComponent <Text>().text    = maxStamina.ToString();
                transform.Find("AddNum").GetComponent <Text>().text = "+" + ((maxStamina - stamina)).ToString();
            }
            else
            {
                transform.gameObject.SetActive(false);
            }
            int       avatarLevelLimit = Singleton <PlayerModule> .Instance.playerData.AvatarLevelLimit;
            int       num6             = data.avatarLevelLimit;
            Transform transform2       = base.view.transform.Find("Dialog/Content/MaxAvatarLevel");

            if (avatarLevelLimit > num6)
            {
                transform2.gameObject.SetActive(true);
                transform2.Find("Num").GetComponent <Text>().text    = avatarLevelLimit.ToString();
                transform2.Find("AddNum").GetComponent <Text>().text = "+" + ((avatarLevelLimit - num6)).ToString();
            }
            else
            {
                transform2.gameObject.SetActive(false);
            }
            RectTransform component   = base.view.transform.Find("Dialog").GetComponent <RectTransform>();
            List <string> newFeatures = MiscData.GetNewFeatures(level, teamLevel);

            for (int i = 0; i < newFeatures.Count; i++)
            {
                string     text = LocalizationGeneralLogic.GetText(newFeatures[i], new object[0]);
                GameObject obj2 = UnityEngine.Object.Instantiate <GameObject>(Miscs.LoadResource <GameObject>("UI/Menus/Widget/Map/NewFeature", BundleType.RESOURCE_FILE));
                obj2.transform.SetParent(component.Find("Content"), false);
                obj2.transform.Find("FeatureName").GetComponent <Text>().text = text;
            }
            this._animationManager.AddAllChildrenInTransform(base.view.transform.Find("Dialog/Content"));
            base.view.transform.Find("Dialog").GetComponent <MonoDialogHeightGrow>().PlayGrow(new Action(this.OnDialogBGGrowEnd));
            return(false);
        }
Exemplo n.º 20
0
        private void SetupPrefIntoContainer(Transform containerTrans, StigmataDataItem stigmata)
        {
            containerTrans.DestroyChildren();
            GameObject obj2 = UnityEngine.Object.Instantiate <GameObject>(Miscs.LoadResource <GameObject>(stigmata.GetImagePath(), BundleType.RESOURCE_FILE));

            obj2.transform.SetParent(containerTrans, false);
            obj2.gameObject.SetActive(true);
            obj2.GetComponent <RectTransform>().anchoredPosition = Vector2.zero;
        }
Exemplo n.º 21
0
        private GameObject PreloadDynamicObject(string type, string prefabPath)
        {
            GameObject gameObj = Miscs.LoadResource <GameObject>(prefabPath, BundleType.RESOURCE_FILE);

            if (gameObj != null)
            {
                this._preloadDynamicObjectProtos.Add(new PreloadDynamicObjectPrototype(type, gameObj));
            }
            return(gameObj);
        }
Exemplo n.º 22
0
        public void ChangeBehavior(string AIName)
        {
            ExternalBehaviorTree tree = Miscs.LoadResource <ExternalBehaviorTree>("AI/Monster/" + AIName, BundleType.RESOURCE_FILE);

            if (tree != null)
            {
                this._btree.ExternalBehavior = tree;
                this.EnableBehavior();
            }
        }
Exemplo n.º 23
0
 public void InitAtStart()
 {
     this._hintRing      = UnityEngine.Object.Instantiate <GameObject>(Miscs.LoadResource <GameObject>("UI/HintArrowAlt/RingAlt", BundleType.RESOURCE_FILE));
     this._hintRing.name = "_HintRing";
     this._hintRing.SetActive(false);
     this._hintRingVisible      = false;
     this._hintRingAnim         = this._hintRing.GetComponent <Animation>();
     this._hintRingOutAnimState = this._hintRingAnim["RingAltOut"];
     this._hintArrowLs          = new List <MonoHintArrow>();
 }
Exemplo n.º 24
0
        protected override bool SetupView()
        {
            string path = "UI/InLevelCloseUp/CloseUp_" + this.monsterName;

            base.view.transform.DestroyChildren();
            GameObject obj2 = UnityEngine.Object.Instantiate <GameObject>(Miscs.LoadResource <GameObject>(path, BundleType.RESOURCE_FILE));

            obj2.transform.SetParent(base.view.transform, false);
            obj2.GetComponent <Animation>().Play();
            return(false);
        }
Exemplo n.º 25
0
 public void AttachWeapon(int weaponID, string avatarType)
 {
     if (this._weaponMetaID != weaponID)
     {
         this._weaponMetaID = weaponID;
         ConfigWeapon weaponConfig     = WeaponData.GetWeaponConfig(weaponID);
         Transform    weaponProtoTrans = Miscs.LoadResource <GameObject>(weaponConfig.Attach.PrefabPath, BundleType.RESOURCE_FILE).transform;
         WeaponAttach.AttachWeaponMesh(weaponConfig, this, weaponProtoTrans, avatarType);
         int layer = 8;
         base.gameObject.SetLayer(layer, true);
     }
 }
Exemplo n.º 26
0
 public virtual void Awake()
 {
     this._renderingDataStack           = new FixedStack <RenderingDataTransition>(10, new Action <RenderingDataTransition, int, RenderingDataTransition, int>(this.OnRenderingDataChanged));
     this._currentRendertingData        = null;
     this._renderingDataTransitionTimer = new EntityTimer(0f);
     this._renderingDataTransitionTimer.SetActive(false);
     this._renderingDataState     = RenderingDataState.Idle;
     this._mainCameraTransform    = Camera.main.transform;
     this._subWeatherStack        = new FixedStack <SubWeatherTransition>(5, new Action <SubWeatherTransition, int, SubWeatherTransition, int>(this.OnSubWeatherChanged));
     this._rainPrefab             = Miscs.LoadResource <GameObject>(this.RAIN_PREFAB_PATH, BundleType.RESOURCE_FILE);
     this._weatherState           = WeatherState.Idle;
     this._weatherTransitionTimer = new EntityTimer(0f);
     this._weatherTransitionTimer.SetActive(false);
 }
Exemplo n.º 27
0
        protected override bool SetupView()
        {
            EventSystem.current.SetSelectedGameObject(base.view.transform.Find("Dialog/InputField").gameObject);
            Transform parent = base.view.transform.Find("GMBtnsPanel/Content");

            foreach (string str in this._showCommandList)
            {
                GameObject obj2 = UnityEngine.Object.Instantiate <GameObject>(Miscs.LoadResource <GameObject>("UI/GMTalk/GMTalkButton", BundleType.RESOURCE_FILE));
                obj2.transform.SetParent(parent, false);
                obj2.GetComponent <MonoGMTalkButton>().SetupView(str, new MonoGMTalkButton.ButtonCallBack(this.GMTalkButtonCallback));
            }
            this.SyncNetworkDelayDisplay();
            return(false);
        }
Exemplo n.º 28
0
        public void SetTheFigureFitTheContent(string imagePath)
        {
            GameObject obj2   = Miscs.LoadResource <GameObject>(imagePath, BundleType.RESOURCE_FILE);
            float      width  = obj2.GetComponent <SpriteRenderer>().sprite.rect.width;
            float      height = obj2.GetComponent <SpriteRenderer>().sprite.rect.height;
            float      num3   = (base.transform as RectTransform).rect.width;

            if (width > num3)
            {
                height *= num3 / width;
                width   = num3;
            }
            base.transform.Find("Image").GetComponent <Image>().sprite = obj2.GetComponent <SpriteRenderer>().sprite;
            (base.transform.Find("Image") as RectTransform).SetSizeWithCurrentAnchors(RectTransform.Axis.Horizontal, width);
            (base.transform.Find("Image") as RectTransform).SetSizeWithCurrentAnchors(RectTransform.Axis.Vertical, height);
        }
Exemplo n.º 29
0
        public void AddHintArrowForPath(MonoSpawnPoint spawn)
        {
            if (this._hintArrowForPath != null)
            {
                this.RemoveHintArrowForPath();
            }
            string        path      = "UI/HintArrowAlt/HintArrowExitAlt";
            MonoHintArrow component = UnityEngine.Object.Instantiate <GameObject>(Miscs.LoadResource <GameObject>(path, BundleType.RESOURCE_FILE)).GetComponent <MonoHintArrow>();

            component.Init(0, null);
            component.transform.SetParent(this._hintRing.transform, false);
            this._pathSpawn        = spawn;
            this._hintArrowForPath = component;
            this._hintArrowForPath.SetVisible(true);
            this.UpdateHintArrow(component.transform, spawn.XZPosition, false);
        }
Exemplo n.º 30
0
        public void SetupView(RewardType rewardType, int num, StorageDataItemBase itemData)
        {
            this._rewardType = rewardType;
            this._num        = num;
            this._itemData   = itemData;
            GameObject obj2 = Miscs.LoadResource <GameObject>(this.GetIconPath(), BundleType.RESOURCE_FILE);

            base.transform.Find("Icon").GetComponent <Image>().sprite = obj2.GetComponent <SpriteRenderer>().sprite;
            string name = this.GetName();

            if (num > 1)
            {
                name = name + " x" + num;
            }
            base.transform.Find("Desc").GetComponent <Text>().text = name;
        }