编译器版本是2021.3.8f1c1
如下
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class CAMERA : MonoBehaviour
{
// Start is called before the first frame update
void Start()
{
Quaternion a = Quaternion.Eular(0, 30, 0);
}
// Update is called once per frame
void Update()
{
}
}
按照官方api给的写法是没有问题的,但是为什么控制台却显示
Assets\CAMERA.cs(10,35): error CS0117: 'Quaternion' does not contain a definition for 'Eular'
是你拼错了,肯定会报不存在语法的错,正确是Quaternion a=Quaternion.Euler(0,30,0);
Quaternion.Euler(ex, ey, ez);