예제 #1
0
        public override void FromTo(ShapeBase shape)
        {
            if (shape == null)
            {
                return;
            }
            base.FromTo(shape);
            ShapeDynamicTextBase other = shape as ShapeDynamicTextBase;

            if (other != null)
            {
                _Align = other._Align;
                //_BitCount = other._BitCount;
                _RollRate      = other._RollRate;
                _RollWay       = other._RollWay;
                _Valign        = other._Valign;
                FrameSizeFixed = other.FrameSizeFixed;
                FontSizeFixed  = other.FontSizeFixed;
            }
        }
    void Update()
    {
        if (RightRoll == LeftRoll)
        {
            RightRoll = LeftRoll = false;
        }
        else
        if (!RollerFlag)
        {
            if (LeftRoll)
            {
                rollWay = RollWay.left;
            }
            if (RightRoll)
            {
                rollWay = RollWay.right;
            }

            RollerFlag = true;
        }
    }
    void Roll()
    {
        if (audioFlag)
        {
            audioFlag  = false;
            audio.loop = true;
            audio.clip = aclip_rot;
            audio.Play();
        }
        var rottime = 0.02f * RotateSpeed;

        timer += rottime;

        if (rollWay == RollWay.right)
        {
            cam_root.transform.Rotate(new Vector3(0, 0, (int)rollAngle) * rottime);
        }
        if (rollWay == RollWay.left)
        {
            cam_root.transform.Rotate(new Vector3(0, 0, -(int)rollAngle) * rottime);
        }
        Physics2D.gravity = localGravity.y * cam_root.up;

        if (timer >= 1)
        {
            timer      = 0;
            RollerFlag = false;
            RightRoll  = false;
            LeftRoll   = false;
            rollWay    = RollWay.normal;
            if (!audioFlag)
            {
                audio.Stop();
                audioFlag  = true;
                audio.loop = false;
                audio.clip = aclip_end;
                audio.Play();
            }
        }
    }