2019年3月26日 星期二

Week06 光

試著用Treesize看匯入Unity的資源大小
選擇steamVR plugin要匯入的部分



程式碼:
按下Trigger 得到Trigger的數值
按下Trigger 製造一顆球
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using Valve.VR;

public class myCode : MonoBehaviour
{
       public SteamVR_Action_Boolean myTrigger;
     
       public GameObject mySphere;
       public GameObject  myController;
       float x=0;

       bool state=false;
       void Update()
       {
               if(myTrigger.GetState(SteamVR_Input_Sources.Any)   ){
                     if(state==false){                   
                     print("yes");
                     GameObject now = Instantiate(mySphere);
                     //now.transform.position = new Vector3(x,0,0);
                     //x++;
                     now.transform.position = myController.transform.position;
                     }else{
                           state=false;
                     }
               }
       }
}



沒有留言:

張貼留言