コード例 #1
0
ファイル: ArenaWindow.cs プロジェクト: zunaalabaya/TAC-BOT
        private void RefreshEnemyList()
        {
            if (Object.op_Equality((Object)this.EnemyPlayerList, (Object)null) || Object.op_Equality((Object)this.EnemyPlayerItem, (Object)null))
            {
                return;
            }
            this.EnemyPlayerList.ClearItems();
            ArenaPlayer[] arenaPlayers = MonoSingleton <GameManager> .Instance.ArenaPlayers;
            Transform     transform    = ((Component)this.EnemyPlayerList).get_transform();

            for (int index = 0; index < arenaPlayers.Length; ++index)
            {
                ListItemEvents listItemEvents = (ListItemEvents)Object.Instantiate <ListItemEvents>((M0)this.EnemyPlayerItem);
                DataSource.Bind <ArenaPlayer>(((Component)listItemEvents).get_gameObject(), arenaPlayers[index]);
                listItemEvents.OnSelect     = new ListItemEvents.ListItemEvent(this.OnEnemySelect);
                listItemEvents.OnOpenDetail = new ListItemEvents.ListItemEvent(this.OnEnemyDetailSelect);
                this.EnemyPlayerList.AddItem(listItemEvents);
                ((Component)listItemEvents).get_transform().SetParent(transform, false);
                ((Component)listItemEvents).get_gameObject().SetActive(true);
                AssetManager.PrepareAssets(AssetPath.UnitSkinImage(arenaPlayers[index].Unit[0].UnitParam, arenaPlayers[index].Unit[0].GetSelectedSkin(-1), arenaPlayers[index].Unit[0].CurrentJobId));
            }
            if (AssetDownloader.isDone)
            {
                return;
            }
            AssetDownloader.StartDownload(false, true, ThreadPriority.Normal);
        }
コード例 #2
0
ファイル: ArenaWindow.cs プロジェクト: zunaalabaya/TAC-BOT
        private void RefreshEnemyList()
        {
            if (UnityEngine.Object.op_Equality((UnityEngine.Object) this.EnemyPlayerList, (UnityEngine.Object)null) || UnityEngine.Object.op_Equality((UnityEngine.Object) this.EnemyPlayerItem, (UnityEngine.Object)null))
            {
                return;
            }
            this.EnemyPlayerList.ClearItems();
            ArenaPlayer[] arenaPlayers = MonoSingleton <GameManager> .Instance.ArenaPlayers;
            Transform     transform    = ((Component)this.EnemyPlayerList).get_transform();

            for (int index = 0; index < arenaPlayers.Length; ++index)
            {
                ListItemEvents listItemEvents = (ListItemEvents)UnityEngine.Object.Instantiate <ListItemEvents>((M0)this.EnemyPlayerItem);
                DataSource.Bind <ArenaPlayer>(((Component)listItemEvents).get_gameObject(), arenaPlayers[index]);
                listItemEvents.OnSelect     = new ListItemEvents.ListItemEvent(this.OnEnemySelect);
                listItemEvents.OnOpenDetail = new ListItemEvents.ListItemEvent(this.OnEnemyDetailSelect);
                this.EnemyPlayerList.AddItem(listItemEvents);
                ((Component)listItemEvents).get_transform().SetParent(transform, false);
                ((Component)listItemEvents).get_gameObject().SetActive(true);
                AssetManager.PrepareAssets(AssetPath.UnitSkinImage(arenaPlayers[index].Unit[0].UnitParam, arenaPlayers[index].Unit[0].GetSelectedSkin(-1), arenaPlayers[index].Unit[0].CurrentJobId));
            }
            if (!AssetDownloader.isDone)
            {
                AssetDownloader.StartDownload(false, true, ThreadPriority.Normal);
            }
            if (!UnityEngine.Object.op_Implicit((UnityEngine.Object) this.GoMapInfo))
            {
                return;
            }
            GameManager instance = MonoSingleton <GameManager> .Instance;
            PlayerData  player   = instance.Player;

            if (!UnityEngine.Object.op_Implicit((UnityEngine.Object)instance) || player == null)
            {
                return;
            }
            DataSource component = (DataSource)this.GoMapInfo.GetComponent <DataSource>();

            if (UnityEngine.Object.op_Implicit((UnityEngine.Object)component))
            {
                component.Clear();
            }
            DataSource.Bind <QuestParam>(this.GoMapInfo, instance.FindQuest(GlobalVars.SelectedQuestID));
            GameParameter.UpdateAll(this.GoMapInfo);
            this.mIsUpdateMapInfoEndAt = this.RefreshMapInfoEndAt();
        }
コード例 #3
0
 public override void Update(HomeWindow self)
 {
     if (this.state == 0)
     {
         self.mFadingOut = true;
         FlowNode_GameObject.ActivateOutputLinks((Component)self, 11);
         this.state = 1;
     }
     if (this.state == 1)
     {
         if (!AssetDownloader.isDone)
         {
             return;
         }
         if (AssetManager.IsAssetBundle(self.mDesiredSceneName))
         {
             AssetManager.PrepareAssets(self.mDesiredSceneName);
             if (!AssetDownloader.isDone)
             {
                 ProgressWindow.OpenGenericDownloadWindow();
                 AssetDownloader.StartDownload(false, true, ThreadPriority.Normal);
                 this.state = 2;
                 return;
             }
         }
         this.state = 3;
     }
     if (this.state == 2)
     {
         if (!AssetDownloader.isDone)
         {
             return;
         }
         ProgressWindow.Close();
         this.state = 3;
     }
     if (this.state == 3)
     {
         self.mLastSceneName = self.mDesiredSceneName;
         this.req            = AssetManager.LoadSceneAsync(self.mDesiredSceneName, true);
         this.state          = 4;
     }
     if (this.state == 4)
     {
         if (!this.req.canBeActivated || self.mFadingOut || MonoSingleton <GameManager> .Instance.IsImportantJobRunning)
         {
             return;
         }
         if (!string.IsNullOrEmpty(self.UnloadTrigger))
         {
             GlobalEvent.Invoke(self.UnloadTrigger, (object)this);
         }
         SceneAwakeObserver.AddListener(new SceneAwakeObserver.SceneEvent(this.OnSceneAwake));
         this.req.ActivateScene();
         if (!string.IsNullOrEmpty(self.mLastSceneName))
         {
             AssetManager.UnloadScene(self.mLastSceneName);
         }
         this.state = 5;
     }
     if (this.state == 5)
     {
         if (Object.op_Equality((Object)this.mNewScene, (Object)null) || !this.req.isDone)
         {
             return;
         }
         CriticalSection.Leave(CriticalSections.SceneChange);
         this.state = 6;
     }
     if (this.state == 6)
     {
         if (CriticalSection.IsActive)
         {
             return;
         }
         GC.Collect();
         this.asyncOp = AssetManager.UnloadUnusedAssets();
         this.state   = (MonoSingleton <GameManager> .Instance.Player.TutorialFlags & 1L) != 0L ? 7 : 101;
     }
     if (this.state == 7)
     {
         if (this.asyncOp != null && !this.asyncOp.get_isDone())
         {
             return;
         }
         FlowNode_GameObject.ActivateOutputLinks((Component)self, 10);
         GameUtility.FadeIn(0.5f);
         self.mDesirdSceneSet = false;
         if (!self.mIgnorePopups && !self.mNewsShown && !GlobalVars.IsTitleStart.Get() && (MonoSingleton <GameManager> .Instance.Player.IsFirstLogin || GameUtility.isLoginInfoDisplay()))
         {
             self.mNewsShown = true;
             GlobalVars.IsTitleStart.Set(true);
             self.mStateMachine.GotoState <HomeWindow.State_LoginBonus>();
         }
         else
         {
             self.NotifyNewFriendRequests();
             if (HomeWindow.EnterHomeCount == 0)
             {
                 self.CheckTrophies();
             }
             if (!self.mNewsShown && !GlobalVars.IsTitleStart.Get() && (MonoSingleton <GameManager> .Instance.Player.IsFirstLogin || self.DebugLoginBonus))
             {
                 self.mNewsShown = true;
                 Json_LoginBonus recentLoginBonus = MonoSingleton <GameManager> .Instance.Player.RecentLoginBonus;
                 if (recentLoginBonus != null)
                 {
                     string iname;
                     int    num;
                     if (recentLoginBonus.coin > 0)
                     {
                         iname = "$COIN";
                         num   = recentLoginBonus.coin;
                     }
                     else
                     {
                         iname = recentLoginBonus.iname;
                         num   = recentLoginBonus.num;
                     }
                     ItemData data = new ItemData();
                     if (data.Setup(0L, iname, num))
                     {
                         NotifyList.PushLoginBonus(data);
                     }
                 }
                 self.NotifySupportResult();
             }
             self.mStateMachine.GotoState <HomeWindow.State_Default>();
         }
         if (self.mDesiredSceneIsHome)
         {
             self.UnlockContents();
             self.FgGIDLoginCheck();
             FlowNode_GameObject.ActivateOutputLinks((Component)self, 15);
         }
         else
         {
             FlowNode_GameObject.ActivateOutputLinks((Component)self, 16);
         }
     }
     if (this.state != 101)
     {
         return;
     }
     DebugUtility.LogWarning("TUTORIAL: HERE");
     FlowNode_GameObject.ActivateOutputLinks((Component)self, 16);
     FlowNode_GameObject.ActivateOutputLinks((Component)self, 10);
     GameUtility.FadeIn(0.5f);
     self.mDesirdSceneSet = false;
     self.mStateMachine.GotoState <HomeWindow.State_Tutorial>();
 }
コード例 #4
0
ファイル: HomeWindow.cs プロジェクト: zunaalabaya/TAC-BOT
 public override void Update(HomeWindow self)
 {
     if (this.state == 0)
     {
         self.mFadingOut = true;
         FlowNode_GameObject.ActivateOutputLinks((Component)self, 11);
         this.state = 1;
     }
     if (this.state == 1)
     {
         if (!AssetDownloader.isDone)
         {
             return;
         }
         if (AssetManager.IsAssetBundle(self.mDesiredSceneName))
         {
             AssetManager.PrepareAssets(self.mDesiredSceneName);
             if (self.mDesiredSceneIsHome)
             {
                 foreach (string resourcePath in FlowNode_PlayBGM.GetHomeBGM())
                 {
                     AssetManager.PrepareAssets(resourcePath);
                 }
             }
             if (!AssetDownloader.isDone)
             {
                 ProgressWindow.OpenGenericDownloadWindow();
                 AssetDownloader.StartDownload(false, true, ThreadPriority.Normal);
                 this.state = 2;
                 return;
             }
         }
         this.state = 3;
     }
     if (this.state == 2)
     {
         if (!AssetDownloader.isDone)
         {
             return;
         }
         ProgressWindow.Close();
         this.state = 3;
     }
     if (this.state == 3)
     {
         if (self.mDesiredSceneIsHome)
         {
             FlowNode_PlayBGM.PlayHomeBGM();
         }
         self.mLastSceneName = self.mDesiredSceneName;
         this.req            = AssetManager.LoadSceneAsync(self.mDesiredSceneName, true);
         this.state          = 4;
     }
     if (this.state == 4)
     {
         if (!this.req.canBeActivated || self.mFadingOut || MonoSingleton <GameManager> .Instance.IsImportantJobRunning)
         {
             return;
         }
         if (!string.IsNullOrEmpty(self.UnloadTrigger))
         {
             GlobalEvent.Invoke(self.UnloadTrigger, (object)this);
         }
         SceneAwakeObserver.AddListener(new SceneAwakeObserver.SceneEvent(this.OnSceneAwake));
         this.req.ActivateScene();
         if (!string.IsNullOrEmpty(self.mLastSceneName))
         {
             AssetManager.UnloadScene(self.mLastSceneName);
         }
         this.state = 5;
     }
     if (this.state == 5)
     {
         if (UnityEngine.Object.op_Equality((UnityEngine.Object) this.mNewScene, (UnityEngine.Object)null) || !this.req.isDone)
         {
             return;
         }
         CriticalSection.Leave(CriticalSections.SceneChange);
         this.state = 6;
     }
     if (this.state == 6)
     {
         if (CriticalSection.IsActive)
         {
             return;
         }
         this.asyncOp = AssetManager.UnloadUnusedAssets();
         this.state   = 7;
     }
     if (this.state != 7 || this.asyncOp != null && !this.asyncOp.get_isDone())
     {
         return;
     }
     FlowNode_GameObject.ActivateOutputLinks((Component)self, 10);
     GameUtility.FadeIn(0.5f);
     self.mDesirdSceneSet = false;
     if (!self.mIgnorePopups && !self.mNewsShown && !GlobalVars.IsTitleStart.Get() && (MonoSingleton <GameManager> .Instance.Player.IsFirstLogin || GameUtility.isLoginInfoDisplay()))
     {
         self.mNewsShown = true;
         GlobalVars.IsTitleStart.Set(true);
         self.mStateMachine.GotoState <HomeWindow.State_LoginBonus>();
     }
     else if (!self.mIgnorePopups && !GlobalVars.IsTitleStart.Get() && !self.mBeginnerShown)
     {
         self.mBeginnerShown = true;
         self.mStateMachine.GotoState <HomeWindow.State_BeginnerNotify>();
     }
     else
     {
         self.MiscBeforeDefaultState();
         self.mStateMachine.GotoState <HomeWindow.State_Default>();
     }
     if (self.mDesiredSceneIsHome)
     {
         self.UnlockContents();
         self.FgGIDLoginCheck();
         FlowNode_GameObject.ActivateOutputLinks((Component)self, 15);
     }
     else
     {
         FlowNode_GameObject.ActivateOutputLinks((Component)self, 16);
     }
 }