Ejemplo n.º 1
0
        /// <summary>
        /// 提示完成的事件
        /// </summary>
        /// <param name="value"></param>
        void tip_TipCompleted(double value)
        {
            if (this.action.ConfirmOne)
            {
                if ((sublineVGeometry.End.Y - sublineVGeometry.Start.Y) > 0)
                {
                    this.action.SetResult(value);
                }
                else
                {
                    this.action.SetResult(-value);
                }
            }
            else
            {
                if ((sublineHGeometry.End.X - sublineHGeometry.Start.X) > 0)
                {
                    this.action.SetResult(value);
                }
                else
                {
                    this.action.SetResult(-value);
                }
            }


            if (this.action.ConfirmOne)
            {
                sublineHGeometry.ShowSize = true;
                sublineVGeometry.ShowSize = false;
                Tip.SetText(sublineVGeometry.TextValue, sublineHGeometry.TextPosition, sublineHGeometry.TextAngle);
            }
        }
Ejemplo n.º 2
0
    public void AddTip(float _time, string _text)
    {
        GameObject obj = Instantiate(tip_prefab, transform);
        Tip        tip = obj.GetComponent <Tip>();

        tip.Init(this);
        tip.SetTime(_time);
        tip.SetText(_text);
        obj.SetActive(false);
        object_pool.Enqueue(obj);
    }
Ejemplo n.º 3
0
        private void A_DrawEraseEvent(ActionEventArgs gs)
        {
            RectangleGeometry rectangle = this.action.Geometry as RectangleGeometry;
            var start = rectangle.Start;
            var end   = rectangle.End;

            sublineHGeometry.Start = start;
            sublineHGeometry.End   = Vector2D.Create(end.X, start.Y);
            sublineHGeometry.Update();

            sublineVGeometry.Start = start;
            sublineVGeometry.End   = Vector2D.Create(start.X, end.Y);
            sublineVGeometry.Update();

            if (!action.ConfirmOne)
            {
                Tip.SetText(sublineHGeometry.TextValue, sublineHGeometry.TextPosition, sublineHGeometry.TextAngle);
            }
            else
            {
                Tip.SetText(sublineVGeometry.TextValue, sublineVGeometry.TextPosition, sublineVGeometry.TextAngle);
            }
        }
Ejemplo n.º 4
0
        private void A_DrawEraseEvent(ActionEventArgs gs)
        {
            EllipseGeometry ellipse = this.action.Geometry as EllipseGeometry;
            var             start   = ellipse.Central;
            var             end     = ellipse.Reference;

            sublineHGeometry.Start = start;
            sublineHGeometry.End   = Vector2D.Create(end.X, start.Y);
            sublineHGeometry.Update();

            sublineVGeometry.Start = start;
            sublineVGeometry.End   = Vector2D.Create(start.X, end.Y);
            sublineVGeometry.Update();

            if (!action.ConfirmOne)
            {
                Tip.SetText(sublineHGeometry.TextValue, sublineHGeometry.TextPosition, sublineHGeometry.TextAngle);
            }
            else
            {
                Tip.SetText(sublineVGeometry.TextValue, sublineVGeometry.TextPosition, sublineVGeometry.TextAngle);
            }
        }