Exemplo n.º 1
0
            public override void Begin(WorldMapController self)
            {
                this.mTarget = self.mCurrentArea;
                RectTransform transform = ((Component)this.mTarget).get_transform() as RectTransform;
                float         num1      = (float)(1.0 / ((Transform)transform).get_localScale().x *self.mDefaultScale.x);
                float         num2      = (float)(1.0 / ((Transform)transform).get_localScale().y *self.mDefaultScale.y);

                this.mDesiredScale    = Vector2.op_Implicit(new Vector3(num1, num2));
                this.mTargetPosition  = transform.get_anchoredPosition();
                this.mDesiredPosition = Vector2.op_UnaryNegation(transform.get_anchoredPosition());
                // ISSUE: explicit reference operation
                // ISSUE: variable of a reference type
                Vector2& local1 = @this.mDesiredPosition;

                // ISSUE: explicit reference operation
                // ISSUE: explicit reference operation
                (^ local1).x = (__Null)((^ local1).x * (double)num1);
                // ISSUE: explicit reference operation
                // ISSUE: variable of a reference type
                Vector2& local2 = @this.mDesiredPosition;

                // ISSUE: explicit reference operation
                // ISSUE: explicit reference operation
                (^ local2).y = (__Null)((^ local2).y * (double)num2);
                if (!self.AutoSelectArea)
                {
                    return;
                }
                self.AutoSelectArea = false;
                this.mTarget.SetOpacity(1f);
                self.mTransform.set_anchoredPosition(this.mDesiredPosition);
                ((Transform)self.mTransform).set_localScale(Vector2.op_Implicit(this.mDesiredScale));
                self.mStateMachine.GotoState <WorldMapController.State_AreaSelect>();
            }
Exemplo n.º 2
0
        private void Start()
        {
            this.mTransform       = ((Component)this).get_transform() as RectTransform;
            this.mDefaultPosition = this.mTransform.get_anchoredPosition();
            this.mDefaultScale    = Vector2.op_Implicit(((Transform)this.mTransform).get_localScale());
            this.mStateMachine    = new StateMachine <WorldMapController>(this);
            bool flag = MonoSingleton <GameManager> .Instance.CheckReleaseStoryPart();

            if (this.AutoSelectArea && !flag)
            {
                GameManager instance = MonoSingleton <GameManager> .Instance;
                if (string.IsNullOrEmpty((string)GlobalVars.SelectedSection))
                {
                    QuestParam lastStoryQuest = instance.Player.FindLastStoryQuest();
                    if (lastStoryQuest != null)
                    {
                        GlobalVars.SelectedSection.Set(lastStoryQuest.Chapter.section);
                    }
                }
                if (string.IsNullOrEmpty((string)GlobalVars.SelectedSection) && string.IsNullOrEmpty((string)GlobalVars.SelectedChapter))
                {
                    GlobalVars.SelectedSection.Set(instance.Sections[0].iname);
                    for (int index = 0; index < instance.Chapters.Length; ++index)
                    {
                        if (instance.Chapters[index].section == (string)GlobalVars.SelectedSection)
                        {
                            GlobalVars.SelectedChapter.Set(instance.Chapters[index].iname);
                            break;
                        }
                    }
                }
                for (int index1 = 0; index1 < instance.Chapters.Length; ++index1)
                {
                    if (instance.Chapters[index1].section == (string)GlobalVars.SelectedSection && (instance.Chapters[index1].iname == (string)GlobalVars.SelectedChapter || string.IsNullOrEmpty((string)GlobalVars.SelectedChapter)))
                    {
                        for (int index2 = 0; index2 < this.AreaMaps.Length; ++index2)
                        {
                            if (this.AreaMaps[index2].MapID == instance.Chapters[index1].world)
                            {
                                this.mCurrentArea = this.AreaMaps[index2];
                                break;
                            }
                        }
                        break;
                    }
                }
                if (Object.op_Inequality((Object)this.mCurrentArea, (Object)null))
                {
                    this.mStateMachine.GotoState <WorldMapController.State_World2Area>();
                    return;
                }
            }
            else if (flag)
            {
                this.AutoSelectArea = false;
            }
            this.mStateMachine.GotoState <WorldMapController.State_WorldSelect>();
        }
Exemplo n.º 3
0
 public void GotoArea(string areaID)
 {
     for (int index = 0; index < this.AreaMaps.Length; ++index)
     {
         if (this.AreaMaps[index].MapID == areaID)
         {
             this.mCurrentArea = this.AreaMaps[index];
             return;
         }
     }
     this.mCurrentArea = (AreaMapController)null;
 }
Exemplo n.º 4
0
 public override void Begin(WorldMapController self)
 {
     this.mArea = self.mCurrentArea;
 }