我得到的代碼的最後一行這個錯誤,不知道如何轉換如何轉換UnityEngine.Transform到Media3d.Transform3d
Cannot implicitly convert type 'UnityEngine.Transform' to 'System.Windows.Media.Media3D.Transform3D'
這是代碼:
private void Window_Loaded_1(object sender, RoutedEventArgs e)
{
rotire rot = new rotire();
rot.rotiree();
mycube.Transform = rot.transform;
}
這是方法:
public void rotiree()
{
transform.Rotate(new Vector3(15,40,45)*speed,Time.deltaTime);
}
編輯: Rotire類包含一個方法旋轉的cube.The名方法是 「rotire」
多維數據集在XAML做出
rotire.cs
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using UnityEngine;
using System.Collections;
namespace WpfApplication6
{
class Rotire:MonoBehaviour
{
float speed=10f;
public void rotire()
{
transform.Rotate(new Vector3(15,40,45)*speed,Time.deltaTime);
}
}
}
什麼是「rotire」類(爲什麼它的名字以小寫字母開頭)?什麼是mycube類? 「轉換」成員是什麼類型? – MarioDS