我想利用unity脚本控制物体旋转,三维方向的旋转角度分别是txt文件中的前三组数,请问是哪里出问题了,应该怎么写?
附图1
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using System.IO;
public class wristA : MonoBehaviour
{
private void RotateDynamic(float a, float b, float c);
private string[] strArray;// Use this for initialization
void Start()
{
StreamReader sr = new StreamReader(@"C:\\Users\\14586\\Desktop\\data1.txt");
string[] line1 = sr.ReadLine().Split(',');
a = double.Parse(line1[1]);
b = double.Parse(line1[2]);
c = double.Parse(line1[3]);
}
// Update is called once per frame
void Update()
{
transform.Rotate(0, a, 0, Space.Self);
transform.Rotate(b, 0, 0, Space.Self);
transform.Rotate(0, 0, c, Space.Self);
}
}