Exemple #1
0
            private void OnDestroy()
            {
                UnityEngine.Object.Destroy((UnityEngine.Object) this.mScene);
                EventDialogBubble.DiscardAll();
                EventDialogBubbleCustom.DiscardAll();
                EventStandCharaController2.DiscardAll();
                for (int index = 0; index < this.Actions.Length; ++index)
                {
                    UnityEngine.Object.Destroy((UnityEngine.Object) this.Actions[index]);
                }
                if (!UnityEngine.Object.op_Inequality((UnityEngine.Object)EventScript.Canvas, (UnityEngine.Object)null))
                {
                    return;
                }
                ((UnityEvent)((Button)((Component)EventScript.Canvas).GetComponent <Button>()).get_onClick()).RemoveListener(this.mClickAction);
                HoldGesture component = (HoldGesture)((Component)EventScript.Canvas).GetComponent <HoldGesture>();

                if (UnityEngine.Object.op_Inequality((UnityEngine.Object)component, (UnityEngine.Object)null))
                {
                    // ISSUE: method pointer
                    component.OnHoldStart.RemoveListener(new UnityAction((object)this, __methodptr(OnDown)));
                    // ISSUE: method pointer
                    component.OnHoldEnd.RemoveListener(new UnityAction((object)this, __methodptr(OnUp)));
                }
                EventScript.DestroyCanvas();
            }
        private void FlushText()
        {
            string mTextQueue = this.mTextQueue;

            this.mTextQueue = (string)null;
            if (this.mCharacters == null || this.mCharacters.Length < mTextQueue.Length)
            {
                this.mCharacters = new EventDialogBubbleCustom.Character[mTextQueue.Length * 2];
            }
            string str      = "REPLACE_PLAYER_NAME";
            string newValue = string.Empty;

            if (Object.op_Inequality((Object)MonoSingleton <GameManager> .GetInstanceDirect(), (Object)null))
            {
                newValue = MonoSingleton <GameManager> .GetInstanceDirect().Player.Name;
            }
            string s = mTextQueue.Replace("<p_name>", str).Replace("<br>", "\n");

            EventAction_Dialog.TextSpeedTypes speed = EventAction_Dialog.TextSpeedTypes.Normal;
            int n = 0;

            EventDialogBubbleCustom.Ctx ctx = new EventDialogBubbleCustom.Ctx();
            ctx.Interval        = speed.ToFloat();
            ctx.Color           = Color32.op_Implicit(!Object.op_Inequality((Object)this.BodyText, (Object)null) ? Color.get_black() : ((Graphic)this.BodyText).get_color());
            this.mNumCharacters = 0;
            EventDialogBubbleCustom.Element[] c = EventDialogBubbleCustom.SplitTags(s);
            for (int index = 0; index < c.Length; ++index)
            {
                if (c[index] != null)
                {
                    c[index].Value = c[index].Value.Replace(str, newValue);
                }
            }
            this.Parse(c, ref n, (string)null, ctx);
            if (Object.op_Inequality((Object)this.BodyText, (Object)null))
            {
                this.BodyText.set_text(string.Empty);
            }
            this.mStartTime       = Time.get_time() + this.FadeInTime;
            this.mTextNeedsUpdate = this.mNumCharacters > 0;
            this.mFadingOut       = false;
            if (string.IsNullOrEmpty(this.VoiceSheetName) || string.IsNullOrEmpty(this.VoiceCueName))
            {
                this.FadeOutVoice();
            }
            else
            {
                this.mVoice = new MySound.Voice(this.VoiceSheetName, (string)null, (string)null);
                this.mVoice.Play(this.VoiceCueName, 0.0f);
                this.VoiceCueName = (string)null;
            }
        }
Exemple #3
0
 private void OnDestroy()
 {
     UnityEngine.Object.Destroy((UnityEngine.Object) this.mScene);
     EventDialogBubble.DiscardAll();
     EventDialogBubbleCustom.DiscardAll();
     EventStandCharaController2.DiscardAll();
     for (int index = 0; index < this.Actions.Length; ++index)
     {
         UnityEngine.Object.Destroy((UnityEngine.Object) this.Actions[index]);
     }
     if (!UnityEngine.Object.op_Inequality((UnityEngine.Object)EventScript.Canvas, (UnityEngine.Object)null))
     {
         return;
     }
     ((UnityEvent)((Button)((Component)EventScript.Canvas).GetComponent <Button>()).get_onClick()).RemoveListener(this.mClickAction);
     EventScript.DestroyCanvas();
 }
 public override void OnActivate()
 {
     if (string.IsNullOrEmpty(this.ActorID))
     {
         for (int index = EventDialogBubbleCustom.Instances.Count - 1; index >= 0; --index)
         {
             EventDialogBubbleCustom.Instances[index].Close();
         }
     }
     else
     {
         this.mBubble = EventDialogBubbleCustom.Find(this.ActorID);
         if (Object.op_Inequality((Object)this.mBubble, (Object)null))
         {
             this.mBubble.Close();
         }
     }
     this.ActivateNext();
 }
Exemple #5
0
 public override void PreStart()
 {
     if (!Object.op_Equality((Object)this.mBubble, (Object)null))
     {
         return;
     }
     if (!string.IsNullOrEmpty(this.UnitID))
     {
         this.ActorID = this.UnitID;
     }
     this.mBubble = EventDialogBubbleCustom.Find(this.ActorID);
     if (this.mBubbleResource != null && Object.op_Equality((Object)this.mBubble, (Object)null))
     {
         this.mBubble = Object.Instantiate(this.mBubbleResource.asset) as EventDialogBubbleCustom;
         ((Component)this.mBubble).get_transform().SetParent(((Component)this.ActiveCanvas).get_transform(), false);
         this.mBubble.BubbleID = this.ActorID;
         ((Component)this.mBubble).get_transform().SetAsLastSibling();
         ((Component)this.mBubble).get_gameObject().SetActive(false);
     }
     this.mBubble.AdjustWidth(this.mTextData);
     this.mBubble.Anchor = EventDialogBubbleCustom.Anchors.BottomCenter;
 }
        public void AdjustWidth(string bodyText)
        {
            if (Object.op_Equality((Object)this.BodyText, (Object)null) || !this.AutoExpandWidth)
            {
                return;
            }
            EventDialogBubbleCustom.Element[] elementArray = EventDialogBubbleCustom.SplitTags(bodyText);
            StringBuilder stringBuilder = new StringBuilder(elementArray.Length);

            for (int index = 0; index < elementArray.Length; ++index)
            {
                if (!string.IsNullOrEmpty(elementArray[index].Value))
                {
                    stringBuilder.Append(elementArray[index].Value);
                }
            }
            float         num       = Mathf.Min(this.BodyText.get_cachedTextGeneratorForLayout().GetPreferredWidth(stringBuilder.ToString(), this.BodyText.GetGenerationSettings(Vector2.get_zero())) / this.BodyText.get_pixelsPerUnit(), this.MaxBodyTextWidth) + this.mBaseWidth;
            RectTransform transform = ((Component)this).get_transform() as RectTransform;
            Vector2       sizeDelta = transform.get_sizeDelta();

            sizeDelta.x = (__Null)(double)Mathf.Max((float)sizeDelta.x, num);
            transform.set_sizeDelta(sizeDelta);
        }
 public override void OnActivate()
 {
     if (string.IsNullOrEmpty(this.ActorID))
     {
         for (int index = EventDialogBubbleCustom.Instances.Count - 1; index >= 0; --index)
         {
             EventDialogBubbleCustom.Instances[index].Close();
         }
     }
     else
     {
         this.mBubble = EventDialogBubbleCustom.Find(this.ActorID);
         if (Object.op_Inequality((Object)this.mBubble, (Object)null))
         {
             this.mBubble.Close();
         }
     }
     this.fadeInList.Clear();
     this.fadeInParticleList.Clear();
     this.IsFading = false;
     if (EventStandCharaController2.Instances != null && EventStandCharaController2.Instances.Count > 0)
     {
         using (List <EventStandCharaController2> .Enumerator enumerator = EventStandCharaController2.Instances.GetEnumerator())
         {
             while (enumerator.MoveNext())
             {
                 EventStandCharaController2 current = enumerator.Current;
                 if (!current.IsClose)
                 {
                     Color white = Color.get_white();
                     if (Event2dAction_OperateStandChara.CharaColorDic.ContainsKey(current.CharaID))
                     {
                         white = Event2dAction_OperateStandChara.CharaColorDic[current.CharaID];
                     }
                     foreach (GameObject standChara in current.StandCharaList)
                     {
                         if (Color.op_Inequality(((Graphic)((EventStandChara2)standChara.GetComponent <EventStandChara2>()).FaceObject.GetComponent <RawImage>()).get_color(), white))
                         {
                             this.fadeInList.Add(standChara);
                             this.IsFading = true;
                         }
                     }
                     foreach (Component componentsInChild in (GameObjectID[])((Component)current).get_gameObject().GetComponentsInChildren <GameObjectID>())
                     {
                         CanvasGroup component = (CanvasGroup)componentsInChild.GetComponent <CanvasGroup>();
                         if (Object.op_Inequality((Object)component, (Object)null) && (double)component.get_alpha() != 1.0)
                         {
                             this.fadeInParticleList.Add(component);
                         }
                     }
                 }
             }
         }
     }
     if (!this.IsFading)
     {
         this.ActivateNext();
     }
     else
     {
         this.fadingTime = this.FadeTime;
         if (!this.Async)
         {
             return;
         }
         this.ActivateNext(true);
     }
 }
Exemple #8
0
        public override void OnActivate()
        {
            if (Object.op_Inequality((Object)this.mStandChara, (Object)null) && !((Component)this.mStandChara).get_gameObject().get_activeInHierarchy())
            {
                ((Component)this.mStandChara).get_gameObject().SetActive(true);
            }
            if (!Object.op_Inequality((Object)this.mStandChara, (Object)null))
            {
                return;
            }
            ((Graphic)((Component)this.mStandChara).get_gameObject().GetComponent <RawImage>()).set_color(new Color((float)Color.get_gray().r, (float)Color.get_gray().g, (float)Color.get_gray().b, 0.0f));
            ((RawImage)((Component)this.mStandChara).get_gameObject().GetComponent <RawImage>()).set_texture((Texture)this.StandcharaImage);
            RectTransform component = (RectTransform)((Component)this.mStandChara).GetComponent <RectTransform>();

            if (Object.op_Equality((Object)((Component)this.mStandChara).get_transform().get_parent(), (Object)null))
            {
                Vector3 vector3_1;
                // ISSUE: explicit reference operation
                ((Vector3)@vector3_1).\u002Ector(this.mStandChara.GetPositionX((int)this.Position), 0.0f, 0.0f);
                ((Transform)component).set_position(vector3_1);
                Vector3 vector3_2;
                // ISSUE: explicit reference operation
                ((Vector3)@vector3_2).\u002Ector(1f, 1f, 1f);
                ((Transform)component).set_localScale(vector3_2);
                ((Component)this.mStandChara).get_transform().SetParent(((Component)this.ActiveCanvas).get_transform(), false);
                ((Component)this.mStandChara).get_transform().SetAsFirstSibling();
                ((Component)this.mStandChara).get_transform().SetSiblingIndex(((Component)EventDialogBubbleCustom.FindHead()).get_transform().GetSiblingIndex() - 1);
            }
            if (this.Flip)
            {
                ((Transform)component).Rotate(new Vector3(0.0f, 180f, 0.0f));
            }
            this.mStandChara.Open(0.3f);
        }