Exemple #1
0
    public static AnimateScale Do(GameObject sub, EZAnimation.ANIM_MODE mode, bool increase, Vector3 begin, Vector3 dest, Vector3 beginPos, Vector3 destPos, EZAnimation.Interpolator interp, float dur, float delay, EZAnimation.CompletionDelegate startDel, EZAnimation.CompletionDelegate del)
    {
        AnimateScale animateScale = (AnimateScale)EZAnimator.instance.GetAnimation(EZAnimation.ANIM_TYPE.Scale);

        animateScale.Start(sub, mode, increase, begin, dest, beginPos, destPos, interp, dur, delay, startDel, del);
        return(animateScale);
    }
Exemple #2
0
        //scale animation

        public void DoScaleAnimation(GameObject gameObject, Vector3 desScale)
        {
            AnimateScale.Do
            (
                gameObject,
                EZAnimation.ANIM_MODE.To,
                desScale,
                EZAnimation.backIn,
                0.1f,
                0,
                null,               // no starting delegate
                null                // no ending delegate
            );
        }
Exemple #3
0
 //scale animation
 public void DoAnimateScale()
 {
     AnimateScale.Do
     (
         roleBG.gameObject,
         EZAnimation.ANIM_MODE.FromTo,
         Vector3.zero,
         Vector3.one,
         EZAnimation.spring,
         0.5f,
         0,
         null,               // no starting delegate
         null                // no ending delegate
     );
 }
    protected override void OnUpdate()
    {
        Entities.ForEach((AnimateScaleAuthoring data) =>
        {
            var entity = GetPrimaryEntity(data);

            var scaleAnimation = new AnimateScale
            {
                From       = data.FromScale,
                To         = data.ToScale,
                Frequency  = 1f / data.Phase,
                PhaseShift = data.Offset * data.Phase,
            };

            DstEntityManager.AddComponentData(entity, scaleAnimation);
            DstEntityManager.AddComponent <NonUniformScale>(entity);
        });
    }
Exemple #5
0
    IEnumerator DoCoroutineAffector()
    {
        _mGameObjectList[0].SetActiveRecursively(true);
        yield return(new WaitForSeconds(0.3f));

        _mGameObjectList[1].SetActiveRecursively(true);
        yield return(new WaitForSeconds(0.3f));

        _mGameObjectList[2].SetActiveRecursively(true);
        _mGameObjectList[3].SetActiveRecursively(true);
        yield return(new WaitForSeconds(0.3f));

        foreach (GameObject go in _mGameObjectList)
        {
            AnimatePosition.Do(go, EZAnimation.ANIM_MODE.To, _mDestPosition,
                               EZAnimation.GetInterpolator(EZAnimation.EASING_TYPE.Linear), 1.0f, 0,
                               EZAnimationStart, EZAnimationEnd);

            AnimateScale.Do(go, EZAnimation.ANIM_MODE.To, _mScale,
                            EZAnimation.GetInterpolator(EZAnimation.EASING_TYPE.Linear), 1.0f, 0,
                            EZAnimationStart, EZAnimationEnd);
        }
    }
Exemple #6
0
    //crit font
    private void ReleaseEffect(Transform parent, Vector3 position, EffectType type, int val, string skillName, Vector3 offset)
    {
        // Vector3 warshipViewPosition = _mainCamera.WorldToViewportPoint(position);
        // Vector3 uiOffset = new Vector3((warshipViewPosition.x - 0.5f) * Screen.width,(warshipViewPosition.y - 0.5f) * Screen.height,100);

        _gobjCrit = new GameObject("BattleCritFont");
        _gobjCrit.transform.position   = position;
        _gobjCrit.transform.parent     = Globals.Instance.MGUIManager.MGUICamera.transform;
        _gobjCrit.transform.localScale = new Vector3(Globals.Instance.MGUIManager.widthRatio,
                                                     Globals.Instance.MGUIManager.heightRatio, 1);
        // _gobjCrit.transform.localPosition = uiOffset + offset;

        PackedSprite effectFont = null;
        SpriteText   textSkill  = null;
        PackedSprite number     = null;

        switch (type)
        {
        case EffectType.CRIT:
            // effectFont = GameObject.Instantiate(effectFontPreb) as PackedSprite;
            // effectFont.transform.parent = _gobjCrit.transform;
            // effectFont.transform.localPosition = new Vector3 (0, 0, 0);
            // effectFont.PlayAnim ("RedCrit");
            // AnimateScale.Do (_gobjCrit, EZAnimation.ANIM_MODE.To, Vector3.one * 2, EZAnimation.linear, AnimScaleDurationTime, 0f, null, null);
            // FadeSpriteAlpha.Do (effectFont, EZAnimation.ANIM_MODE.To, Color.clear, EZAnimation.linear, AnimAlphaDurationTime, AnimAlphaDelayTime, null, DestroyEffectObj);
            break;

        case EffectType.DODGE:
            effectFont = GameObject.Instantiate(effectFontPreb) as PackedSprite;
            effectFont.transform.parent        = _gobjCrit.transform;
            effectFont.transform.localPosition = new Vector3(0, 0, 0);
            effectFont.transform.localScale    = Vector3.one;
            effectFont.PlayAnim("Shan");

            AnimateScale.Do(_gobjCrit, EZAnimation.ANIM_MODE.To, Vector3.one * 2, EZAnimation.linear, AnimScaleDurationTime, 0f, null, null);
            FadeSpriteAlpha.Do(effectFont, EZAnimation.ANIM_MODE.To, Color.clear, EZAnimation.linear, AnimAlphaDurationTime, AnimAlphaDelayTime, null, DestroyEffectObj);

            break;

        case EffectType.SKILL:
            //delay = 0;
            //duration = 6;
            textSkill = GameObject.Instantiate(textSkillPreb) as SpriteText;
            textSkill.transform.parent        = _gobjCrit.transform;
            textSkill.transform.localPosition = new Vector3(0, 0, 0);
            textSkill.transform.localScale    = Vector3.one;
            textSkill.Text = skillName;
            //textSkill.SetColor(new Color32(255,129,54,255));
            // textSkill.SetColor(new Color32(255,255,0,255));
            textSkill.SeaColor = SeaClientColorType.DarkRed210000005;
            //textSkill.SetColor(Color.magenta);
            textSkill.SetCharacterSize(40);
            FadeText.Do(textSkill, EZAnimation.ANIM_MODE.To, Color.clear, EZAnimation.linear, AnimAlphaDurationTime, AnimAlphaDelayTime, null, DestroyEffectObj);
            break;

        case EffectType.CRIT_SKILL:
            //delay = 0;
            //duration = 6;
            // effectFont = GameObject.Instantiate(effectFontPreb) as PackedSprite;
            // effectFont.transform.parent = _gobjCrit.transform;
            // effectFont.transform.localPosition = new Vector3 (0, 20, 0);
            // effectFont.PlayAnim ("RedCrit");
            // //DoAnimationFade (effectFont, DestroyEffectObj);
            // AnimateScale.Do (_gobjCrit, EZAnimation.ANIM_MODE.To, Vector3.one * 1.5f, EZAnimation.linear, AnimScaleDurationTime, 0f, null, null);
            // FadeSpriteAlpha.Do (effectFont, EZAnimation.ANIM_MODE.To, Color.clear, EZAnimation.linear, AnimAlphaDurationTime, AnimAlphaDelayTime, null, DestroyEffectObj);

            textSkill = GameObject.Instantiate(textSkillPreb) as SpriteText;
            textSkill.transform.parent        = _gobjCrit.transform;
            textSkill.transform.localPosition = new Vector3(0, 0, 0);
            textSkill.transform.localScale    = Vector3.one;
            textSkill.Text = skillName;

            // textSkill.SetColor(new Color32(255,255,0,255));
            textSkill.SeaColor = SeaClientColorType.DarkRed210000005;
            //textSkill.SetColor(Color.magenta);
            textSkill.SetCharacterSize(40);
            FadeText.Do(textSkill, EZAnimation.ANIM_MODE.To, Color.clear, EZAnimation.linear, AnimAlphaDurationTime, AnimAlphaDelayTime, null, DestroyEffectObj);

            break;

        case EffectType.NUMBER_GRAY:
            this.PlayAttackNumber(type, "NumMinus", "NumRed", val);
            break;

        case EffectType.NUMBER_RED:
            this.PlayAttackNumber(type, "NumMinus", "NumRed", val);
            break;

        case EffectType.NUMBER_GREEN:
            this.PlayAttackNumber(type, "GreenPlus", "NumGreen", val);
            break;
        }

        if (type == EffectType.CRIT || type == EffectType.CRIT_SKILL || type == EffectType.NUMBER_RED)
        {
            iTween.ShakePosition(_gobjCrit, new Vector3(5, 5, 0), AnimAlphaDurationTime);
            // _gobjCrit.transform.localScale = new Vector3(2.5f,2.5f,1);
        }
    }
        // on menu button..

        public void ShowMenu()
        {
            map.displaycontrol.ApplyToControlOfName("InfoBoxForm*", (c) => { ((GLForm)c).Close(); }); // close any info box forms
            map.displaycontrol.ApplyToControlOfName("MS*", (c) => { c.Visible = false; });            // hide the visiblity of the on screen controls

            int leftmargin = 4;
            int vpos       = 10;
            int ypad       = 10;

            GLForm pform = new GLForm("Galmenu", "Configure Map", new Rectangle(10, 10, 600, 600));

            pform.BackColor  = Color.FromArgb(220, 60, 60, 70);
            pform.ForeColor  = Color.Orange;
            pform.FormClosed = (frm) => { map.displaycontrol.ApplyToControlOfName("MS*", (c) => { c.Visible = true; }); };
            pform.Resizeable = pform.Moveable = false;

            // provide opening animation
            pform.ScaleWindow = new SizeF(0.0f, 0.0f);
            pform.Animators.Add(new AnimateScale(10, 400, true, new SizeF(1, 1)));

            // and closing animation
            pform.FormClosing += (f, e) => {
                e.Handled = true;                                           // stop close
                var ani = new AnimateScale(10, 400, true, new SizeF(0, 0)); // add a close animation
                ani.FinishAction += (a, c, t) => { pform.ForceClose(); };   // when its complete, force close
                pform.Animators.Add(ani);
            };

            {   // top buttons
                GLPanel p3d2d = new GLPanel("3d2d", new Rectangle(leftmargin, vpos, 80, iconsize), Color.Transparent);

                GLCheckBox but3d = new GLCheckBox("3d", new Rectangle(0, 0, iconsize, iconsize), Properties.Resources._3d, null);
                but3d.Checked          = map.gl3dcontroller.MatrixCalc.InPerspectiveMode;
                but3d.ToolTipText      = "3D View";
                but3d.GroupRadioButton = true;
                but3d.MouseClick      += (e1, e2) => { map.gl3dcontroller.ChangePerspectiveMode(true); };
                p3d2d.Add(but3d);

                GLCheckBox but2d = new GLCheckBox("2d", new Rectangle(50, 0, iconsize, iconsize), Properties.Resources._2d, null);
                but2d.Checked          = !map.gl3dcontroller.MatrixCalc.InPerspectiveMode;
                but2d.ToolTipText      = "2D View";
                but2d.GroupRadioButton = true;
                but2d.MouseClick      += (e1, e2) => { map.gl3dcontroller.ChangePerspectiveMode(false); };
                p3d2d.Add(but2d);

                pform.Add(p3d2d);

                GLCheckBox butelite = new GLCheckBox("Elite", new Rectangle(100, vpos, iconsize, iconsize), Properties.Resources.EliteMovement, null);
                butelite.ToolTipText   = "Select elite movement (on Y plain)";
                butelite.Checked       = map.gl3dcontroller.YHoldMovement;
                butelite.CheckChanged += (e1) => { map.gl3dcontroller.YHoldMovement = butelite.Checked; };
                pform.Add(butelite);

                GLCheckBox butgal = new GLCheckBox("Galaxy", new Rectangle(150, vpos, iconsize, iconsize), Properties.Resources.ShowGalaxy, null);
                butgal.ToolTipText   = "Show galaxy image";
                butgal.Checked       = map.GalaxyDisplay;
                butgal.CheckChanged += (e1) => { map.GalaxyDisplay = butgal.Checked; };
                pform.Add(butgal);

                GLCheckBox butsd = new GLCheckBox("StarDots", new Rectangle(200, vpos, iconsize, iconsize), Properties.Resources.StarDots, null);
                butsd.ToolTipText   = "Show star field";
                butsd.Checked       = map.StarDotsDisplay;
                butsd.CheckChanged += (e1) => { map.StarDotsDisplay = butsd.Checked; };
                pform.Add(butsd);

                vpos += butgal.Height + ypad;
            }

            {
                GLGroupBox tpgb = new GLGroupBox("TravelPathGB", "Travel Path", new Rectangle(leftmargin, vpos, pform.ClientWidth - leftmargin * 2, iconsize * 2));
                tpgb.BackColor = pform.BackColor;
                tpgb.ForeColor = Color.Orange;
                pform.Add(tpgb);

                GLCheckBox buttp = new GLCheckBox("TravelPath", new Rectangle(leftmargin, 0, iconsize, iconsize), Properties.Resources.StarDots, null);
                buttp.ToolTipText   = "Show travel path";
                buttp.Checked       = map.TravelPathDisplay;
                buttp.CheckChanged += (e1) => { map.TravelPathDisplay = buttp.Checked; };
                tpgb.Add(buttp);

                GLDateTimePicker dtps = new GLDateTimePicker("TPStart", new Rectangle(50, 0, 250, 30), DateTime.Now);
                dtps.Font          = new Font("Ms Sans Serif", 8.25f);
                dtps.ShowCheckBox  = dtps.ShowCalendar = true;
                dtps.Value         = map.TravelPathStartDate;
                dtps.Checked       = map.TravelPathStartDateEnable;
                dtps.ValueChanged += (e1) => { map.TravelPathStartDate = dtps.Value; map.TravelPathRefresh(); };
                dtps.CheckChanged += (e1) => { map.TravelPathStartDateEnable = dtps.Checked; map.TravelPathRefresh(); };
                dtps.ShowUpDown    = true;
                tpgb.Add(dtps);

                GLDateTimePicker dtpe = new GLDateTimePicker("TPEnd", new Rectangle(320, 0, 250, 30), DateTime.Now);
                dtpe.Font          = new Font("Ms Sans Serif", 8.25f);
                dtpe.ShowCheckBox  = dtps.ShowCalendar = true;
                dtpe.Value         = map.TravelPathEndDate;
                dtpe.Checked       = map.TravelPathEndDateEnable;
                dtpe.ValueChanged += (e1) => { map.TravelPathEndDate = dtpe.Value; map.TravelPathRefresh(); };
                dtpe.CheckChanged += (e1) => { map.TravelPathEndDateEnable = dtpe.Checked; map.TravelPathRefresh(); };
                dtpe.ShowUpDown    = true;
                tpgb.Add(dtpe);


                vpos += tpgb.Height + ypad;
            }

            { // Galaxy objects
                GLGroupBox galgb = new GLGroupBox("GalGB", "Galaxy Objects", new Rectangle(leftmargin, vpos, pform.ClientWidth - leftmargin * 2, 50));
                galgb.ClientHeight = (iconsize + 4) * 2;
                galgb.BackColor    = pform.BackColor;
                galgb.ForeColor    = Color.Orange;
                pform.Add(galgb);
                GLFlowLayoutPanel galfp = new GLFlowLayoutPanel("GALFP", DockingType.Fill, 0);
                galfp.FlowPadding = new PaddingType(2, 2, 2, 2);
                galfp.BackColor   = pform.BackColor;
                galgb.Add(galfp);

                for (int i = map.edsmmapping.RenderableMapTypes.Length - 1; i >= 0; i--)
                {
                    var        gt   = map.edsmmapping.RenderableMapTypes[i];
                    bool       en   = map.GetGalObjectTypeEnable(gt.Typeid);
                    GLCheckBox butg = new GLCheckBox("GMSEL" + i, new Rectangle(0, 0, iconsize, iconsize), gt.Image, null);
                    butg.ToolTipText   = "Enable/Disable " + gt.Description;
                    butg.Checked       = en;
                    butg.CheckChanged += (e1) =>
                    {
                        map.SetGalObjectTypeEnable(gt.Typeid, butg.Checked);
                    };
                    galfp.Add(butg);
                }

                GLCheckBox butgonoff = new GLCheckBox("GMONOFF", new Rectangle(0, 0, iconsize, iconsize), Properties.Resources.dotted, null);
                butgonoff.ToolTipText   = "Enable/Disable Display";
                butgonoff.Checked       = map.GalObjectDisplay;
                butgonoff.CheckChanged += (e1) => { map.GalObjectDisplay = !map.GalObjectDisplay; };
                galfp.Add(butgonoff);

                vpos += galgb.Height + ypad;
            }

            { // EDSM regions
                GLGroupBox edsmregionsgb = new GLGroupBox("EDSMR", "EDSM Regions", new Rectangle(leftmargin, vpos, pform.ClientWidth - leftmargin * 2, 50));
                edsmregionsgb.ClientHeight = iconsize + 8;
                edsmregionsgb.BackColor    = pform.BackColor;
                edsmregionsgb.ForeColor    = Color.Orange;
                pform.Add(edsmregionsgb);
                vpos += edsmregionsgb.Height + ypad;

                GLCheckBox butedre = new GLCheckBox("EDSMRE", new Rectangle(leftmargin, 0, iconsize, iconsize), Properties.Resources.ShowGalaxy, null);
                butedre.ToolTipText      = "Enable EDSM Regions";
                butedre.Checked          = map.EDSMRegionsEnable;
                butedre.UserCanOnlyCheck = true;
                edsmregionsgb.Add(butedre);

                GLCheckBox buted2 = new GLCheckBox("EDSMR2", new Rectangle(50, 0, iconsize, iconsize), Properties.Resources.ShowGalaxy, null);
                buted2.Checked       = map.EDSMRegionsOutlineEnable;
                buted2.Enabled       = map.EDSMRegionsEnable;
                buted2.ToolTipText   = "Enable Region Outlines";
                buted2.CheckChanged += (e1) => { map.EDSMRegionsOutlineEnable = !map.EDSMRegionsOutlineEnable; };
                edsmregionsgb.Add(buted2);

                GLCheckBox buted3 = new GLCheckBox("EDSMR3", new Rectangle(100, 0, iconsize, iconsize), Properties.Resources.ShowGalaxy, null);
                buted3.Checked       = map.EDSMRegionsShadingEnable;
                buted3.Enabled       = map.EDSMRegionsEnable;
                buted3.ToolTipText   = "Enable Region Shading";
                buted3.CheckChanged += (e1) => { map.EDSMRegionsShadingEnable = !map.EDSMRegionsShadingEnable; };
                edsmregionsgb.Add(buted3);

                GLCheckBox buted4 = new GLCheckBox("EDSMR4", new Rectangle(150, 0, iconsize, iconsize), Properties.Resources.ShowGalaxy, null);
                buted4.Checked       = map.EDSMRegionsTextEnable;
                buted4.Enabled       = map.EDSMRegionsEnable;
                buted4.ToolTipText   = "Enable Region Naming";
                buted4.CheckChanged += (e1) => { map.EDSMRegionsTextEnable = !map.EDSMRegionsTextEnable; };
                edsmregionsgb.Add(buted4);

                // elite regions

                GLGroupBox eliteregionsgb = new GLGroupBox("ELITER", "Elite Regions", new Rectangle(leftmargin, vpos, pform.ClientWidth - leftmargin * 2, 50));
                eliteregionsgb.ClientHeight = iconsize + 8;
                eliteregionsgb.BackColor    = pform.BackColor;
                eliteregionsgb.ForeColor    = Color.Orange;
                pform.Add(eliteregionsgb);
                vpos += eliteregionsgb.Height + ypad;

                GLCheckBox butelre = new GLCheckBox("ELITERE", new Rectangle(leftmargin, 0, iconsize, iconsize), Properties.Resources.ShowGalaxy, null);
                butelre.ToolTipText      = "Enable Elite Regions";
                butelre.Checked          = map.EliteRegionsEnable;
                butelre.UserCanOnlyCheck = true;
                eliteregionsgb.Add(butelre);

                GLCheckBox butel2 = new GLCheckBox("ELITER2", new Rectangle(50, 0, iconsize, iconsize), Properties.Resources.ShowGalaxy, null);
                butel2.Checked       = map.EliteRegionsOutlineEnable;
                butel2.Enabled       = map.EliteRegionsEnable;
                butel2.ToolTipText   = "Enable Region Outlines";
                butel2.CheckChanged += (e1) => { map.EliteRegionsOutlineEnable = !map.EliteRegionsOutlineEnable; };
                eliteregionsgb.Add(butel2);

                GLCheckBox butel3 = new GLCheckBox("ELITER3", new Rectangle(100, 0, iconsize, iconsize), Properties.Resources.ShowGalaxy, null);
                butel3.Checked       = map.EliteRegionsShadingEnable;
                butel3.Enabled       = map.EliteRegionsEnable;
                butel3.ToolTipText   = "Enable Region Shading";
                butel3.CheckChanged += (e1) => { map.EliteRegionsShadingEnable = !map.EliteRegionsShadingEnable; };
                eliteregionsgb.Add(butel3);

                GLCheckBox butel4 = new GLCheckBox("ELITER4", new Rectangle(150, 0, iconsize, iconsize), Properties.Resources.ShowGalaxy, null);
                butel4.Checked       = map.EliteRegionsTextEnable;
                butel4.Enabled       = map.EliteRegionsEnable;
                butel4.ToolTipText   = "Enable Region Naming";
                butel4.CheckChanged += (e1) => { map.EliteRegionsTextEnable = !map.EliteRegionsTextEnable; };
                eliteregionsgb.Add(butel4);

                butedre.CheckChanged += (e) =>
                {
                    if (e.Name == "EDSMRE")
                    {
                        butelre.CheckedNoChangeEvent = !butedre.Checked;
                    }
                    else
                    {
                        butedre.CheckedNoChangeEvent = !butelre.Checked;
                    }

                    map.EDSMRegionsEnable  = butedre.Checked;
                    map.EliteRegionsEnable = butelre.Checked;

                    buted2.Enabled = buted3.Enabled = buted4.Enabled = butedre.Checked;
                    butel2.Enabled = butel3.Enabled = butel4.Enabled = butelre.Checked;
                };

                butelre.CheckChanged += butedre.CheckChanged;
            }

            map.displaycontrol.Add(pform);
        }
Exemple #8
0
    public override void OnInput(ref POINTER_INFO ptr)
    {
        if (this.deleted)
        {
            return;
        }
        if (!this.m_controlIsEnabled || base.IsHidden())
        {
            base.OnInput(ref ptr);
            return;
        }
        if (this.inputDelegate != null)
        {
            this.inputDelegate(ref ptr);
        }
        if (!this.m_controlIsEnabled || base.IsHidden())
        {
            base.OnInput(ref ptr);
            return;
        }
        switch (ptr.evt)
        {
        case POINTER_INFO.INPUT_EVENT.PRESS:
        case POINTER_INFO.INPUT_EVENT.DRAG:
            if (!this.IsListButton)
            {
                this.SetControlState(UIButton.CONTROL_STATE.ACTIVE);
            }
            if (this.AvtiveColorText != string.Empty && this.BaseString != string.Empty && this.AvtiveColorText != base.ColorText)
            {
                base.ColorText = this.AvtiveColorText;
                this.Text      = this.BaseString;
            }
            if (ptr.evt == POINTER_INFO.INPUT_EVENT.PRESS)
            {
                if (this.mouseDownDelegate != null)
                {
                    this.mouseDownDelegate(this);
                }
                if (this.bEffectAni && !this.bStartAni)
                {
                    Vector3 one = Vector3.one;
                    if (0f > base.transform.localScale.x)
                    {
                        one.x *= -1f;
                    }
                    if (0f > base.transform.localScale.y)
                    {
                        one.y *= -1f;
                    }
                    if (0f > base.transform.localScale.z)
                    {
                        one.z *= -1f;
                    }
                    AnimateScale.Do(base.gameObject, EZAnimation.ANIM_MODE.FromTo, this.width, this.height, base.transform.localScale, new Vector3(0.85f * one.x, 0.85f * one.y, 0.85f * one.z), EZAnimation.GetInterpolator(EZAnimation.EASING_TYPE.BackOut), 0.2f, 0f, new EZAnimation.CompletionDelegate(base.EffectAniStartDelegate), new EZAnimation.CompletionDelegate(base.EffectAniCompletionDelegate));
                }
            }
            break;

        case POINTER_INFO.INPUT_EVENT.DOUBLE_PRESS:
            if (!this.IsListButton)
            {
                this.SetControlState(UIButton.CONTROL_STATE.ACTIVE);
            }
            if (this.doubleClickDelegate != null)
            {
                this.doubleClickDelegate(this);
            }
            break;

        case POINTER_INFO.INPUT_EVENT.RIGHT_PRESS:
            if (!this.IsListButton)
            {
                this.SetControlState(UIButton.CONTROL_STATE.ACTIVE);
            }
            if (this.rightMouseDelegate != null)
            {
                this.rightMouseDelegate(this);
            }
            break;

        case POINTER_INFO.INPUT_EVENT.RELEASE:
        case POINTER_INFO.INPUT_EVENT.TAP:
        case POINTER_INFO.INPUT_EVENT.LONG_TAP:
            if (!this.IsListButton)
            {
                this.SetControlState(UIButton.CONTROL_STATE.NORMAL);
            }
            break;

        case POINTER_INFO.INPUT_EVENT.RIGHT_RELEASE:
        case POINTER_INFO.INPUT_EVENT.RIGHT_TAP:
            if (ptr.type != POINTER_INFO.POINTER_TYPE.TOUCHPAD && ptr.hitInfo.collider == base.collider)
            {
                if (!this.IsListButton)
                {
                    this.SetControlState(UIButton.CONTROL_STATE.OVER);
                }
            }
            else if (!this.IsListButton)
            {
                this.SetControlState(UIButton.CONTROL_STATE.NORMAL);
            }
            break;

        case POINTER_INFO.INPUT_EVENT.MOVE:
            if (this.m_ctrlState != UIButton.CONTROL_STATE.OVER)
            {
                if (!this.IsListButton)
                {
                    this.SetControlState(UIButton.CONTROL_STATE.OVER);
                }
                if (this.OverColorText != string.Empty && this.OverColorText != base.ColorText)
                {
                    this.NormalColorText = base.ColorText;
                    base.ColorText       = this.OverColorText;
                    this.Text            = this.BaseString;
                }
                if (this.soundOnOver != null)
                {
                    this.soundOnOver.PlayOneShot(this.soundOnOver.clip);
                }
                if (this.mouseOverDelegate != null)
                {
                    this.mouseOverDelegate(this);
                }
            }
            break;

        case POINTER_INFO.INPUT_EVENT.MOVE_OFF:
        case POINTER_INFO.INPUT_EVENT.RELEASE_OFF:
            if (this.m_ctrlState != UIButton.CONTROL_STATE.NORMAL && this.mouseOutDelegate != null)
            {
                this.mouseOutDelegate(this);
            }
            if (!this.IsListButton)
            {
                this.SetControlState(UIButton.CONTROL_STATE.NORMAL);
            }
            if (this.NormalColorText != string.Empty && this.BaseString != string.Empty && this.NormalColorText != base.ColorText)
            {
                base.ColorText = this.NormalColorText;
                this.Text      = this.BaseString;
            }
            break;
        }
        base.OnInput(ref ptr);
        if (this.repeat)
        {
            if (this.m_ctrlState == UIButton.CONTROL_STATE.ACTIVE)
            {
                goto IL_4A2;
            }
        }
        else if (ptr.evt == this.whenToInvoke)
        {
            goto IL_4A2;
        }
        return;

IL_4A2:
        if (ptr.evt == this.whenToInvoke && this.soundOnClick != null)
        {
            this.soundOnClick.PlayOneShot(this.soundOnClick.clip);
        }
        if (this.scriptWithMethodToInvoke != null)
        {
            this.scriptWithMethodToInvoke.Invoke(this.methodToInvoke, this.delay);
        }
        if (this.changeDelegate != null)
        {
            this.changeDelegate(this);
            if (this.bUseDefaultSound)
            {
                MsgHandler.Handle("ButtonSound", new object[0]);
            }
        }
    }