Beispiel #1
0
 private void Update()
 {
     if (!this.mReady)
     {
         return;
     }
     if (this.mForceSkip)
     {
         for (int index1 = 0; index1 < this.mForceSkipIndex.Count; ++index1)
         {
             int index2 = this.mForceSkipIndex[index1];
             if (index2 < this.Actions.Length && this.Actions[index2].enabled)
             {
                 EventAction action = this.Actions[index2];
                 if (!(action is EventAction_WaitTap) && !(action is EventAction_Dialog) && (!(action is EventAction_Dialog2) && !(action is EventAction_FadeCanvas)) && (!(action is EventAction_FadeScreen) && !(action is EventAction_WaitSeconds)))
                 {
                     action.Update();
                     if (!action.enabled)
                     {
                         this.mForceSkipIndex.RemoveAt(index1);
                         --index1;
                     }
                 }
                 else
                 {
                     action.GoToEndState();
                     action.enabled = false;
                     this.mForceSkipIndex.RemoveAt(index1);
                     --index1;
                 }
             }
             else
             {
                 this.mForceSkipIndex.RemoveAt(index1);
                 --index1;
             }
         }
         if (this.mForceSkipIndex.Any <int>())
         {
             return;
         }
         if (this.mLastActionIndex >= 0)
         {
             this.StartForceSkip();
         }
         this.mForceSkip = false;
         this.mForceSkipIndex.Clear();
         this.mLastActionIndex = -1;
     }
     else
     {
         int num = -1;
         for (int index = 0; index < this.Actions.Length; ++index)
         {
             if (this.Actions[index].enabled)
             {
                 this.Actions[index].Update();
                 num = index;
             }
         }
         if (!this.IsAutoForward)
         {
             return;
         }
         SceneBattle instance = SceneBattle.Instance;
         if (!UnityEngine.Object.op_Implicit((UnityEngine.Object)instance) || !instance.Battle.RequestAutoBattle && !instance.Battle.IsMultiPlay)
         {
             return;
         }
         if (this.mCurIdxAutoForward != num)
         {
             this.mCurIdxAutoForward = num;
             this.mTimerAutoForward  = GameSettings.Instance.Quest.WaitTimeScriptEventForward;
         }
         if ((double)this.mTimerAutoForward <= 0.0)
         {
             return;
         }
         this.mTimerAutoForward -= Time.get_deltaTime();
         if ((double)this.mTimerAutoForward > 0.0)
         {
             return;
         }
         bool flag = false;
         for (int index = 0; index < this.Actions.Length; ++index)
         {
             if (this.Actions[index].enabled && this.Actions[index].Forward())
             {
                 flag = true;
             }
         }
         if (flag)
         {
             return;
         }
         this.mTimerAutoForward = 1f;
     }
 }
Beispiel #2
0
        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 (UnityEngine.Object.op_Inequality((UnityEngine.Object)MonoSingleton <GameManager> .GetInstanceDirect(), (UnityEngine.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(!UnityEngine.Object.op_Inequality((UnityEngine.Object) this.BodyText, (UnityEngine.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 (UnityEngine.Object.op_Inequality((UnityEngine.Object) this.BodyText, (UnityEngine.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, EventAction.IsUnManagedAssets(this.VoiceSheetName, false));
                this.mVoice.Play(this.VoiceCueName, 0.0f, false);
                this.VoiceCueName = (string)null;
            }
        }
        public override void OnActivate()
        {
            GameObject actor1 = EventAction.FindActor(this.TargetID);

            if (!Object.op_Equality((Object)actor1, (Object)null))
            {
                this.mTarget = actor1.get_transform();
                if (this.LookAt == EventAction_LookAt2.LookAtTypes.GameObject)
                {
                    GameObject actor2 = EventAction.FindActor(this.LookAtID);
                    if (!Object.op_Equality((Object)actor2, (Object)null))
                    {
                        this.LookAtPosition = actor2.get_transform().get_position();
                    }
                    else
                    {
                        goto label_18;
                    }
                }
                Vector3 vector3 = Vector3.op_Subtraction(this.LookAtPosition, ((Component)this.mTarget).get_transform().get_position());
                if (!this.Rotate3D)
                {
                    vector3.y = (__Null)0.0;
                }
                this.mStartRotation = this.mTarget.get_rotation();
                this.mEndRotation   = Quaternion.LookRotation(vector3);
                if (this.LookAt == EventAction_LookAt2.LookAtTypes.WorldRotate)
                {
                    this.mEndRotation = Quaternion.Euler(this.RotateX, this.RotateY, this.RotateZ);
                }
                // ISSUE: explicit reference operation
                this.mEulerStartRotate = ((Quaternion)@this.mStartRotation).get_eulerAngles();
                // ISSUE: explicit reference operation
                this.mEulerEndRotate = ((Quaternion)@this.mEndRotation).get_eulerAngles();
                if (!this.Reverse)
                {
                    this.mAddEulerAngle   = Vector3.op_Subtraction(this.mEulerEndRotate, this.mEulerStartRotate);
                    this.mAddEulerAngle.x = (double)Mathf.Abs((float)this.mAddEulerAngle.x) > 180.0 || this.mAddEulerAngle.x == 0.0 ? (__Null)(double)this.mAddEulerAngle.x : (__Null)(-(double)Mathf.Sign((float)this.mAddEulerAngle.x) * (360.0 - (double)Mathf.Abs((float)this.mAddEulerAngle.x)));
                    this.mAddEulerAngle.y = (double)Mathf.Abs((float)this.mAddEulerAngle.y) > 180.0 || this.mAddEulerAngle.y == 0.0 ? (__Null)(double)this.mAddEulerAngle.y : (__Null)(-(double)Mathf.Sign((float)this.mAddEulerAngle.y) * (360.0 - (double)Mathf.Abs((float)this.mAddEulerAngle.y)));
                    this.mAddEulerAngle.z = (double)Mathf.Abs((float)this.mAddEulerAngle.z) > 180.0 || this.mAddEulerAngle.z == 0.0 ? (__Null)(double)this.mAddEulerAngle.z : (__Null)(-(double)Mathf.Sign((float)this.mAddEulerAngle.z) * (360.0 - (double)Mathf.Abs((float)this.mAddEulerAngle.z)));
                }
                else
                {
                    this.mAddEulerAngle   = Vector3.op_Subtraction(this.mEulerEndRotate, this.mEulerStartRotate);
                    this.mAddEulerAngle.x = (double)Mathf.Abs((float)this.mAddEulerAngle.x) > 180.0 ? (__Null)(-(double)Mathf.Sign((float)this.mAddEulerAngle.x) * (360.0 - (double)Mathf.Abs((float)this.mAddEulerAngle.x))) : (__Null)(double)this.mAddEulerAngle.x;
                    this.mAddEulerAngle.y = (double)Mathf.Abs((float)this.mAddEulerAngle.y) > 180.0 ? (__Null)(-(double)Mathf.Sign((float)this.mAddEulerAngle.y) * (360.0 - (double)Mathf.Abs((float)this.mAddEulerAngle.y))) : (__Null)(double)this.mAddEulerAngle.y;
                    this.mAddEulerAngle.z = (double)Mathf.Abs((float)this.mAddEulerAngle.z) > 180.0 ? (__Null)(-(double)Mathf.Sign((float)this.mAddEulerAngle.z) * (360.0 - (double)Mathf.Abs((float)this.mAddEulerAngle.z))) : (__Null)(double)this.mAddEulerAngle.z;
                }
                if (this.RotationMode == EventAction_LookAt2.RotationModes.Speed)
                {
                    this.Time = Quaternion.Angle(this.mStartRotation, this.mEndRotation) / this.Speed;
                }
                if ((double)this.Time <= 0.0)
                {
                    this.mTarget.set_rotation(this.mEndRotation);
                }
                else
                {
                    if (!this.Async)
                    {
                        return;
                    }
                    this.ActivateNext(true);
                    return;
                }
            }
label_18:
            this.ActivateNext();
        }