public override void PreStart()
        {
            if (string.IsNullOrEmpty(this.CharaID))
            {
                return;
            }
            this.mEVCharaController = EventStandCharaController2.FindInstances(this.CharaID);
            string str = this.CharaID + "_Flip";

            for (int index = 0; index < Event2dAction_FlipStandChara.InstancesForFlip.Count; ++index)
            {
                if (Event2dAction_FlipStandChara.InstancesForFlip[index].CharaID == str)
                {
                    this.mEVCharaFlipController = Event2dAction_FlipStandChara.InstancesForFlip[index];
                    this.mStandObjectFlip       = ((Component)this.mEVCharaFlipController).get_gameObject();
                    break;
                }
            }
            if (!Object.op_Equality((Object)this.mEVCharaFlipController, (Object)null) || !Object.op_Inequality((Object)this.mEVCharaController, (Object)null))
            {
                return;
            }
            this.mStandObjectFlip               = (GameObject)Object.Instantiate <GameObject>((M0)((Component)this.mEVCharaController).get_gameObject());
            this.mEVCharaFlipController         = (EventStandCharaController2)this.mStandObjectFlip.GetComponent <EventStandCharaController2>();
            this.mEVCharaFlipController.CharaID = str;
            Event2dAction_FlipStandChara.InstancesForFlip.Add(this.mEVCharaFlipController);
        }
Exemple #2
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();
            }
Exemple #3
0
 public override void PreStart()
 {
     for (int index = 0; index < this.CharaIDs.Length; ++index)
     {
         this.mStandCharaList.Add(EventStandCharaController2.FindInstances(this.CharaIDs[index]));
     }
 }
Exemple #4
0
 public override void PreStart()
 {
     if (!Object.op_Equality((Object)this.mStandChara, (Object)null))
     {
         return;
     }
     this.mStandChara = EventStandCharaController2.FindInstances(this.CharaID);
 }
Exemple #5
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.CharaID))
     {
         for (int index = EventStandCharaController2.Instances.Count - 1; index >= 0; --index)
         {
             EventStandCharaController2.Instances[index].Close(0.3f);
         }
     }
     else
     {
         EventStandCharaController2 instances = EventStandCharaController2.FindInstances(this.CharaID);
         if (Object.op_Inequality((Object)instances, (Object)null))
         {
             instances.Close(0.3f);
         }
     }
     this.mTimer = 1f;
 }
Exemple #7
0
        public override void PreStart()
        {
            if (!Object.op_Equality((Object)this.mStandObject, (Object)null))
            {
                return;
            }
            string id = this.DummyID;

            if (!string.IsNullOrEmpty(this.CharaID))
            {
                id = this.CharaID;
            }
            if (Object.op_Inequality((Object)EventStandCharaController2.FindInstances(id), (Object)null))
            {
                this.mEVCharaController = EventStandCharaController2.FindInstances(id);
                this.mStandObject       = ((Component)this.mEVCharaController).get_gameObject();
            }
            if (Object.op_Equality((Object)this.mStandObject, (Object)null) && Object.op_Inequality((Object)this.StandTemplate, (Object)null))
            {
                this.mStandObject               = (GameObject)Object.Instantiate <GameObject>((M0)this.StandTemplate);
                this.mEVCharaController         = (EventStandCharaController2)this.mStandObject.GetComponent <EventStandCharaController2>();
                this.mEVCharaController.CharaID = this.CharaID;
            }
            if (!Object.op_Inequality((Object)this.mStandObject, (Object)null))
            {
                return;
            }
            this.mStandObject.get_transform().SetParent(((Component)this.ActiveCanvas).get_transform(), false);
            this.mStandObject.get_transform().SetAsLastSibling();
            this.mStandObject.get_gameObject().SetActive(false);
            RectTransform component = (RectTransform)this.mStandObject.GetComponent <RectTransform>();
            Vector2       vector2_1;

            // ISSUE: explicit reference operation
            ((Vector2)@vector2_1).\u002Ector(this.mEVCharaController.GetAnchorPostionX((int)this.Position), 0.0f);
            RectTransform rectTransform = component;
            Vector2       vector2_2     = vector2_1;

            component.set_anchorMax(vector2_2);
            Vector2 vector2_3 = vector2_2;

            rectTransform.set_anchorMin(vector2_3);
        }
Exemple #8
0
 public override void OnActivate()
 {
     if (Object.op_Inequality((Object)this.mBubble, (Object)null) && !((Component)this.mBubble).get_gameObject().get_activeInHierarchy())
     {
         for (int index = 0; index < EventDialogBubbleCustom.Instances.Count && Object.op_Inequality((Object)EventDialogBubbleCustom.Instances[index], (Object)this.mBubble); ++index)
         {
             if (EventDialogBubbleCustom.Instances[index].BubbleID == this.ActorID)
             {
                 EventDialogBubbleCustom.Instances[index].Close();
             }
         }
         ((Component)this.mBubble).get_gameObject().SetActive(true);
     }
     if (Object.op_Inequality((Object)this.mBubble, (Object)null))
     {
         if (!string.IsNullOrEmpty(this.mVoiceID))
         {
             string[] idPair = Event2dAction_Dialog2.GetIDPair(this.mVoiceID);
             if (idPair != null)
             {
                 this.mBubble.VoiceSheetName = idPair[0];
                 this.mBubble.VoiceCueName   = idPair[1];
             }
         }
         ((Component)this.mBubble).get_transform().SetAsLastSibling();
         RectTransform transform1 = ((Component)this.mBubble).get_transform() as RectTransform;
         for (int index = 0; index < EventDialogBubbleCustom.Instances.Count; ++index)
         {
             RectTransform transform2 = ((Component)EventDialogBubbleCustom.Instances[index]).get_transform() as RectTransform;
             if (Object.op_Inequality((Object)transform1, (Object)transform2))
             {
                 Rect rect = transform1.get_rect();
                 // ISSUE: explicit reference operation
                 if (((Rect)@rect).Overlaps(transform2.get_rect()))
                 {
                     EventDialogBubbleCustom.Instances[index].Close();
                 }
             }
         }
         if (string.IsNullOrEmpty(this.mPlayerName))
         {
             this.mBubble.SetName(this.mUnit == null ? "???" : this.mUnit.name);
         }
         else
         {
             this.mBubble.SetName(this.mPlayerName);
         }
         this.mBubble.SetBody(this.mTextData);
         this.mBubble.Open();
     }
     this.fadeInList.Clear();
     this.fadeOutList.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)
                 {
                     if (current.CharaID == this.CharaID || this.ContainIgnoreFO(current.CharaID))
                     {
                         foreach (GameObject standChara in current.StandCharaList)
                         {
                             if (Color.op_Inequality(((Graphic)((EventStandChara2)standChara.GetComponent <EventStandChara2>()).FaceObject.GetComponent <RawImage>()).get_color(), Color.get_white()))
                             {
                                 this.fadeInList.Add(standChara);
                                 this.IsFading = true;
                             }
                         }
                         int num = ((Component)this.mBubble).get_transform().GetSiblingIndex() - 1;
                         Debug.Log((object)("set index:" + (object)num));
                         ((Component)current).get_transform().SetSiblingIndex(num);
                         ((Component)current).get_transform().set_localScale(Vector3.op_Multiply(Vector3.get_one(), 1f));
                         if (!string.IsNullOrEmpty(this.Emotion))
                         {
                             current.UpdateEmotion(this.Emotion);
                         }
                     }
                     else if (((Behaviour)current).get_isActiveAndEnabled())
                     {
                         foreach (GameObject standChara in current.StandCharaList)
                         {
                             if (Color.op_Inequality(((Graphic)((EventStandChara2)standChara.GetComponent <EventStandChara2>()).FaceObject.GetComponent <RawImage>()).get_color(), Color.get_gray()))
                             {
                                 this.fadeOutList.Add(standChara);
                                 this.IsFading = true;
                             }
                         }
                     }
                 }
             }
         }
     }
     if (!this.Async)
     {
         return;
     }
     this.ActivateNext();
 }
 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);
     }
 }
        public override void PreStart()
        {
            if (this.NewMaterial)
            {
                Shader.DisableKeyword("EVENT_MONOCHROME_ON");
                Shader.DisableKeyword("EVENT_SEPIA_ON");
            }
            if (!UnityEngine.Object.op_Equality((UnityEngine.Object) this.mStandObject, (UnityEngine.Object)null))
            {
                return;
            }
            string id = this.DummyID;

            if (!string.IsNullOrEmpty(this.CharaID))
            {
                id = this.CharaID;
            }
            if (UnityEngine.Object.op_Inequality((UnityEngine.Object)EventStandCharaController2.FindInstances(id), (UnityEngine.Object)null))
            {
                this.mEVCharaController = EventStandCharaController2.FindInstances(id);
                this.mStandObject       = ((Component)this.mEVCharaController).get_gameObject();
            }
            if (UnityEngine.Object.op_Equality((UnityEngine.Object) this.mStandObject, (UnityEngine.Object)null) && UnityEngine.Object.op_Inequality((UnityEngine.Object) this.StandTemplate, (UnityEngine.Object)null))
            {
                this.mStandObject               = (GameObject)UnityEngine.Object.Instantiate <GameObject>((M0)this.StandTemplate);
                this.mEVCharaController         = (EventStandCharaController2)this.mStandObject.GetComponent <EventStandCharaController2>();
                this.mEVCharaController.CharaID = this.CharaID;
                if (this.NewMaterial)
                {
                    for (int index = 0; index < this.mEVCharaController.StandCharaList.Length; ++index)
                    {
                        try
                        {
                            EventStandChara2 component1 = (EventStandChara2)this.mEVCharaController.StandCharaList[index].GetComponent <EventStandChara2>();
                            RectTransform    component2 = (RectTransform)component1.BodyObject.GetComponent <RectTransform>();
                            RectTransform    component3 = (RectTransform)component1.FaceObject.GetComponent <RectTransform>();
                            Vector2          vector2_1;
                            // ISSUE: explicit reference operation
                            ((Vector2)@vector2_1).\u002Ector((float)(component2.get_sizeDelta().x *((Transform)component2).get_localScale().x), (float)(component2.get_sizeDelta().y *((Transform)component2).get_localScale().y));
                            Vector2 vector2_2;
                            // ISSUE: explicit reference operation
                            ((Vector2)@vector2_2).\u002Ector((float)(component3.get_sizeDelta().x *((Transform)component3).get_localScale().x), (float)(component3.get_sizeDelta().y *((Transform)component3).get_localScale().y));
                            Vector2 vector2_3;
                            Vector2 vector2_4;
                            if (Mathf.Approximately((float)vector2_2.x, 0.0f) || Mathf.Approximately((float)vector2_2.y, 0.0f))
                            {
                                // ISSUE: explicit reference operation
                                ((Vector2)@vector2_3).\u002Ector(0.0f, 0.0f);
                                // ISSUE: explicit reference operation
                                ((Vector2)@vector2_4).\u002Ector(2f, 2f);
                            }
                            else
                            {
                                // ISSUE: explicit reference operation
                                ((Vector2)@vector2_3).\u002Ector((float)(vector2_1.x / vector2_2.x), (float)(vector2_1.y / vector2_2.y));
                                Vector2 vector2_5;
                                // ISSUE: explicit reference operation
                                ((Vector2)@vector2_5).\u002Ector((float)(((Transform)component3).get_localPosition().x - component3.get_pivot().x *vector2_2.x), (float)(((Transform)component3).get_localPosition().y - component3.get_pivot().y *vector2_2.y));
                                Vector2 vector2_6;
                                // ISSUE: explicit reference operation
                                ((Vector2)@vector2_6).\u002Ector((float)(((Transform)component2).get_localPosition().x - component2.get_pivot().x *vector2_1.x), (float)(((Transform)component2).get_localPosition().y - component2.get_pivot().y *vector2_1.y));
                                Vector2 vector2_7 = Vector2.op_Subtraction(vector2_5, vector2_6);
                                // ISSUE: explicit reference operation
                                ((Vector2)@vector2_4).\u002Ector((float)(-1.0 * vector2_7.x / vector2_2.x), (float)(-1.0 * vector2_7.y / vector2_2.y));
                            }
                            Material material    = new Material(Shader.Find("UI/Custom/EventStandChara"));
                            Texture  mainTexture = ((RawImage)component1.FaceObject.GetComponent <RawImage>()).get_mainTexture();
                            this.SetMaterialProperty(material, "_FaceTex", mainTexture);
                            this.SetMaterialProperty(material, "_ScaleX", (float)vector2_3.x);
                            this.SetMaterialProperty(material, "_ScaleY", (float)vector2_3.y);
                            this.SetMaterialProperty(material, "_OffsetX", (float)vector2_4.x);
                            this.SetMaterialProperty(material, "_OffsetY", (float)vector2_4.y);
                            ((Graphic)component1.BodyObject.GetComponent <RawImage>()).set_material(material);
                            GameUtility.SetGameObjectActive(component1.FaceObject, false);
                        }
                        catch (Exception ex)
                        {
                        }
                    }
                }
            }
            if (!UnityEngine.Object.op_Inequality((UnityEngine.Object) this.mStandObject, (UnityEngine.Object)null))
            {
                return;
            }
            this.mStandObject.get_transform().SetParent(((Component)this.ActiveCanvas).get_transform(), false);
            this.mStandObject.get_transform().SetAsLastSibling();
            this.mStandObject.get_gameObject().SetActive(false);
            RectTransform component     = (RectTransform)this.mStandObject.GetComponent <RectTransform>();
            RectTransform rectTransform = component;
            Vector2       startPosition = Event2dAction_StandChara3.START_POSITION;

            component.set_anchorMax(startPosition);
            Vector2 vector2 = startPosition;

            rectTransform.set_anchorMin(vector2);
        }
 public override void OnActivate()
 {
     if (Object.op_Inequality((Object)this.mBubble, (Object)null) && !((Component)this.mBubble).get_gameObject().get_activeInHierarchy())
     {
         for (int index = 0; index < EventDialogBubbleCustom.Instances.Count && Object.op_Inequality((Object)EventDialogBubbleCustom.Instances[index], (Object)this.mBubble); ++index)
         {
             if (EventDialogBubbleCustom.Instances[index].BubbleID == this.ActorID)
             {
                 EventDialogBubbleCustom.Instances[index].Close();
             }
         }
         ((Component)this.mBubble).get_gameObject().SetActive(true);
     }
     if (Object.op_Inequality((Object)this.mBubble, (Object)null))
     {
         if (!string.IsNullOrEmpty(this.mVoiceID))
         {
             string[] idPair = Event2dAction_Dialog3.GetIDPair(this.mVoiceID);
             if (idPair != null)
             {
                 this.mBubble.VoiceSheetName = idPair[0];
                 this.mBubble.VoiceCueName   = idPair[1];
             }
         }
         ((Component)this.mBubble).get_transform().SetAsLastSibling();
         this.bubbleTransform = ((Component)this.mBubble).get_transform() as RectTransform;
         for (int index = 0; index < EventDialogBubbleCustom.Instances.Count; ++index)
         {
             RectTransform transform = ((Component)EventDialogBubbleCustom.Instances[index]).get_transform() as RectTransform;
             if (Object.op_Inequality((Object)this.bubbleTransform, (Object)transform))
             {
                 Rect rect = this.bubbleTransform.get_rect();
                 // ISSUE: explicit reference operation
                 if (((Rect)@rect).Overlaps(transform.get_rect()))
                 {
                     EventDialogBubbleCustom.Instances[index].Close();
                 }
             }
         }
         this.mBubble.SetName(this.mUnit == null ? "???" : this.mUnit.name);
         this.mBubble.SetBody(this.mTextData);
         this.mBubble.Open();
     }
     this.fadeInList.Clear();
     this.fadeOutList.Clear();
     this.fadeInParticleList.Clear();
     this.fadeOutParticleList.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)
                 {
                     if (current.CharaID == this.CharaID || this.ContainIgnoreFO(current.CharaID))
                     {
                         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;
                             }
                         }
                         if (this.ActorParticle)
                         {
                             foreach (Component componentsInChild in (GameObjectID[])((Component)current).get_gameObject().GetComponentsInChildren <GameObjectID>())
                             {
                                 CanvasGroup canvasGroup = componentsInChild.RequireComponent <CanvasGroup>();
                                 if ((double)canvasGroup.get_alpha() != 1.0)
                                 {
                                     this.fadeInParticleList.Add(canvasGroup);
                                 }
                             }
                         }
                         int num = ((Component)this.mBubble).get_transform().GetSiblingIndex() - 1;
                         ((Component)current).get_transform().SetSiblingIndex(num);
                         ((Component)current).get_transform().set_localScale(Vector3.op_Multiply(((Component)current).get_transform().get_localScale(), 1f));
                         if (!string.IsNullOrEmpty(this.Emotion))
                         {
                             current.UpdateEmotion(this.Emotion);
                         }
                     }
                     else if (((Behaviour)current).get_isActiveAndEnabled())
                     {
                         Color color = Color.get_white();
                         if (Event2dAction_OperateStandChara.CharaColorDic.ContainsKey(current.CharaID))
                         {
                             color = Color.op_Multiply(Event2dAction_OperateStandChara.CharaColorDic[current.CharaID], Color.get_gray());
                         }
                         foreach (GameObject standChara in current.StandCharaList)
                         {
                             if (Color.op_Inequality(((Graphic)((EventStandChara2)standChara.GetComponent <EventStandChara2>()).FaceObject.GetComponent <RawImage>()).get_color(), color))
                             {
                                 this.fadeOutList.Add(standChara);
                                 this.IsFading = true;
                             }
                         }
                         if (this.ActorParticle)
                         {
                             foreach (Component componentsInChild in (GameObjectID[])((Component)current).get_gameObject().GetComponentsInChildren <GameObjectID>())
                             {
                                 CanvasGroup canvasGroup = componentsInChild.RequireComponent <CanvasGroup>();
                                 if ((double)canvasGroup.get_alpha() != 0.0)
                                 {
                                     this.fadeOutParticleList.Add(canvasGroup);
                                 }
                             }
                         }
                     }
                 }
             }
         }
     }
     if (this.IsFading)
     {
         this.fadingTime = this.FadeTime;
     }
     this.IsShaking = false;
     if (Object.op_Inequality((Object)this.mBubble, (Object)null) && (double)this.Duration > 0.0)
     {
         this.IsShaking   = true;
         this.originalPvt = new Vector2(0.5f, 0.0f);
         this.ShakingTime = this.Duration;
         this.mSeedX      = Random.get_value();
         this.mSeedY      = Random.get_value();
     }
     if (!this.Async)
     {
         return;
     }
     this.ActivateNext(true);
 }
Exemple #12
0
 public override void OnActivate()
 {
     if (Object.op_Inequality((Object)this.mBubble, (Object)null) && !((Component)this.mBubble).get_gameObject().get_activeInHierarchy())
     {
         for (int index = 0; index < EventDialogBubbleCustom.Instances.Count && Object.op_Inequality((Object)EventDialogBubbleCustom.Instances[index], (Object)this.mBubble); ++index)
         {
             if (EventDialogBubbleCustom.Instances[index].BubbleID == this.ActorID)
             {
                 EventDialogBubbleCustom.Instances[index].Close();
             }
         }
         ((Component)this.mBubble).get_gameObject().SetActive(true);
     }
     if (Object.op_Inequality((Object)this.mBubble, (Object)null))
     {
         if (!string.IsNullOrEmpty(this.mVoiceID))
         {
             string[] idPair = Event2dAction_Dialog.GetIDPair(this.mVoiceID);
             if (idPair != null)
             {
                 this.mBubble.VoiceSheetName = idPair[0];
                 this.mBubble.VoiceCueName   = idPair[1];
             }
         }
         ((Component)this.mBubble).get_transform().SetAsLastSibling();
         RectTransform transform1 = ((Component)this.mBubble).get_transform() as RectTransform;
         for (int index = 0; index < EventDialogBubbleCustom.Instances.Count; ++index)
         {
             RectTransform transform2 = ((Component)EventDialogBubbleCustom.Instances[index]).get_transform() as RectTransform;
             if (Object.op_Inequality((Object)transform1, (Object)transform2))
             {
                 Rect rect = transform1.get_rect();
                 // ISSUE: explicit reference operation
                 if (((Rect)@rect).Overlaps(transform2.get_rect()))
                 {
                     EventDialogBubbleCustom.Instances[index].Close();
                 }
             }
         }
         if (string.IsNullOrEmpty(this.mPlayerName))
         {
             this.mBubble.SetName(this.mUnit == null ? "???" : this.mUnit.name);
         }
         else
         {
             this.mBubble.SetName(this.mPlayerName);
         }
         this.mBubble.SetBody(this.mTextData);
         this.mBubble.Open();
     }
     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.CharaID == this.CharaID)
                 {
                     if (!current.IsClose)
                     {
                         ((Component)current).get_transform().SetSiblingIndex(((Component)this.mBubble).get_transform().GetSiblingIndex() - 1);
                         if (!string.IsNullOrEmpty(this.Emotion))
                         {
                             current.UpdateEmotion(this.Emotion);
                         }
                     }
                 }
                 else if (!current.IsClose)
                 {
                     ;
                 }
             }
         }
     }
     if (!this.Async)
     {
         return;
     }
     this.ActivateNext();
 }
Exemple #13
0
 public override void OnActivate()
 {
     if (this.mResourceLoadRequest != null && Object.op_Inequality(this.mResourceLoadRequest.asset, (Object)null))
     {
         GameObject    asset     = this.mResourceLoadRequest.asset as GameObject;
         RectTransform component = (RectTransform)asset.GetComponent <RectTransform>();
         if (Object.op_Inequality((Object)component, (Object)null))
         {
             this.pvt = component.get_pivot();
         }
         this.mGO = Object.Instantiate(this.mResourceLoadRequest.asset, Vector3.get_zero(), asset.get_transform().get_rotation()) as GameObject;
         if (!string.IsNullOrEmpty(this.ObjectID))
         {
             GameUtility.RequireComponent <GameObjectID>(this.mGO).ID = this.ObjectID;
         }
         if (this.Order == Event2dAction_SpawnObject3.SiblingOrder.Root)
         {
             if (this.Persistent && Object.op_Inequality((Object)TacticsSceneSettings.Instance, (Object)null))
             {
                 this.mGO.get_transform().SetParent(((Component)TacticsSceneSettings.Instance).get_transform(), true);
             }
         }
         else if (this.Order == Event2dAction_SpawnObject3.SiblingOrder.ChildOfActor)
         {
             if (!string.IsNullOrEmpty(this.CharaID))
             {
                 EventStandCharaController2 instances = EventStandCharaController2.FindInstances(this.CharaID);
                 if (Object.op_Inequality((Object)instances, (Object)null))
                 {
                     this.mGO.get_transform().SetParent(((Component)instances).get_gameObject().get_transform(), true);
                     if (this.ChildOrder == Event2dAction_SpawnObject3.ActorChildOrder.Over)
                     {
                         this.mGO.get_transform().SetAsLastSibling();
                     }
                     else
                     {
                         this.mGO.get_transform().SetAsFirstSibling();
                     }
                     this.rectTransform = (RectTransform)this.mGO.GetComponent <RectTransform>();
                     if (Object.op_Inequality((Object)this.rectTransform, (Object)null))
                     {
                         this.rectTransform.set_pivot(this.pvt);
                         this.rectTransform.set_anchoredPosition(Vector2.get_zero());
                         RectTransform rectTransform = this.rectTransform;
                         Vector2       vector2_1     = this.convertPosition(this.Position);
                         this.rectTransform.set_anchorMax(vector2_1);
                         Vector2 vector2_2 = vector2_1;
                         rectTransform.set_anchorMin(vector2_2);
                     }
                 }
             }
         }
         else
         {
             float num1 = 0.0f;
             for (int index = 0; index < ((Component)this.ActiveCanvas).get_transform().get_childCount(); ++index)
             {
                 Transform child = ((Component)this.ActiveCanvas).get_transform().GetChild(index);
                 if (Object.op_Inequality((Object)((Component)child).GetComponent <EventDialogBubbleCustom>(), (Object)null))
                 {
                     num1 = (float)((Component)child).get_transform().get_position().z;
                     break;
                 }
             }
             this.mGO.get_transform().SetParent(((Component)this.ActiveCanvas).get_transform(), true);
             this.mGO.get_transform().SetAsLastSibling();
             if (this.Order == Event2dAction_SpawnObject3.SiblingOrder.OnDialog)
             {
                 Vector3 position = this.mGO.get_transform().get_position();
                 position.z = (__Null)((double)num1 - 1.0);
                 this.mGO.get_transform().set_position(position);
             }
             else if (this.Order == Event2dAction_SpawnObject3.SiblingOrder.OnStandChara)
             {
                 int num2 = -1;
                 for (int index = 0; index < ((Component)this.ActiveCanvas).get_transform().get_childCount(); ++index)
                 {
                     if (Object.op_Inequality((Object)((Component)((Component)this.ActiveCanvas).get_transform().GetChild(index)).GetComponent <EventDialogBubbleCustom>(), (Object)null))
                     {
                         num2 = index;
                         break;
                     }
                 }
                 if (num2 > 0)
                 {
                     this.mGO.get_transform().SetSiblingIndex(num2);
                 }
                 if ((double)num1 < -1.0)
                 {
                     Vector3 position = this.mGO.get_transform().get_position();
                     position.z = (__Null)((double)num1 + 1.0);
                     this.mGO.get_transform().set_position(position);
                 }
             }
             else if (this.Order == Event2dAction_SpawnObject3.SiblingOrder.OnBackGround)
             {
                 int num2 = -1;
                 for (int index = 0; index < ((Component)this.ActiveCanvas).get_transform().get_childCount(); ++index)
                 {
                     if (Object.op_Inequality((Object)((Component)((Component)this.ActiveCanvas).get_transform().GetChild(index)).GetComponent <EventStandCharaController2>(), (Object)null))
                     {
                         num2 = index;
                         break;
                     }
                 }
                 if (num2 > 0)
                 {
                     this.mGO.get_transform().SetSiblingIndex(num2);
                 }
             }
             this.rectTransform = (RectTransform)this.mGO.GetComponent <RectTransform>();
             if (Object.op_Inequality((Object)this.rectTransform, (Object)null))
             {
                 this.rectTransform.set_pivot(this.pvt);
                 this.rectTransform.set_anchoredPosition(Vector2.get_zero());
                 RectTransform rectTransform = this.rectTransform;
                 Vector2       vector2_1     = this.convertPosition(this.Position);
                 this.rectTransform.set_anchorMax(vector2_1);
                 Vector2 vector2_2 = vector2_1;
                 rectTransform.set_anchorMin(vector2_2);
             }
         }
         this.Sequence.SpawnedObjects.Add(this.mGO);
     }
     this.ActivateNext();
 }