Example #1
0
 public void Update()
 {
     if (log)
     {
         UISystem.Log(logStats());
     }
 }
Example #2
0
    public void OnGetMagnitude(Touch touch)
    {
        if (OnUI)
        {
            return;
        }


        if (touch.phase == TouchPhase.Began)
        {
            if (EventSystem.current.IsPointerOverGameObject(touch.fingerId))
            {
                OnUI = true;
                return;
            }
            magPosStart = touch.position;
            //onDirectionStart(touch.position, touch.fingerId);
            return;
        }
        else if (touch.phase == TouchPhase.Ended)
        {
            GameData.saveGameData();
            return;
        }

        GameData.speedMultiplier += ((touch.position.y - magPosStart.y) * 4) / Screen.height;
        GameData.speedMultiplier  = Mathf.Clamp(GameData.speedMultiplier, .05f, 2.5f);
        magPosStart = touch.position;

        UISystem.Log("\nSpeed - " + GameData.speedMultiplier * 100 + "%");
        //OnUpdateDirection(touch.position);
        //LineDrawer_GL.addLine(new Color(1, 1, 1, 0.1f), lineWidth, posStart, currentPos, 4, 8);
    }