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
        private void Start()
        {
            this.mMoveRect                = (RectTransform)null;
            this.mQuestSectionList        = (QuestSectionList)null;
            this.ReleaseStoryPartIcon     = (StoryPartIcon)null;
            this.AnimationReleaseFlag     = false;
            this.mSelectIconNum           = 1;
            this.mSelectIcon              = (StoryPartIcon)null;
            this.mCheckSelectIconMoveFlag = false;
            this.mSelectBeforeIcon        = (StoryPartIcon)null;
            this.mNextButton              = (Button)null;
            if (UnityEngine.Object.op_Inequality((UnityEngine.Object) this.PageNext, (UnityEngine.Object)null))
            {
                this.mNextButton = (Button)this.PageNext.GetComponent <Button>();
            }
            this.mPrevButton = (Button)null;
            if (UnityEngine.Object.op_Inequality((UnityEngine.Object) this.PagePrev, (UnityEngine.Object)null))
            {
                this.mPrevButton = (Button)this.PagePrev.GetComponent <Button>();
            }
            SerializeValueList currentValue = FlowNode_ButtonEvent.currentValue as SerializeValueList;

            if (currentValue != null)
            {
                this.mQuestSectionList = currentValue.GetComponent <QuestSectionList>("_self");
            }
            this.mReleaseAction = MonoSingleton <GameManager> .Instance.CheckReleaseStoryPart();

            this.SetRangeFlag = false;
            this.TemplateGo.SetActive(false);
            this.TemplatePageIcon.SetActive(false);
            int storyPartNum = MonoSingleton <GameManager> .Instance.GetStoryPartNum();

            int partNumPresentTime = MonoSingleton <GameManager> .Instance.GetStoryPartNumPresentTime();

            Vector2.get_zero();
            for (int index = 0; index < storyPartNum; ++index)
            {
                GameObject gameObject1 = (GameObject)UnityEngine.Object.Instantiate <GameObject>((M0)this.TemplateGo);
                Vector2    vector2_1   = Vector2.op_Implicit(gameObject1.get_transform().get_localScale());
                gameObject1.get_transform().SetParent(((Component)this).get_transform());
                gameObject1.get_transform().set_localScale(Vector2.op_Implicit(vector2_1));
                gameObject1.get_gameObject().SetActive(true);
                ((UnityEngine.Object)gameObject1).set_name(((UnityEngine.Object) this.TemplateGo).get_name() + (index + 1).ToString());
                StoryPartIcon component = (StoryPartIcon)gameObject1.GetComponent <StoryPartIcon>();
                if (this.mReleaseAction && index + 1 == partNumPresentTime)
                {
                    component.Setup(true, index + 1);
                    this.ReleaseStoryPartIcon = component;
                }
                else if (!component.Setup(index + 1 > partNumPresentTime, index + 1))
                {
                    UnityEngine.Object.Destroy((UnityEngine.Object)gameObject1);
                    continue;
                }
                this.mStoryPartIconList.Add(component);
                Toggle toggle = (Toggle)null;
                if (storyPartNum > 1)
                {
                    GameObject gameObject2 = (GameObject)UnityEngine.Object.Instantiate <GameObject>((M0)this.TemplatePageIcon);
                    Vector2    vector2_2   = Vector2.op_Implicit(gameObject2.get_transform().get_localScale());
                    gameObject2.get_transform().SetParent(this.TogglePagesGroup.get_transform());
                    gameObject2.get_transform().set_localScale(Vector2.op_Implicit(vector2_2));
                    gameObject2.get_gameObject().SetActive(true);
                    ((UnityEngine.Object)gameObject2).set_name(((UnityEngine.Object) this.TemplatePageIcon).get_name() + (index + 1).ToString());
                    toggle = (Toggle)gameObject2.GetComponent <Toggle>();
                    this.mPageIconList.Add(toggle);
                }
                if (this.mReleaseAction)
                {
                    if (index + 1 == partNumPresentTime)
                    {
                        this.mMoveRect      = (RectTransform)gameObject1.GetComponent <RectTransform>();
                        this.mSelectIconNum = partNumPresentTime;
                        if (UnityEngine.Object.op_Inequality((UnityEngine.Object)toggle, (UnityEngine.Object)null))
                        {
                            toggle.set_isOn(true);
                        }
                    }
                }
                else if (index + 1 == GlobalVars.SelectedStoryPart.Get())
                {
                    this.mMoveRect      = (RectTransform)gameObject1.GetComponent <RectTransform>();
                    this.mSelectIconNum = partNumPresentTime;
                    if (UnityEngine.Object.op_Inequality((UnityEngine.Object)toggle, (UnityEngine.Object)null))
                    {
                        toggle.set_isOn(true);
                    }
                }
            }
            if (storyPartNum != 1)
            {
                return;
            }
            if (UnityEngine.Object.op_Inequality((UnityEngine.Object) this.PageNext, (UnityEngine.Object)null))
            {
                this.PageNext.SetActive(false);
            }
            if (!UnityEngine.Object.op_Inequality((UnityEngine.Object) this.PagePrev, (UnityEngine.Object)null))
            {
                return;
            }
            this.PagePrev.SetActive(false);
        }