Example #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);
            }
        }
 private void SetupLvInfoPanel(float starDelay = 0f)
 {
     this._animationManager = new SequenceAnimationManager(new Action(this.EnableBGClick), null);
     base.view.transform.Find("ItemPanel/3dModel").gameObject.SetActive(false);
     base.view.transform.Find("ItemPanel/StigmataIcon").gameObject.SetActive(false);
     base.view.transform.Find("ItemPanel/OtherIcon").gameObject.SetActive(false);
     if (this.itemDataBefore is WeaponDataItem)
     {
         base.view.transform.Find("ItemPanel/3dModel").gameObject.SetActive(true);
         base.view.transform.Find("ItemPanel/3dModel").GetComponent<MonoWeaponRenderImage>().SetupView(this.itemDataAfter as WeaponDataItem, false, 0);
         this._animationManager.AddAnimation(base.view.transform.Find("ItemPanel/3dModel").GetComponent<MonoAnimationinSequence>(), null);
     }
     else if (this.itemDataBefore is StigmataDataItem)
     {
         base.view.transform.Find("ItemPanel/StigmataIcon").gameObject.SetActive(true);
         base.view.transform.Find("ItemPanel/StigmataIcon/Image").GetComponent<MonoStigmataFigure>().SetupView(this.itemDataBefore as StigmataDataItem);
         this._animationManager.AddAnimation(base.view.transform.Find("ItemPanel/StigmataIcon/Image").GetComponent<MonoAnimationinSequence>(), null);
     }
     else
     {
         base.view.transform.Find("ItemPanel/OtherIcon").gameObject.SetActive(true);
         base.view.transform.Find("ItemPanel/OtherIcon/Image").GetComponent<Image>().sprite = Miscs.GetSpriteByPrefab(this.itemDataAfter.GetImagePath());
         this._animationManager.AddAnimation(base.view.transform.Find("ItemPanel/OtherIcon/Image").GetComponent<MonoAnimationinSequence>(), null);
     }
     base.view.transform.Find("Result").GetComponent<Image>().sprite = Miscs.GetSpriteByPrefab("SpriteOutput/EquipPowerUpResult/Success" + MiscData.GetEquipPowerUpResultIndex(this.boostRate).ToString());
     this._animationManager.AddAnimation(base.view.transform.Find("Result").GetComponent<MonoAnimationinSequence>(), null);
     base.view.transform.Find("InfoRowLv").GetComponent<MonoEquipExpGrow>().SetData(this.itemDataBefore.level, this.itemDataBefore.GetMaxExp(), this.itemDataBefore.exp, this.itemDataAfter.exp, UIUtil.GetEquipmentMaxExpList(this.itemDataBefore, this.itemDataBefore.level, this.itemDataAfter.level));
     this._animationManager.AddAnimation(base.view.transform.Find("InfoRowLv").GetComponent<MonoAnimationinSequence>(), null);
     this._animationManager.StartPlay(starDelay, true);
 }
Example #3
0
 public void SetupView(ItempediaDataAdapter item, bool active)
 {
     this._item = item;
     base.transform.Find("SelectedMark").gameObject.SetActive(false);
     base.transform.Find("ProtectedMark").gameObject.SetActive(false);
     base.transform.Find("NotEnough").gameObject.SetActive(false);
     base.transform.Find("Star").gameObject.SetActive(false);
     base.transform.Find("StigmataType").gameObject.SetActive(false);
     base.transform.Find("UnidentifyText").gameObject.SetActive(false);
     base.transform.Find("BG/Unselected").gameObject.SetActive(true);
     base.transform.Find("BG/Selected").gameObject.SetActive(false);
     base.transform.Find("Text").gameObject.SetActive(false);
     if (this._item == null)
     {
         base.transform.Find("ItemIcon").gameObject.SetActive(false);
     }
     else
     {
         base.transform.Find("ItemIcon").gameObject.SetActive(true);
         Sprite spriteByPrefab = Miscs.GetSpriteByPrefab(item.iconPath);
         base.transform.Find("ItemIcon/Icon").GetComponent <Image>().sprite = spriteByPrefab;
         base.transform.Find("ItemIcon").GetComponent <Image>().color       = Color.white;
         base.transform.Find("ItemIcon").GetComponent <Image>().sprite      = Miscs.GetSpriteByPrefab(MiscData.Config.ItemRarityBGImgPath[item.rarity]);
         this.SetupRarityView();
         this.SetupStigmataTypeIcon();
         if (!active)
         {
             this.SetItemGrey();
         }
         else
         {
             this.SetItemDefaultColor();
         }
     }
 }
Example #4
0
        public void SetOutsideParticleColorByRarity(GameObject obj, int rarity)
        {
            ParticleSystem[] componentsInChildren = obj.GetComponentsInChildren <ParticleSystem>();
            int index  = 0;
            int length = componentsInChildren.Length;

            while (index < length)
            {
                Renderer component = componentsInChildren[index].GetComponent <Renderer>();
                if ((component != null) && (component.material.shader.name.IndexOf("Channel Mix") != -1))
                {
                    Color black = Color.black;
                    Color color = Color.black;
                    if ((rarity == 1) || (rarity == 2))
                    {
                        black = Miscs.ParseColor("#00E48F7F");
                        color = Miscs.ParseColor("#95FF967F");
                    }
                    else if (rarity == 3)
                    {
                        black = Miscs.ParseColor("#0041FF7F");
                        color = Miscs.ParseColor("#7081FF7F");
                    }
                    else if (((rarity == 4) || (rarity == 5)) || (rarity == 6))
                    {
                        black = Miscs.ParseColor("#3700FF7F");
                        color = Miscs.ParseColor("#8E72FF7F");
                    }
                    component.material.SetColor("_TintColor1", black);
                    component.material.SetColor("_TintColor2", color);
                }
                index++;
            }
        }
        private bool OnHittingOtherResolve(EvtHittingOther evt)
        {
            bool flag = false;

            if (this.config.ModifyAllAnimEvents)
            {
                flag = true;
            }
            else
            {
                flag = Miscs.ArrayContains <string>(this.config.AnimEventIDs, evt.animEventID);
            }
            if (!base.actor.abilityPlugin.EvaluateAbilityPredicate(this.config.Predicates, base.instancedAbility, base.instancedModifier, Singleton <EventManager> .Instance.GetActor <BaseAbilityActor>(evt.toID), evt))
            {
                return(false);
            }
            if (flag)
            {
                evt.attackData.attackerCritChance        += base.instancedAbility.Evaluate(this.config.CritChanceDelta);
                evt.attackData.attackerCritDamageRatio   += base.instancedAbility.Evaluate(this.config.CritDamageRatioDelta);
                evt.attackData.attackerAniDamageRatio    += base.instancedAbility.Evaluate(this.config.AnimDamageRatioDelta);
                evt.attackData.attackerAttackPercentage  += base.instancedAbility.Evaluate(this.config.DamagePercentageDelta);
                evt.attackData.attackerShieldDamageRatio += base.instancedAbility.Evaluate(this.config.ShieldDamageDelta);
                evt.attackData.attackerAttackValue       += base.instancedAbility.Evaluate(this.config.AttackValueDelta);
                base.actor.abilityPlugin.HandleActionTargetDispatch(this.config.Actions, base.instancedAbility, base.instancedModifier, Singleton <EventManager> .Instance.GetActor <BaseAbilityActor>(evt.toID), evt);
            }
            return(true);
        }
Example #6
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);
        }
Example #7
0
 public override TaskStatus OnUpdate()
 {
     if (this._timer >= 0f)
     {
         this._timer -= Time.deltaTime * this._aiEntity.TimeScale;
         if ((this._aiEntity.AttackTarget == null) || !this._aiEntity.AttackTarget.IsActive())
         {
             return(TaskStatus.Success);
         }
         Vector3 targetFaceDir = this.GetTargetFaceDir();
         if (this.forceAndInstant)
         {
             base.GetComponent <BaseMonoAnimatorEntity>().SteerFaceDirectionTo(targetFaceDir);
             return(TaskStatus.Success);
         }
         if (Mathf.Abs(Miscs.AngleFromToIgnoreY(this._aiEntity.FaceDirection, targetFaceDir)) >= this.angelThreshold)
         {
             this._aiController.TrySteer(targetFaceDir, (this.steerSpeedRatio * (this._aiEntity.GetProperty("Animator_MoveSpeedRatio") + 1f)) * 1.5f);
             return(TaskStatus.Running);
         }
         if (this.keepFacing)
         {
             return(TaskStatus.Running);
         }
     }
     return(TaskStatus.Success);
 }
Example #8
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;
     }
 }
Example #9
0
        public ChatMsgDataItem(ChatMsg chatMsg)
        {
            DateTime dateTimeFromTimeStamp = Miscs.GetDateTimeFromTimeStamp(chatMsg.get_time());
            string   nickname = !string.IsNullOrEmpty(chatMsg.get_nickname()) ? chatMsg.get_nickname() : ("ID. " + chatMsg.get_uid());

            this.Init((int)chatMsg.get_uid(), nickname, dateTimeFromTimeStamp, chatMsg.get_msg(), Type.MSG);
        }
Example #10
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>();
            }
        }
        public void TokenLoginTest()
        {
            GeneralLocalDataItem generalLocalData = Singleton <MiHoYoGameData> .Instance.GeneralLocalData;
            string url = string.Format(this.ORIGINAL_TOKEN_LOGIN_URL + "?uid={0}&token={1}", generalLocalData.Account.uid, generalLocalData.Account.token);

            Singleton <ApplicationManager> .Instance.StartCoroutine(Miscs.WWWRequestWithRetry(url, new Action <string>(this.TokenLoginTestFinishedCallBack), () => this.WWWTimeOut(new Action(this.TokenLoginTest)), 5f, 3, null, null));
        }
Example #12
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());
         }
     }
 }
Example #13
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]);
            }
        }
Example #14
0
 private void SetupAutoRefreshInfo()
 {
     base.transform.Find("SystemInfoPanel/SystemRefresh").gameObject.SetActive(this._shopType != UIShopType.SHOP_GACHATICKET);
     if (this._shopType != UIShopType.SHOP_GACHATICKET)
     {
         bool     flag = true;
         DateTime dateTimeFromTimeStamp = Miscs.GetDateTimeFromTimeStamp(this._storeDataItem.nextAutoRefreshTime);
         if (this._shopType == UIShopType.SHOP_ACTIVITY)
         {
             if (this._storeDataItem.scheduleChangeTime != 0)
             {
                 dateTimeFromTimeStamp = Miscs.GetDateTimeFromTimeStamp(this._storeDataItem.scheduleChangeTime);
             }
             else
             {
                 flag = false;
             }
         }
         base.transform.Find("SystemInfoPanel/SystemRefresh").gameObject.SetActive(flag);
         if (flag)
         {
             base.transform.Find("SystemInfoPanel/SystemRefresh/RemainTimer").GetComponent <MonoRemainTimer>().SetTargetTime(dateTimeFromTimeStamp, null, new Action(this.OnAutoRefreshTimeOutCallback), false);
         }
     }
 }
Example #15
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());
     }
 }
Example #16
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"));
            }
        }
Example #17
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);
            }
        }
Example #18
0
        public void SetupView(FriendBriefDataItem friendData, bool selected, Action <FriendBriefDataItem> onFrameClick = null, Action <FriendBriefDataItem> onIconClick = null)
        {
            this._friendData = friendData;
            bool flag = Singleton <FriendModule> .Instance.IsMyFriend(this._friendData.uid);

            this._isFrozen = Singleton <FriendModule> .Instance.isHelperFrozen(friendData.uid);

            if (this._isFrozen)
            {
                this._nextAvaliableTime = Singleton <FriendModule> .Instance.GetHelperNextAvaliableTime(friendData.uid);
            }
            base.transform.Find("BG/Select").gameObject.SetActive(selected);
            base.transform.Find("BG/Normal").gameObject.SetActive(!selected && !this._isFrozen);
            base.transform.Find("Grey").gameObject.SetActive(this._isFrozen);
            base.transform.Find("PlayerName").GetComponent <Text>().text = friendData.nickName;
            base.transform.Find("FriendMark/Friend").gameObject.SetActive(flag);
            base.transform.Find("FriendMark/Strange").gameObject.SetActive(!flag);
            base.transform.Find("AvatarStar").GetComponent <MonoAvatarStar>().SetupView(friendData.avatarStar);
            base.transform.Find("Lv").GetComponent <Text>().text = "LV." + friendData.level;
            base.transform.Find("SelectMark").gameObject.SetActive(selected);
            base.transform.Find("PlayerIcon").GetComponent <Image>().sprite     = Miscs.GetSpriteByPrefab(this._friendData.AvatarIconPath);
            base.transform.Find("FriendPoint/Value").GetComponent <Text>().text = this.GetAddFP(flag).ToString();
            base.transform.Find("Btns/FrameBtn").gameObject.SetActive(!this._isFrozen);
            base.transform.Find("FriendPoint").gameObject.SetActive(!this._isFrozen);
            base.transform.Find("RemainTimer").gameObject.SetActive(this._isFrozen);
            if (this._isFrozen)
            {
                base.transform.Find("RemainTimer/Time").GetComponent <MonoRemainTimer>().SetTargetTime(this._nextAvaliableTime, null, new Action(this.OnFrozenTimeOutCallBack), false);
            }
            this._onFrameClick = onFrameClick;
            this._onIconClick  = onIconClick;
        }
Example #19
0
 private void CheckInteractable()
 {
     if (!this._interactable || (this._endlessPlayerData == null))
     {
         base.transform.Find("BlockPanel").gameObject.SetActive(true);
     }
     else
     {
         bool     flag = true;
         DateTime dateTimeFromTimeStamp = TimeUtil.Now.AddDays(-1.0);
         if (this._endlessPlayerData.get_hidden_expire_timeSpecified())
         {
             dateTimeFromTimeStamp = Miscs.GetDateTimeFromTimeStamp(this._endlessPlayerData.get_hidden_expire_time());
         }
         if (this._endlessPlayerData.get_uid() == Singleton <PlayerModule> .Instance.playerData.userId)
         {
             flag = false;
             base.transform.Find("FrozenInfo").gameObject.SetActive(false);
         }
         else if ((this._frozenEndTime > TimeUtil.Now) || (this._endlessPlayerData.get_hidden_expire_timeSpecified() && (dateTimeFromTimeStamp > TimeUtil.Now)))
         {
             flag = false;
         }
         if (((this._endlessPlayerData.get_progress() < 2) && (this._selectToolData != null)) && (this._selectToolData.ToolType == 4))
         {
             flag = false;
         }
         if ((this._selectToolData != null) && (this._selectToolData.ToolType == 3))
         {
             flag = false;
         }
         base.transform.Find("BlockPanel").gameObject.SetActive(!flag);
     }
 }
Example #20
0
        private bool GetTargetCorner(BaseMonoEntity entity, Vector3 sourcePosition, Vector3 targetPosition, ref Vector3 targetCorner)
        {
            DetourElement element;

            this._detours.TryGetValue(entity.GetRuntimeID(), out element);
            if (element == null)
            {
                return(false);
            }
            if (Miscs.DistancForVec3IgnoreY(targetPosition, element.targetPosition) > this._getPathDisThreshold)
            {
                this._detours.Remove(entity.GetRuntimeID());
                return(false);
            }
            if (Miscs.DistancForVec3IgnoreY(element.corners[element.targetCornerIndex], sourcePosition) <= element.disReachCornerThreshold)
            {
                if (element.targetCornerIndex == (element.corners.Length - 1))
                {
                    this._detours.Remove(entity.GetRuntimeID());
                    targetCorner = targetPosition;
                    return(true);
                }
                element.targetCornerIndex++;
                targetCorner = element.corners[element.targetCornerIndex];
                return(true);
            }
            targetCorner = element.corners[element.targetCornerIndex];
            return(true);
        }
Example #21
0
        public void Update()
        {
            Transform transform = base.transform.Find("LeftTime");

            if (transform.gameObject.activeSelf)
            {
                ActivityDataItemBase.Status status = this._activityData.GetStatus();
                if (status == ActivityDataItemBase.Status.WaitToStart)
                {
                    string str;
                    transform.Find("TimeValue").GetComponent <Text>().text = Miscs.GetTimeSpanToShow(this._activityData.beginTime, out str).ToString();
                    transform.Find("Label").GetComponent <Text>().text     = str;
                }
                else if (status == ActivityDataItemBase.Status.InProgress)
                {
                    string str2;
                    transform.Find("TimeValue").GetComponent <Text>().text = Miscs.GetTimeSpanToShow(this._activityData.endTime, out str2).ToString();
                    transform.Find("Label").GetComponent <Text>().text     = str2;
                }
                else
                {
                    transform.gameObject.SetActive(false);
                }
            }
        }
Example #22
0
        public bool IsEntityVisibleInCustomOffset(BaseMonoEntity entity, float fovOffset, float nearOffset, float farOffset)
        {
            bool   flag            = false;
            float  fieldOfView     = this.cameraComponent.fieldOfView;
            float  nearClipPlane   = this.cameraComponent.nearClipPlane;
            float  farClipPlane    = this.cameraComponent.farClipPlane;
            Camera cameraComponent = this.cameraComponent;

            cameraComponent.fieldOfView += fovOffset;
            Camera camera2 = this.cameraComponent;

            camera2.nearClipPlane += nearOffset;
            Camera camera3 = this.cameraComponent;

            camera3.farClipPlane += farOffset;
            Matrix4x4 projectionMatrix = this.cameraComponent.projectionMatrix;
            Collider  component        = entity.GetComponent <Collider>();

            if ((component != null) && component.enabled)
            {
                flag = GeometryUtility.TestPlanesAABB(GeometryUtility.CalculateFrustumPlanes(projectionMatrix), component.bounds);
            }
            Vector3 vector = this.cameraComponent.WorldToViewportPoint(entity.XZPosition);

            flag = ((vector.z > 0f) && Miscs.IsFloatInRange(vector.x, 0f, 1f)) && Miscs.IsFloatInRange(vector.y, 0f, 1f);
            this.cameraComponent.fieldOfView   = fieldOfView;
            this.cameraComponent.nearClipPlane = nearClipPlane;
            this.cameraComponent.farClipPlane  = farClipPlane;
            return(flag);
        }
Example #23
0
        private void OnScrollChange(Transform trans, int index)
        {
            RewardUIData data      = this._mailData.attachment.itemList[index];
            Image        component = trans.Find("ItemIcon").GetComponent <Image>();
            Image        image2    = trans.Find("ItemIcon/Icon").GetComponent <Image>();

            component.gameObject.SetActive(true);
            trans.Find("SelectedMark").gameObject.SetActive(false);
            trans.Find("ProtectedMark").gameObject.SetActive(false);
            trans.Find("InteractiveMask").gameObject.SetActive(false);
            trans.Find("NotEnough").gameObject.SetActive(false);
            trans.Find("Star").gameObject.SetActive(false);
            trans.Find("StigmataType").gameObject.SetActive(false);
            trans.Find("UnidentifyText").gameObject.SetActive(false);
            trans.Find("QuestionMark").gameObject.SetActive(false);
            trans.Find("ItemIcon").GetComponent <Image>().color  = Color.white;
            trans.Find("ItemIcon").GetComponent <Image>().sprite = Miscs.GetSpriteByPrefab(MiscData.Config.ItemRarityBGImgPath[0]);
            if (data.rewardType == ResourceType.Item)
            {
                StorageDataItemBase dummyStorageDataItem = Singleton <StorageModule> .Instance.GetDummyStorageDataItem(data.itemID, data.level);

                dummyStorageDataItem.number = data.value;
                MonoItemIconButton button = trans.GetComponent <MonoItemIconButton>();
                button.SetupView(dummyStorageDataItem, MonoItemIconButton.SelectMode.None, false, false, false);
                button.SetClickCallback(new MonoItemIconButton.ClickCallBack(this.OnItemClick));
            }
            else
            {
                image2.sprite = data.GetIconSprite();
                trans.Find("Text").GetComponent <Text>().text = "\x00d7" + data.value;
            }
        }
Example #24
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);
                        }
                    }
                }
            }
        }
Example #25
0
 public override void Core()
 {
     if (this._blackHoleTimer.isActive)
     {
         this._blackHoleTimer.Core(1f);
         if (this._blackHoleTimer.isTimeUp)
         {
             this.KillBlackHole(true);
         }
         else
         {
             for (int i = 0; i < this._insideActors.Count; i++)
             {
                 BaseAbilityActor targetActor = this._insideActors[i];
                 if ((targetActor != null) && targetActor.IsActive())
                 {
                     if ((this._pullVelocity > 0f) && (Miscs.DistancForVec3IgnoreY(targetActor.entity.XZPosition, this._fieldActor.triggerField.transform.position) < 0.3f))
                     {
                         this.RemoveAdditiveVelocity(targetActor);
                     }
                     else
                     {
                         Vector3 additiveVelocity = this._fieldActor.triggerField.transform.position - targetActor.entity.XZPosition;
                         additiveVelocity.y = 0f;
                         additiveVelocity.Normalize();
                         this.SetAdditiveVelocity(targetActor, additiveVelocity);
                     }
                 }
             }
         }
     }
 }
Example #26
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);
            }
        }
Example #27
0
 public void CheckSVNVersion()
 {
     if (GlobalVars.DataUseAssetBundle && (TimeUtil.Now >= this.Loader.checkSVNVersionDate.AddSeconds((double)MiscData.Config.BasicConfig.CheckAssetBoundleIntervalSecond)))
     {
         Singleton <ApplicationManager> .Instance.StartCoroutine(Miscs.WWWRequestWithRetry(this.GetAssetBoundleStatusFilePath(), new Action <string>(this.GetAssetBoundleStatusCallBack), null, 5f, 3, null, null));
     }
 }
Example #28
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;
            }
        }
Example #29
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);
        }
Example #30
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);
            }
        }