using System.Collections; using System.Collections.Generic; using UnityEngine; /// /// 战术模型对象的旋转 /// public class ObjRotated : MonoBehaviour { public float rotateSpeed = 60; // Use this for initialization void Start () { } // Update is called once per frame void Update () { if (SelectedObjs.selectedObj == gameObject.transform.parent.gameObject) { if (Input.GetKeyDown(KeyCode.A)) { transform.parent.Rotate(0, -Time.deltaTime * rotateSpeed, 0, Space.World); } if (Input.GetKeyDown(KeyCode.D)) { transform.parent.Rotate(0, Time.deltaTime * rotateSpeed, 0, Space.World); } } } }