Beispiel #1
0
        public void OnIcon(GameObject go)
        {
            if (UnityEngine.Object.op_Equality((UnityEngine.Object)go, (UnityEngine.Object)null))
            {
                return;
            }
            this.mSelectIcon = (StoryPartIcon)null;
            if (UnityEngine.Object.op_Equality((UnityEngine.Object) this.mQuestSectionList, (UnityEngine.Object)null))
            {
                WorldMapController instance = WorldMapController.FindInstance(this.WorldMapControllerID);
                if (!UnityEngine.Object.op_Inequality((UnityEngine.Object)instance, (UnityEngine.Object)null))
                {
                    return;
                }
                this.mQuestSectionList = instance.SectionList;
            }
            StoryPartIcon component1 = (StoryPartIcon)go.GetComponent <StoryPartIcon>();

            if (UnityEngine.Object.op_Equality((UnityEngine.Object)component1, (UnityEngine.Object)null) || UnityEngine.Object.op_Equality((UnityEngine.Object) this.ScrollArea, (UnityEngine.Object)null))
            {
                return;
            }
            ScrollAutoFit component2 = (ScrollAutoFit)this.ScrollArea.GetComponent <ScrollAutoFit>();

            if (UnityEngine.Object.op_Equality((UnityEngine.Object)component2, (UnityEngine.Object)null))
            {
                return;
            }
            IEnumerator enumerator = ((Component)this).get_transform().GetEnumerator();

            try
            {
                while (enumerator.MoveNext())
                {
                    Transform current = (Transform)enumerator.Current;
                    if (((Component)current).get_gameObject().get_activeSelf() && UnityEngine.Object.op_Equality((UnityEngine.Object)((Component)component1).get_gameObject(), (UnityEngine.Object)((Component)current).get_gameObject()))
                    {
                        RectTransform component3 = (RectTransform)((Component)current).GetComponent <RectTransform>();
                        if (!UnityEngine.Object.op_Equality((UnityEngine.Object)component3, (UnityEngine.Object)null))
                        {
                            component2.SetScrollToHorizontal((float)-component3.get_anchoredPosition().x);
                            this.mSelectIcon = component1;
                            this.mCheckSelectIconMoveFlag = true;
                            FlowNode_GameObject.ActivateOutputLinks((Component)this, 103);
                            break;
                        }
                    }
                }
            }
            finally
            {
                IDisposable disposable = enumerator as IDisposable;
                if (disposable != null)
                {
                    disposable.Dispose();
                }
            }
        }
Beispiel #2
0
        public void OnNext()
        {
            if (UnityEngine.Object.op_Equality((UnityEngine.Object) this.ScrollArea, (UnityEngine.Object)null))
            {
                return;
            }
            ScrollAutoFit component1 = (ScrollAutoFit)this.ScrollArea.GetComponent <ScrollAutoFit>();

            if (UnityEngine.Object.op_Equality((UnityEngine.Object)component1, (UnityEngine.Object)null))
            {
                return;
            }
            float       x          = (float)((RectTransform)((Component)((Component)this).get_transform()).GetComponent <RectTransform>()).get_anchoredPosition().x;
            float       num1       = 0.0f;
            int         num2       = 0;
            float       pos        = x;
            IEnumerator enumerator = ((Component)this).get_transform().GetEnumerator();

            try
            {
                while (enumerator.MoveNext())
                {
                    Transform current = (Transform)enumerator.Current;
                    if (((Component)current).get_gameObject().get_activeSelf())
                    {
                        RectTransform component2 = (RectTransform)((Component)current).GetComponent <RectTransform>();
                        if (!UnityEngine.Object.op_Equality((UnityEngine.Object)component2, (UnityEngine.Object)null) && (double)x > -component2.get_anchoredPosition().x&& (num2 == 0 || (double)num1 > (double)Mathf.Abs(x - (float)-component2.get_anchoredPosition().x)))
                        {
                            num1 = Mathf.Abs(x - (float)-component2.get_anchoredPosition().x);
                            pos  = (float)-component2.get_anchoredPosition().x;
                            ++num2;
                        }
                    }
                }
            }
            finally
            {
                IDisposable disposable = enumerator as IDisposable;
                if (disposable != null)
                {
                    disposable.Dispose();
                }
            }
            component1.SetScrollToHorizontal(pos);
            if (!UnityEngine.Object.op_Inequality((UnityEngine.Object) this.mNextButton, (UnityEngine.Object)null) || !UnityEngine.Object.op_Inequality((UnityEngine.Object) this.mPrevButton, (UnityEngine.Object)null))
            {
                return;
            }
            ++this.mSelectIconNum;
            ((Selectable)this.mNextButton).set_interactable(true);
            if (this.mSelectIconNum != MonoSingleton <GameManager> .Instance.GetStoryPartNum())
            {
                return;
            }
            ((Selectable)this.mPrevButton).set_interactable(false);
        }