[TASK] Initial commit with basic product setup

This commit is contained in:
2019-08-18 13:50:14 +02:00
commit 01a66a8e1f
2548 changed files with 167528 additions and 0 deletions

View File

@@ -0,0 +1,33 @@
namespace Mapbox.Examples
{
using UnityEngine;
namespace Scripts.Utilities
{
public class DragRotate : MonoBehaviour
{
[SerializeField]
Transform _objectToRotate;
[SerializeField]
float _multiplier;
Vector3 _startTouchPosition;
void Update()
{
if (Input.GetMouseButtonDown(0))
{
_startTouchPosition = Input.mousePosition;
}
if (Input.GetMouseButton(0))
{
var dragDelta = Input.mousePosition - _startTouchPosition;
var axis = new Vector3(0f, -dragDelta.x * _multiplier, 0f);
_objectToRotate.RotateAround(_objectToRotate.position, axis, _multiplier);
}
}
}
}
}