Beispiel #1
0
 // Use this for initialization
 void Start()
 {
     HandPool = GetComponent <HandPool>();
     disableAllGroups();
     CurrentGroup = 7;                    // 连接 Local 手模型
     HandPool.ToggleGroup(GroupNames[6]); // 连接 Remote 手模型
     HandPool.ToggleGroup(GroupNames[8]); // 连接 物理 手模型
 }
 // Update is called once per frame
 void Update()
 {
     if (Input.GetKeyUp(KeyCode.RightArrow))
     {
         if (CurrentGroup < GroupNames.Length - 1)
         {
             CurrentGroup++;
         }
     }
     if (Input.GetKeyUp(KeyCode.LeftArrow))
     {
         if (CurrentGroup > 0)
         {
             CurrentGroup--;
         }
     }
     for (int i = 0; i < keyCodes.Length; i++)
     {
         if (Input.GetKeyDown(keyCodes[i]))
         {
             HandPool.ToggleGroup(GroupNames[i]);
         }
     }
     if (Input.GetKeyUp(KeyCode.Alpha0))
     {
         disableAllGroups();
     }
 }
    private IEnumerator waitToSwitch(int group)
    {
        yield return(new WaitForEndOfFrame());

        handPool.ToggleGroup(GroupNames[group]);
    }