iLMS知識社群歷程檔登入
位置: 黃國哲 > Unity
1091226 重設視角
by 黃國哲 2020-12-26 22:39:43, 回應(0), 人氣(412)

使用的語法為:
controller4.transform.localEulerAngles = new Vector3(0,0,0);


using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.UI;

public class 重設視角 : MonoBehaviour
{   
    public GameObject controller4 ;
    public GameObject controller5 ;
    // Start is called before the first frame update
    void Start()
    {
        
    }

    // Update is called once per frame
    void Update()
    {
        
    }

   public void resetanglebtn () 
   
    {controller4.transform.localEulerAngles = new Vector3(0,0,0);
    controller5.transform.localEulerAngles = new Vector3(0,0,0);}
}

回應