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.
34 lines
786 B
34 lines
786 B
using System.Collections; |
|
using System.Collections.Generic; |
|
using UnityEngine; |
|
|
|
/// <summary> |
|
/// 战术模型对象的旋转 |
|
/// </summary> |
|
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); |
|
} |
|
} |
|
|
|
} |
|
}
|
|
|