init 1.7.1
This commit is contained in:
@@ -0,0 +1,26 @@
|
||||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using UnityEngine;
|
||||
|
||||
namespace Artngame.SKYMASTER
|
||||
{
|
||||
public class rotateLightSM : MonoBehaviour
|
||||
{
|
||||
|
||||
public float speed = 5.0f;
|
||||
|
||||
private Vector3 lastMousePosition;
|
||||
|
||||
void Update()
|
||||
{
|
||||
Vector3 DTT = (lastMousePosition - Input.mousePosition) * speed * Time.deltaTime ;
|
||||
|
||||
if (Input.GetMouseButton(0) && Input.GetKey(KeyCode.LeftControl))
|
||||
{
|
||||
transform.Rotate(new Vector3(-DTT.y, -DTT.x, 0));
|
||||
}
|
||||
|
||||
lastMousePosition = Input.mousePosition;
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user