You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
33 lines
886 B
33 lines
886 B
using System;
|
|
using System.Collections;
|
|
using System.Collections.Generic;
|
|
using System.Diagnostics;
|
|
using UnityEngine;
|
|
using Debug = UnityEngine.Debug;
|
|
|
|
/// <summary>
|
|
/// 物体旋转展示
|
|
/// </summary>
|
|
public class GameObjectRotation : MonoBehaviour
|
|
{
|
|
public Vector2 rotationSpeed;
|
|
|
|
private void Awake()
|
|
{
|
|
GameStageManager.Instance.stageDict[GameStage.展示].OnUpdateAdd += () =>
|
|
{
|
|
if (Input.GetMouseButton(0))
|
|
{
|
|
if (Math.Abs(Input.GetAxis("Mouse X")) >= Math.Abs(Input.GetAxis("Mouse Y")))
|
|
{
|
|
transform.Rotate(0,-Input.GetAxis("Mouse X") * rotationSpeed.x,0,Space.World);
|
|
}
|
|
else
|
|
{
|
|
transform.Rotate(Input.GetAxis("Mouse Y") * rotationSpeed.y,0,0,Space.World);
|
|
}
|
|
}
|
|
};
|
|
}
|
|
}
|