Beispiel #1
0
 void Update()
 {
     if (Dragged)
     {
         CheckDegree();
         PlayerCtrl.MakeMove(ToNewPositionX * Time.deltaTime, ToNewPositionY * Time.deltaTime);
     }
 }
Beispiel #2
0
    private void UpdateVirtualAxes(Vector3 value)
    {
        var delta = startPos - value;

        delta.y = -delta.y;
        delta  /= MovementRange;
        if (useX)
        {
            PlayerCtrl.MakeMove(delta.x, 0);
            horizontalVirtualAxis.Update(-delta.x);
        }

        if (useY)
        {
            PlayerCtrl.MakeMove(0, delta.y);
            verticalVirtualAxis.Update(delta.y);
        }
    }