using System; using System.Collections; using System.Collections.Generic; using System.Diagnostics; using UnityEngine; using Debug = UnityEngine.Debug; /// /// 物体旋转展示 /// 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); } } }; } }