Example #1
0
        private void RefreshUI()
        {
            QuestParam quest = MonoSingleton <GameManager> .Instance.FindQuest(GlobalVars.SelectedQuestID);

            this.mRecoverTime = MonoSingleton <GameManager> .Instance.TowerResuponse.rtime;
            if (quest != null && UnityEngine.Object.op_Inequality((UnityEngine.Object) this.ChallengeButton, (UnityEngine.Object)null))
            {
                DataSource.Bind <QuestParam>(((Component)this.ChallengeButton).get_gameObject(), quest);
                ((Selectable)this.ChallengeButton).set_interactable(quest.IsQuestCondition() && quest.state != QuestStates.Cleared);
                GameParameter.UpdateAll(((Component)this.ChallengeButton).get_gameObject());
            }
            if (UnityEngine.Object.op_Inequality((UnityEngine.Object) this.RecoverButton, (UnityEngine.Object)null))
            {
                TowerResuponse towerResuponse = MonoSingleton <GameManager> .Instance.TowerResuponse;
                bool           flag           = towerResuponse.GetAvailableUnits().Count > 0 && towerResuponse.ExistDamagedUnit() || towerResuponse.GetDiedUnitNum() > 0;
                ((Selectable)this.RecoverButton).set_interactable(flag && !towerResuponse.is_reset);
                if (UnityEngine.Object.op_Inequality((UnityEngine.Object) this.RecoverTimer, (UnityEngine.Object)null))
                {
                    this.RecoverTimer.SetActive(flag);
                }
            }
            if (UnityEngine.Object.op_Inequality((UnityEngine.Object) this.ResetButton, (UnityEngine.Object)null))
            {
                TowerResuponse towerResuponse = MonoSingleton <GameManager> .Instance.TowerResuponse;
                ((Component)this.ResetButton).get_gameObject().SetActive(towerResuponse.is_reset);
                ((Selectable)this.ResetButton).set_interactable(towerResuponse.is_reset);
                ((Component)this.ChallengeButton).get_gameObject().SetActive(!towerResuponse.is_reset);
                this.ResetText.set_text(towerResuponse.reset_cost.ToString());
                bool flag = (int)towerResuponse.reset_cost == 0;
                ((Component)this.ResetText).get_gameObject().SetActive(!flag);
                ((Component)this.ResetTextFree).get_gameObject().SetActive(flag);
            }
            this.SetAliveUnitsText();
            this.SetRecoverText();
        }
Example #2
0
        public override void OnActivate(int pinID)
        {
            MyPhoton pt = PunMonoSingleton <MyPhoton> .Instance;

            if (UnityEngine.Object.op_Inequality((UnityEngine.Object)pt, (UnityEngine.Object)null))
            {
                string roomParam = pt.GetRoomParam("started");
                if (roomParam != null)
                {
                    JSON_MyPhotonPlayerParam[] players = JSONParser.parseJSONObject <FlowNode_StartMultiPlay.PlayerList>(roomParam).players;
                    if (players.Length > 0)
                    {
                        JSON_MyPhotonPlayerParam photonPlayerParam = this.Type != FlowNode_BindMultiUnit.TargetType.Player ? Array.Find <JSON_MyPhotonPlayerParam>(players, (Predicate <JSON_MyPhotonPlayerParam>)(p => p.playerID != pt.GetMyPlayer().playerID)) : Array.Find <JSON_MyPhotonPlayerParam>(players, (Predicate <JSON_MyPhotonPlayerParam>)(p => p.playerID == pt.GetMyPlayer().playerID));
                        if (photonPlayerParam != null)
                        {
                            PartyData partyOfType = MonoSingleton <GameManager> .Instance.Player.FindPartyOfType(PlayerPartyTypes.RankMatch);

                            for (int index = 0; index < this.Targets.Length && index < photonPlayerParam.units.Length && (GlobalVars.SelectedMultiPlayRoomType != JSON_MyPhotonRoomParam.EType.RANKMATCH || partyOfType == null || index < partyOfType.VSWAITMEMBER_START); ++index)
                            {
                                photonPlayerParam.units[index].unit = new UnitData();
                                photonPlayerParam.units[index].unit.Deserialize(photonPlayerParam.units[index].unitJson);
                                DataSource.Bind <UnitData>(this.Targets[index], photonPlayerParam.units[index].unit);
                                GameParameter.UpdateAll(this.Targets[index]);
                                if (UnityEngine.Object.op_Inequality((UnityEngine.Object) this.Image, (UnityEngine.Object)null) && index == 0)
                                {
                                    DataSource.Bind <UnitData>(this.Image, photonPlayerParam.units[index].unit);
                                    GameParameter.UpdateAll(this.Image);
                                }
                            }
                        }
                    }
                }
            }
            this.ActivateOutputLinks(2);
        }
Example #3
0
        private void RefreshData()
        {
            GameManager instance = MonoSingleton <GameManager> .Instance;

            if (Object.op_Inequality((Object)this.MapInfo, (Object)null))
            {
                QuestParam quest = instance.FindQuest(GlobalVars.SelectedQuestID);
                if (quest != null)
                {
                    DataSource.Bind <QuestParam>(this.MapInfo, quest);
                    GameParameter.UpdateAll(this.MapInfo);
                }
            }
            if (!Object.op_Inequality((Object)this.PartyInfo, (Object)null))
            {
                return;
            }
            GlobalVars.SelectedPartyIndex.Set(7);
            PartyData party = instance.Player.Partys[(int)GlobalVars.SelectedPartyIndex];

            if (party == null)
            {
                return;
            }
            DataSource.Bind <PartyData>(this.PartyInfo, party);
            GameParameter.UpdateAll(this.PartyInfo);
        }
Example #4
0
        public override void OnSuccess(WWWResult www)
        {
            if (TowerErrorHandle.Error((FlowNode_Network)this))
            {
                return;
            }
            TowerResuponse towerResuponse = MonoSingleton <GameManager> .Instance.TowerResuponse;

            WebAPI.JSON_BodyResponse <FlowNode_ReqTowerReset.Json_ReqTowerReset> jsonObject = JSONParser.parseJSONObject <WebAPI.JSON_BodyResponse <FlowNode_ReqTowerReset.Json_ReqTowerReset> >(www.text);
            DebugUtility.Assert(jsonObject != null, "res == null");
            Network.RemoveAPI();
            this.rtime = jsonObject.body.rtime;
            Json_PlayerData json = new Json_PlayerData();

            json.coin      = new Json_Coin();
            json.coin.free = jsonObject.body.coin.free;
            json.coin.paid = jsonObject.body.coin.paid;
            json.coin.com  = jsonObject.body.coin.com;
            this.round     = jsonObject.body.round;
            if (jsonObject.body.rank != null)
            {
                towerResuponse.speedRank = jsonObject.body.rank.spd_rank;
                towerResuponse.techRank  = jsonObject.body.rank.tec_rank;
                towerResuponse.spd_score = jsonObject.body.rank.spd_score;
                towerResuponse.tec_score = jsonObject.body.rank.tec_score;
                towerResuponse.ret_score = jsonObject.body.rank.ret_score;
                towerResuponse.rcv_score = jsonObject.body.rank.rcv_score;
            }
            MonoSingleton <GameManager> .Instance.Player.Deserialize(json, PlayerData.EDeserializeFlags.Coin);

            GameParameter.UpdateValuesOfType(GameParameter.ParameterTypes.GLOBAL_PLAYER_COIN);
            GlobalVars.SelectedQuestID = MonoSingleton <GameManager> .Instance.FindFirstTowerFloor(MonoSingleton <GameManager> .Instance.TowerResuponse.TowerID).iname;

            this.Success();
        }
Example #5
0
 public void UnitSelect(long uniqueID)
 {
     DataSource.Bind <UnitData>(this.Parent, MonoSingleton <GameManager> .Instance.Player.FindUnitDataByUniqueID(uniqueID));
     this.SelectedUniqueId = uniqueID;
     FlowNode_GameObject.ActivateOutputLinks((Component)this, 1);
     GameParameter.UpdateAll(this.Parent);
 }
Example #6
0
        private void Start()
        {
            JobParam data1 = (JobParam)null;
            JobParam data2 = (JobParam)null;

            if (string.IsNullOrEmpty(this.PrevJobID) && string.IsNullOrEmpty(this.NextJobID))
            {
                UnitData unitDataByUniqueId = MonoSingleton <GameManager> .Instance.Player.FindUnitDataByUniqueID((long)GlobalVars.SelectedUnitUniqueID);

                if (unitDataByUniqueId == null)
                {
                    return;
                }
                JobData jobData = (JobData)null;
                for (int index = 0; index < unitDataByUniqueId.Jobs.Length; ++index)
                {
                    if (unitDataByUniqueId.Jobs[index] != null && unitDataByUniqueId.Jobs[index].UniqueID == (long)GlobalVars.SelectedJobUniqueID)
                    {
                        jobData = unitDataByUniqueId.Jobs[index];
                    }
                }
                if (jobData == null)
                {
                    return;
                }
                JobData baseJob = unitDataByUniqueId.GetBaseJob(jobData.JobID);
                if (baseJob != null)
                {
                    data1 = baseJob.Param;
                }
                data2 = jobData.Param;
            }
            if (!string.IsNullOrEmpty(this.PrevJobID))
            {
                data1 = MonoSingleton <GameManager> .Instance.MasterParam.GetJobParam(this.PrevJobID);
            }
            if (!string.IsNullOrEmpty(this.NextJobID))
            {
                data2 = MonoSingleton <GameManager> .Instance.MasterParam.GetJobParam(this.NextJobID);
            }
            if (UnityEngine.Object.op_Inequality((UnityEngine.Object) this.NextJob, (UnityEngine.Object)null))
            {
                DataSource.Bind <JobParam>(this.NextJob, data2);
                GameParameter.UpdateAll(this.NextJob);
            }
            if (UnityEngine.Object.op_Inequality((UnityEngine.Object) this.PrevJob, (UnityEngine.Object)null))
            {
                DataSource.Bind <JobParam>(this.PrevJob, data1);
                GameParameter.UpdateAll(this.PrevJob);
            }
            if (UnityEngine.Object.op_Inequality((UnityEngine.Object) this.NewRank, (UnityEngine.Object)null))
            {
                this.NewRank.set_text(this.NextJobRank.ToString());
            }
            if (!UnityEngine.Object.op_Inequality((UnityEngine.Object) this.OldRank, (UnityEngine.Object)null))
            {
                return;
            }
            this.OldRank.set_text(this.CurrentJobRank.ToString());
        }
        public void Refresh(Dictionary <string, int> dict)
        {
            if (dict == null || dict.Count < 0)
            {
                return;
            }
            GameManager instance = MonoSingleton <GameManager> .Instance;

            using (Dictionary <string, int> .KeyCollection.Enumerator enumerator = dict.Keys.GetEnumerator())
            {
                while (enumerator.MoveNext())
                {
                    string    current   = enumerator.Current;
                    ItemParam itemParam = instance.MasterParam.GetItemParam(current);
                    if (itemParam != null && dict[current] > 0)
                    {
                        ItemData data = new ItemData();
                        data.Setup(0L, itemParam, dict[current]);
                        GameObject gameObject = (GameObject)Object.Instantiate <GameObject>((M0)this.ItemTemplate);
                        gameObject.get_transform().SetParent((Transform)this.ItemLayoutParent, false);
                        DataSource.Bind <ItemData>(gameObject, data);
                        this.mExpItems.Add(gameObject);
                        gameObject.SetActive(true);
                    }
                }
            }
            GameParameter.UpdateAll(((Component)this).get_gameObject());
        }
Example #8
0
        public override void OnSuccess(WWWResult www)
        {
            if (Network.IsError)
            {
                Network.EErrCode errCode = Network.ErrCode;
                this.OnRetry();
            }
            else
            {
                WebAPI.JSON_BodyResponse <Json_PlayerDataAll> jsonObject = JSONParser.parseJSONObject <WebAPI.JSON_BodyResponse <Json_PlayerDataAll> >(www.text);
                DebugUtility.Assert(jsonObject != null, "res == null");
                Network.RemoveAPI();
                try
                {
                    MonoSingleton <GameManager> .Instance.Deserialize(jsonObject.body.player);

                    MonoSingleton <GameManager> .Instance.Deserialize(jsonObject.body.units);

                    MonoSingleton <GameManager> .Instance.Deserialize(jsonObject.body.items);
                }
                catch (Exception ex)
                {
                    DebugUtility.LogException(ex);
                    return;
                }
                GameParameter.UpdateValuesOfType(GameParameter.ParameterTypes.GLOBAL_PLAYER_GOLD);
                ((Behaviour)this).set_enabled(false);
            }
        }
 private void GenerateList(int page = 0)
 {
     this.mUnitList.ForEach((Action <GameObject>)(go => UnityEngine.Object.Destroy((UnityEngine.Object)go)));
     this.mUnitList.Clear();
     for (int index1 = 0; index1 < 28; ++index1)
     {
         UnitData data   = (UnitData)null;
         int      index2 = index1 + page * 28;
         if (index2 < this.mDraftUnitListCache.Count)
         {
             Json_Unit jsonUnit = this.mDraftUnitListCache[index2].GetJson_Unit();
             if (jsonUnit != null)
             {
                 data = new UnitData();
                 data.Deserialize(jsonUnit);
             }
         }
         GameObject root = (GameObject)UnityEngine.Object.Instantiate <GameObject>((M0)this.mGOUnitItem);
         DataSource.Bind <UnitData>(root, data);
         GameParameter.UpdateAll(root);
         root.get_transform().SetParent(this.mUnitParentTransform, false);
         root.SetActive(true);
         this.mUnitList.Add(root);
     }
     this.mPageNowTxt.set_text((this.mPage + 1).ToString());
     if (this.mPage - 1 < 0)
     {
         FlowNode_GameObject.ActivateOutputLinks((Component)this, 21);
     }
     if (this.mPage + 1 < this.mPageMax)
     {
         return;
     }
     FlowNode_GameObject.ActivateOutputLinks((Component)this, 22);
 }
Example #10
0
 public void Refresh(long[] uniqs)
 {
     if (this.m_SupportUnits == null)
     {
         DebugUtility.LogError("m_SupportUnitsがnullです。");
     }
     else if (uniqs == null)
     {
         DebugUtility.LogError("unitsがnullです。");
     }
     else if (this.m_SupportUnits.Length < Enum.GetValues(typeof(EElement)).Length)
     {
         DebugUtility.LogError("m_SupportUnitsの数が足りません。Inspectorからの設定を確認してください。");
     }
     else if (uniqs.Length < this.m_SupportUnits.Length)
     {
         DebugUtility.LogError("unitsの数が足りません。");
     }
     else
     {
         for (int element = 0; element < uniqs.Length; ++element)
         {
             this.Refresh(element, MonoSingleton <GameManager> .Instance.Player.FindUnitDataByUniqueID(uniqs[element]));
         }
         GameParameter.UpdateAll(((Component)this).get_gameObject());
     }
 }
Example #11
0
        public override string Speak()
        {
            Dialog        phrase    = CurrentDialog;
            String        teamName  = phrase.GetPropertyValue("Team");
            GameParameter parameter = (GameParameter)Enum.Parse(typeof(GameParameter), phrase.GetPropertyValue("Parameter"));

            IFootballSensor sensor = ConfigManager.FindAllComponentsOfType <IFootballSensor>().FirstOrDefault(s => s.Teams.Any(t => t.Key.Equals(teamName)));

            base.Speak();
            ConversationIsOver = true;

            if (sensor == null)
            {
                return(String.Empty);
            }

            switch (parameter)
            {
            case GameParameter.Score:
                return(RespondToGameScore(sensor, sensor.Teams.Single(t => t.Key.Equals(teamName))));

            default:
                return(String.Empty);
            }
        }
Example #12
0
 private void InventoryChanged()
 {
     GameParameter.UpdateValuesOfType(GameParameter.ParameterTypes.INVENTORY_ITEMICON);
     GameParameter.UpdateValuesOfType(GameParameter.ParameterTypes.INVENTORY_ITEMNAME);
     GameParameter.UpdateValuesOfType(GameParameter.ParameterTypes.INVENTORY_ITEMAMOUNT);
     GameParameter.UpdateValuesOfType(GameParameter.ParameterTypes.INVENTORY_FRAME);
 }
        public static bool TryReadByteParameter(Hashtable hashtable, GameParameter paramter, out byte? result, out object value)
        {
            result = null;

            if (!TryReadGameParameter(hashtable, paramter, out value))
            {
                return true;
            }

            if (value is byte)
            {
                result = (byte)value;
                return true;
            }

            if (value is int)
            {
                result = (byte)(int)value;
                hashtable[(byte)paramter] = result;
                return true;
            }

            if (value is double)
            {
                result = (byte)(double)value;
                hashtable[(byte)paramter] = result;
                return true;
            }

            return false;
        }
Example #14
0
 public void AnnounceUpdate(GameParameter param)
 {
     if (GameParameterUpdateCheck != null)
     {
         GameParameterUpdateCheck(param);
     }
 }
Example #15
0
    public float TryModifyParameter(GameParameter gameParameter, float value)
    {
        ChangingParameter changingParameter = null;

        try
        {
            changingParameter = changingParameters.Single(s => s.gameParameter == gameParameter);
        }
        catch (System.InvalidOperationException)
        {
        }

        if (changingParameter != null)
        {
            Debug.Log("Нашел параметр в предмете " + changingParameter.gameParameter);
            if (changingParameter.useAsPercent)
            {
                return(value *= changingParameter.value);
            }
            else
            {
                return(value += changingParameter.value);
            }
        }
        else
        {
            return(value);
        }
    }
Example #16
0
        private void UpdateCostData()
        {
            if (UnityEngine.Object.op_Equality((UnityEngine.Object) this.m_root.GetComponent <Button>(), (UnityEngine.Object)null))
            {
                return;
            }
            this.m_default.SetActive(false);
            this.m_ticket.SetActive(false);
            GachaRequestParam dataOfClass = DataSource.FindDataOfClass <GachaRequestParam>(this.m_root, (GachaRequestParam)null);

            if (dataOfClass == null)
            {
                return;
            }
            if (dataOfClass.IsTicketGacha)
            {
                ItemData itemDataByItemId = MonoSingleton <GameManager> .Instance.Player.FindItemDataByItemID(dataOfClass.Ticket);

                if (itemDataByItemId == null)
                {
                    return;
                }
                DataSource.Bind <ItemData>(this.m_ticket, itemDataByItemId);
                this.m_ticket.SetActive(true);
                GameParameter.UpdateAll(this.m_ticket);
            }
            else
            {
                ((ImageArray)this.m_default_bg.GetComponent <ImageArray>()).ImageIndex = !dataOfClass.IsGold ? 1 : 0;
                this.RefreshCostNum(this.m_default_bg, dataOfClass.Cost);
                this.m_default.SetActive(true);
            }
        }
Example #17
0
        internal void UpdateUI()
        {
            UnitData dataOfClass = DataSource.FindDataOfClass <UnitData>(((Component)this).get_gameObject(), (UnitData)null);

            if (dataOfClass == null)
            {
                return;
            }
            GameParameter.UpdateAll(((Component)this).get_gameObject());
            JobData jobData = dataOfClass.GetJobData(0);

            this.mRenkeiText.set_text(dataOfClass.GetCombination().ToString());
            if (jobData != null)
            {
                this.mMoveText.set_text(jobData.Param.mov.ToString());
                this.mJumpText.set_text(jobData.Param.jmp.ToString());
            }
            this.RefreshAbilitList();
            this.RefreshLeaderSkillInfo();
            this.ReloadPreviewModels();
            if (jobData != null)
            {
                for (int index = 0; index < this.mPreviewControllers.Count; ++index)
                {
                    if (this.mPreviewControllers[index].UnitData != null)
                    {
                        this.mCurrentPreview.DefaultLayer = this.mPreviewControllers[index].UnitData.JobIndex != 0 ? GameUtility.LayerHidden : GameUtility.LayerCH1;
                    }
                }
            }
            this.FadeUnitImage(0.0f, 0.0f, 0.0f);
            this.StartCoroutine(this.RefreshUnitImage());
        }
Example #18
0
        private void Start()
        {
            UnitData data = !string.IsNullOrEmpty(this.DebugUnitID) ? MonoSingleton <GameManager> .Instance.Player.FindUnitDataByUnitID(this.DebugUnitID) : MonoSingleton <GameManager> .Instance.Player.FindUnitDataByUniqueID((long)GlobalVars.SelectedUnitUniqueID);

            string skinVoiceSheetName = data.GetUnitSkinVoiceSheetName(-1);
            string sheetName          = "VO_" + skinVoiceSheetName;
            string cueNamePrefix      = data.GetUnitSkinVoiceCueName(-1) + "_";

            this.mUnitVoice = new MySound.Voice(sheetName, skinVoiceSheetName, cueNamePrefix);
            this.PlayProfileVoice();
            DataSource.Bind <UnitData>(((Component)this).get_gameObject(), data);
            GameParameter.UpdateAll(((Component)this).get_gameObject());
            if (data == null)
            {
                return;
            }
            for (int index = 0; index < this.ProfileTexts.Length; ++index)
            {
                if (!Object.op_Equality((Object)this.ProfileTexts[index], (Object)null) && !string.IsNullOrEmpty(this.ProfileTexts[index].get_text()))
                {
                    StringBuilder stringBuilder = GameUtility.GetStringBuilder();
                    stringBuilder.Append("unit.");
                    stringBuilder.Append(data.UnitParam.iname);
                    stringBuilder.Append("_");
                    stringBuilder.Append(this.ProfileTexts[index].get_text());
                    this.ProfileTexts[index].set_text(LocalizedText.Get(stringBuilder.ToString()));
                }
            }
        }
Example #19
0
        private void RefreshDefenseParty()
        {
            PlayerData player      = MonoSingleton <GameManager> .Instance.Player;
            PartyData  partyOfType = player.FindPartyOfType(PlayerPartyTypes.ArenaDef);

            for (int index = 0; index < this.PartyUnitSlots.Length; ++index)
            {
                long     unitUniqueId = partyOfType.GetUnitUniqueID(index);
                UnitData unitData1    = player.FindUnitDataByUniqueID(unitUniqueId);
                if (unitData1 != null && unitData1.GetJobFor(PlayerPartyTypes.ArenaDef) != unitData1.CurrentJob)
                {
                    UnitData unitData2 = new UnitData();
                    unitData2.TempFlags |= UnitData.TemporaryFlags.TemporaryUnitData;
                    unitData2.Setup(unitData1);
                    unitData2.SetJob(PlayerPartyTypes.ArenaDef);
                    unitData1 = unitData2;
                }
                if (index == 0)
                {
                    DataSource.Bind <UnitData>(this.DefenseUnitLeader, unitData1);
                    GameParameter.UpdateAll(this.DefenseUnitLeader);
                }
                DataSource.Bind <UnitData>(this.DefenseUnitSlots[index], unitData1);
                GameParameter.UpdateAll(this.DefenseUnitSlots[index]);
            }
            if (!UnityEngine.Object.op_Inequality((UnityEngine.Object) this.DefensePartyInfo, (UnityEngine.Object)null))
            {
                return;
            }
            DataSource.Bind <PartyData>(this.DefensePartyInfo, partyOfType);
            GameParameter.UpdateAll(this.DefensePartyInfo);
        }
Example #20
0
        private void State_Setup()
        {
            GameObject gameObject = GameObjectID.FindGameObject("UI_TREASURE");

            if (UnityEngine.Object.op_Equality((UnityEngine.Object)gameObject, (UnityEngine.Object)null))
            {
                Debug.LogError((object)"UI_TREASUREが見つかりませんでした。");
            }
            else
            {
                this.m_TargetRect = gameObject.get_transform() as RectTransform;
            }
            DataSource.Bind <ItemParam>(((Component)this).get_gameObject(), this.m_DropItem.param);
            if ((bool)this.m_DropItem.is_secret)
            {
                ItemIcon component = (ItemIcon)((Component)this).get_gameObject().GetComponent <ItemIcon>();
                if (UnityEngine.Object.op_Inequality((UnityEngine.Object)component, (UnityEngine.Object)null))
                {
                    component.IsSecret = true;
                }
            }
            GameParameter.UpdateAll(((Component)this).get_gameObject());
            this.m_ItemIcon = (ItemIcon)((Component)this).get_gameObject().GetComponent <ItemIcon>();
            if (UnityEngine.Object.op_Inequality((UnityEngine.Object) this.m_ItemIcon, (UnityEngine.Object)null))
            {
                this.m_ItemIcon.Num.set_text(this.m_DropItem.num.ToString());
            }
            ((Component)this).get_transform().set_localScale(new Vector3(0.3f, 0.3f, 1f));
            ((Component)this).get_transform().set_position(new Vector3((float)((Component)this).get_transform().get_position().x, (float)(((Component)this).get_transform().get_position().y + 25.0), (float)((Component)this).get_transform().get_position().z));
            this.m_EndAnimator = (Animator)gameObject.GetComponent <Animator>();
            this.m_State       = DropItemEffect.State.OPEN;
        }
Example #21
0
        private void OnEnemySelect(GameObject go)
        {
            ArenaPlayer dataOfClass = DataSource.FindDataOfClass <ArenaPlayer>(go, (ArenaPlayer)null);

            if (dataOfClass == null || !AssetDownloader.isDone)
            {
                return;
            }
            PlayerData player = MonoSingleton <GameManager> .Instance.Player;

            if (player.ChallengeArenaNum <= 0)
            {
                UIUtility.NegativeSystemMessage((string)null, LocalizedText.Get("sys.ARENA_DAYLIMIT"), (UIUtility.DialogResultEvent)null, (GameObject)null, false, -1);
            }
            else if (player.GetNextChallengeArenaCoolDownSec() > 0L)
            {
                this.OnCooldownButtonClick();
            }
            else
            {
                GlobalVars.SelectedArenaPlayer.Set(dataOfClass);
                if (UnityEngine.Object.op_Inequality((UnityEngine.Object) this.VsEnemyPartyInfo, (UnityEngine.Object)null))
                {
                    DataSource.Bind <ArenaPlayer>(this.VsEnemyPartyInfo, dataOfClass);
                    GameParameter.UpdateAll(this.VsEnemyPartyInfo);
                }
                FlowNode_GameObject.ActivateOutputLinks((Component)this, 101);
                this.BattlePreWindow.SetActive(true);
            }
        }
Example #22
0
 protected override void HandleGameParameterUpdateCheck(GameParameter parameter)
 {
     if (parameter == listParameter)
     {
         throw new System.NotImplementedException();
     }
 }
        public void Refresh()
        {
            int num = this.mCurrentItemData.Num;

            this.mMaxNum             = num <= 10 ? num : 10;
            this.mSaveUseNum         = 1;
            this.gacham.UseTicketNum = this.mSaveUseNum;
            if (Object.op_Inequality((Object)this.WindowTitle, (Object)null))
            {
                this.WindowTitle.set_text(LocalizedText.Get("sys.GACHA_TICKET_SELECT_TITLE", new object[1]
                {
                    (object)this.mCurrentItemData.Param.name
                }));
            }
            if (Object.op_Inequality((Object)this.AmountTicket, (Object)null))
            {
                DataSource.Bind <ItemData>(this.AmountTicket, this.CurrentItemData);
            }
            if (Object.op_Inequality((Object)this.TicketNumSlider, (Object)null))
            {
                ((UnityEventBase)this.TicketNumSlider.get_onValueChanged()).RemoveAllListeners();
                this.TicketNumSlider.set_minValue(1f);
                this.TicketNumSlider.set_maxValue((float)this.mMaxNum);
                // ISSUE: method pointer
                ((UnityEvent <float>) this.TicketNumSlider.get_onValueChanged()).AddListener(new UnityAction <float>((object)this, __methodptr(OnUseNumChanged)));
                this.TicketNumSlider.set_value((float)this.mSaveUseNum);
            }
            this.UsedNum.text = this.mSaveUseNum.ToString();
            GameParameter.UpdateAll(this.AmountTicket);
        }
Example #24
0
        private void RefreshChapterTimer()
        {
            if (!UnityEngine.Object.op_Inequality((UnityEngine.Object) this.ChapterTimer, (UnityEngine.Object)null))
            {
                return;
            }
            bool flag = false;

            if (this.mCurrentChapter != null)
            {
                ChapterParam mCurrentChapter = this.mCurrentChapter;
                if (mCurrentChapter != null)
                {
                    DataSource.Bind <ChapterParam>(this.ChapterTimer, mCurrentChapter);
                    switch (mCurrentChapter.GetKeyQuestType())
                    {
                    case KeyQuestTypes.Timer:
                        flag = mCurrentChapter.key_end > 0L;
                        break;

                    case KeyQuestTypes.Count:
                        flag = false;
                        break;

                    default:
                        flag = mCurrentChapter.end > 0L;
                        break;
                    }
                }
            }
            this.ChapterTimer.SetActive(flag);
            GameParameter.UpdateAll(this.ChapterTimer);
        }
        public static bool TryReadIntParameter(Hashtable hashtable, GameParameter paramter, out int?result, out object value)
        {
            result = null;

            if (!TryReadGameParameter(hashtable, paramter, out value))
            {
                return(true);
            }

            if (value is byte)
            {
                result = (byte)value;
                hashtable[(byte)paramter] = result;
                return(true);
            }

            if (value is int)
            {
                result = (int)value;
                return(true);
            }

            if (value is double)
            {
                result = (int)(double)value;
                hashtable[(byte)paramter] = result;
                return(true);
            }

            return(false);
        }
Example #26
0
        private void OnEquipClick(SRPG_Button button)
        {
            if (!((Selectable)button).IsInteractable())
            {
                return;
            }
            if (this.OnEquip != null)
            {
                this.OnEquip();
            }
            else
            {
                UnitData unitDataByUniqueId = MonoSingleton <GameManager> .Instance.Player.FindUnitDataByUniqueID((long)GlobalVars.SelectedUnitUniqueID);

                if (unitDataByUniqueId == null)
                {
                    return;
                }
                int selectedEquipmentSlot = (int)GlobalVars.SelectedEquipmentSlot;
                if (!MonoSingleton <GameManager> .Instance.Player.SetUnitEquipment(unitDataByUniqueId, selectedEquipmentSlot))
                {
                    return;
                }
                GameParameter.UpdateAll(((Component)this).get_gameObject());
                int      selectedJobIndex    = this.GetSelectedJobIndex(unitDataByUniqueId);
                ItemData itemDataByItemParam = MonoSingleton <GameManager> .Instance.Player.FindItemDataByItemParam(unitDataByUniqueId.GetRankupEquipData(selectedJobIndex, selectedEquipmentSlot).ItemParam);

                GlobalVars.SelectedEquipUniqueID.Set(itemDataByItemParam.UniqueID);
                FlowNode_GameObject.ActivateOutputLinks((Component)this, 100);
            }
        }
Example #27
0
 public void Refresh(UnitData[] units)
 {
     if (this.m_SupportUnits == null)
     {
         DebugUtility.LogError("m_SupportUnitsがnullです。");
     }
     else if (units == null)
     {
         DebugUtility.LogError("unitsがnullです。");
     }
     else if (this.m_SupportUnits.Length < Enum.GetValues(typeof(EElement)).Length)
     {
         DebugUtility.LogError("m_SupportUnitsの数が足りません。Inspectorからの設定を確認してください。");
     }
     else if (units.Length < this.m_SupportUnits.Length)
     {
         DebugUtility.LogError("unitsの数が足りません。");
     }
     else
     {
         for (int element = 0; element < units.Length; ++element)
         {
             this.Refresh(element, units[element]);
         }
         GameParameter.UpdateAll(((Component)this).get_gameObject());
     }
 }
        private void CreateCardSkillBonus(ConceptCardEffectsParam[] effect_params, int lv, int lv_cap, int awake_count_cap, bool is_enable)
        {
            if (Object.op_Equality((Object)this.mParamTemplate, (Object)null))
            {
                return;
            }
            Transform     parent     = this.mParamTemplate.get_transform().get_parent();
            List <string> stringList = new List <string>();

            for (int index1 = 0; index1 < effect_params.Length; ++index1)
            {
                if (!string.IsNullOrEmpty(effect_params[index1].card_skill))
                {
                    SkillParam skillParam = MonoSingleton <GameManager> .Instance.MasterParam.GetSkillParam(effect_params[index1].card_skill);

                    if (skillParam != null && !string.IsNullOrEmpty(effect_params[index1].add_card_skill_buff_lvmax) && !stringList.Contains(skillParam.iname))
                    {
                        BaseStatus status       = new BaseStatus();
                        BaseStatus scale_status = new BaseStatus();
                        SkillData  skill        = new SkillData();
                        skill.Setup(skillParam.iname, lv, lv_cap, (MasterParam)null);
                        SkillData.GetPassiveBuffStatus(skill, (BuffEffect[])null, EElement.None, ref status, ref scale_status);
                        BaseStatus total_add   = new BaseStatus();
                        BaseStatus total_scale = new BaseStatus();
                        effect_params[index1].GetAddCardSkillBuffStatusLvMax(lv, lv_cap, awake_count_cap, ref total_add, ref total_scale);
                        string     str1 = !Object.op_Inequality((Object)this.mParamStatusList, (Object)null) ? string.Empty : ((Object)this.mParamStatusList).get_name();
                        string     str2 = !Object.op_Inequality((Object)this.mBonusStatusList, (Object)null) ? string.Empty : ((Object)this.mBonusStatusList).get_name();
                        GameObject root = (GameObject)Object.Instantiate <GameObject>((M0)this.mParamTemplate);
                        root.get_transform().SetParent(parent, false);
                        StatusList[] componentsInChildren = (StatusList[])root.GetComponentsInChildren <StatusList>();
                        for (int index2 = 0; index2 < componentsInChildren.Length; ++index2)
                        {
                            if (((Object)componentsInChildren[index2]).get_name().StartsWith(str1))
                            {
                                componentsInChildren[index2].SetValues_Restrict(status, scale_status, total_add, total_scale, false);
                            }
                            else if (((Object)componentsInChildren[index2]).get_name().StartsWith(str2))
                            {
                                componentsInChildren[index2].SetValues_Restrict(status, scale_status, total_add, total_scale, true);
                            }
                        }
                        if (Object.op_Inequality((Object)this.mAwakeIconImageArray, (Object)null))
                        {
                            this.mAwakeIconImageArray.ImageIndex = this.mAwakeIconImageArray.Images.Length - 1;
                        }
                        DataSource.Bind <SkillParam>(root, skillParam);
                        DataSource.Bind <bool>(((Component)this).get_gameObject(), is_enable);
                        GameParameter.UpdateAll(root);
                        stringList.Add(skillParam.iname);
                        ++this.mCreatedCount;
                    }
                }
            }
            if (Object.op_Inequality((Object)this.mAwakeIconBgArray, (Object)null))
            {
                this.mAwakeIconBgArray.ImageIndex = !is_enable ? 1 : 0;
            }
            this.mParamTemplate.SetActive(false);
        }
        private void SetEnemy(MultiTowerFloorParam param)
        {
            int index1 = 0;

            if (param.map == null)
            {
                return;
            }
            string src = AssetManager.LoadTextData(AssetPath.LocalMap(param.map[0].mapSetName));

            if (src == null)
            {
                return;
            }
            JSON_MapUnit jsonObject = JSONParser.parseJSONObject <JSON_MapUnit>(src);

            if (jsonObject == null || !Object.op_Inequality((Object)this.EnemyTemplate, (Object)null))
            {
                return;
            }
            for (int index2 = 0; index2 < jsonObject.enemy.Length; ++index2)
            {
                NPCSetting npcSetting = new NPCSetting(jsonObject.enemy[index2]);
                Unit       data       = new Unit();
                if (data != null && data.Setup((UnitData)null, (UnitSetting)npcSetting, (Unit.DropItem)null, (Unit.DropItem)null) && !data.IsGimmick)
                {
                    GameObject root;
                    if (index1 + 1 > this.mEnemyObject.Count)
                    {
                        root = (GameObject)Object.Instantiate <GameObject>((M0)this.EnemyTemplate);
                        if (!Object.op_Equality((Object)root, (Object)null))
                        {
                            this.mEnemyObject.Add(root);
                        }
                        else
                        {
                            continue;
                        }
                    }
                    else
                    {
                        root = this.mEnemyObject[index1];
                    }
                    DataSource.Bind <Unit>(root, data);
                    GameParameter.UpdateAll(root);
                    if (Object.op_Inequality((Object)this.EnemyRoot, (Object)null))
                    {
                        root.get_transform().SetParent(this.EnemyRoot.get_transform(), false);
                    }
                    root.SetActive(true);
                    ++index1;
                }
            }
            for (int index2 = index1; index2 < this.mEnemyObject.Count; ++index2)
            {
                this.mEnemyObject[index2].SetActive(false);
            }
            this.EnemyTemplate.SetActive(false);
        }
Example #30
0
        public void Refresh()
        {
            JSON_MyPhotonPlayerParam dataOfClass = DataSource.FindDataOfClass <JSON_MyPhotonPlayerParam>(((Component)this).get_gameObject(), (JSON_MyPhotonPlayerParam)null);

            if (dataOfClass != null)
            {
                if (Object.op_Inequality((Object)this.EmptyObj, (Object)null))
                {
                    this.EmptyObj.SetActive(false);
                }
                if (Object.op_Inequality((Object)this.ValidObj, (Object)null))
                {
                    this.ValidObj.SetActive(true);
                }
                if (Object.op_Inequality((Object)this.LeaderUnit, (Object)null) && dataOfClass.units != null)
                {
                    dataOfClass.SetupUnits();
                    DataSource.Bind <UnitData>(this.LeaderUnit, dataOfClass.units[0].unit);
                }
                if (Object.op_Inequality((Object)this.Name, (Object)null))
                {
                    this.Name.set_text(dataOfClass.playerName);
                }
                if (Object.op_Inequality((Object)this.Lv, (Object)null))
                {
                    this.Lv.set_text(dataOfClass.playerLevel.ToString());
                }
                if (Object.op_Inequality((Object)this.Total, (Object)null))
                {
                    this.Total.set_text(dataOfClass.totalAtk.ToString());
                }
                if (Object.op_Inequality((Object)this.ReadyObj, (Object)null))
                {
                    this.ReadyObj.SetActive(dataOfClass.state != 4);
                }
                if (Object.op_Inequality((Object)this.Award, (Object)null))
                {
                    this.Award.get_gameObject().SetActive(false);
                    this.Award.get_gameObject().SetActive(true);
                }
                GameParameter.UpdateAll(((Component)this).get_gameObject());
            }
            else
            {
                if (Object.op_Inequality((Object)this.EmptyObj, (Object)null))
                {
                    this.EmptyObj.SetActive(true);
                }
                if (Object.op_Inequality((Object)this.ValidObj, (Object)null))
                {
                    this.ValidObj.SetActive(false);
                }
                if (!Object.op_Inequality((Object)this.ReadyObj, (Object)null))
                {
                    return;
                }
                this.ReadyObj.SetActive(false);
            }
        }
 public void Activated(int pinID)
 {
     if (pinID != 1)
     {
         return;
     }
     GameParameter.UpdateAll(((Component)this).get_gameObject());
 }
 public void ForceUpdate(GameParameter parameter)
 {
     foreach(GameParameters gameParams in parameters.Values) {
         if(gameParams.ParameterList.Contains(parameter)) {
             gameParams.AnnounceUpdate(parameter);
         }
     }
 }
    public GameParameter AddParameter(GameParameter param) {
        parameters.Add(param.ParameterName, param);
        if(GameParameterCreated != null) {
			Debug.Log("Parameter created");
            GameParameterCreated(param);
        }
		return param;
    }
 protected override void HandleGameParameterUpdateCheck(GameParameter parameter)
 {
     if(boolParameter.Value) {
         on.isOn = true;
         off.isOn = false;
     } else {
         on.isOn = false;
         off.isOn = true;
     }
 }
 void SetupWidget(GameParameter parameter)
 {
     ParameterWidget widget = null;
     GameObject toAdd = RangeWidgetPrefab;
     if (parameter.GetType() == typeof(BoolParameter)) {
         toAdd = BoolWidgetPrefab;
     }
     if (parameter.GetType() == typeof(StringListParameter)) {
         toAdd = StringListPrefab;
     }
     widget = ((GameObject)Instantiate(toAdd)).GetComponent<ParameterWidget>();
     Widgets.Add(widget);
     widget.Setup(parameter);
     PositionWidget(widget);
 }
        public static bool TryReadBooleanParameter(Hashtable hashtable, GameParameter paramter, out bool? result, out object value)
        {
            result = null;

            if (!TryReadGameParameter(hashtable, paramter, out value))
            {
                return true;
            }

            if (value is bool)
            {
                result = (bool)value;
                return true;
            }

            return false;
        }
 protected override void HandleGameParameterUpdateCheck(GameParameter parameter)
 {
     if(parameter == listParameter) {
         throw new System.NotImplementedException ();
     }
 }
 private static string GetInvalidGamePropertyTypeMessage(GameParameter parameter, Type expectedType, object value)
 {
     return string.Format("Invalid type for property {0}. Expected type {1} but is {2}", parameter, expectedType, value == null ? "null" : value.GetType().ToString());
 }
        private static bool TryReadGameParameter(Hashtable hashtable, GameParameter paramter, out object result)
        {
            var byteKey = (byte)paramter;
            if (hashtable.ContainsKey(byteKey))
            {
                result = hashtable[byteKey];
                return true;
            }

            var intKey = (int)paramter;
            if (hashtable.ContainsKey(intKey))
            {
                result = hashtable[intKey];
                hashtable.Remove(intKey);
                hashtable[byteKey] = result;
                return true;
            }

            result = null;
            return false;
        }
 protected override void HandleGameParameterUpdateCheck(GameParameter parameter)
 {
     rangeSlider.value = rangeParameter.Value;
     valueField.text = rangeParameter.Value.ToString();
 }
	public void RegisterCategory(string categoryName, GameParameter param) {
		if(categories == null) {
			categories = new Dictionary<string, List<GameParameter>>();
		}
		if(categories.ContainsKey(categoryName) == false) {
			categories[categoryName] = new List<GameParameter>();
		}
		categories[categoryName].Add(param);
	}
	public void AnnounceUpdate(GameParameter param) {
		if(GameParameterUpdateCheck != null) {
			GameParameterUpdateCheck(param);
		}
	}