This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using UnityEngine; | |
using UnityEngine.AI; | |
public class PlayerBrain : CharacterBrain | |
{ | |
public PlayerBrain(NavMeshAgent navMeshAgent) : base(navMeshAgent) | |
{ | |
navMeshAgent.GetComponent<Renderer>().material.color = Color.green; | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using UnityEngine.AI; | |
public abstract class CharacterBrain | |
{ | |
protected NavMeshAgent navMeshAgent; | |
public CharacterBrain(NavMeshAgent navMeshAgent) | |
{ | |
this.navMeshAgent = navMeshAgent; | |
navMeshAgent.SetDestination(navMeshAgent.transform.position); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using UnityEngine; | |
using UnityEngine.AI; | |
public class AIBrain : CharacterBrain | |
{ | |
public AIBrain(NavMeshAgent navMeshAgent) : base(navMeshAgent) | |
{ | |
navMeshAgent.GetComponent<Renderer>().material.color = Color.white; | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using System.Collections; | |
using System.Collections.Generic; | |
using UnityEngine; | |
using UnityEditor; | |
using UnityEditor.Experimental.Animations; | |
public class HierarchyRecorder : MonoBehaviour | |
{ | |
// The clip the recording is going to be saved to. | |
public AnimationClip clip; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using UnityEngine; | |
public class AutoScaler : MonoBehaviour | |
{ | |
[SerializeField] | |
private float defaultHeight = 1.8f; | |
[SerializeField] | |
private Camera camera; | |
private void Resize() |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// New method | |
Debug.Log($"{character.gameObject.name} handling puck held by changed - held by={puckHeldBy?.gameObject?.name}"); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Old Method | |
Debug.Log(string.Format("{0} handling puck held by changed - held by={1}", | |
character.gameObject.name, | |
puckHeldBy == null ? "" : puckHeldBy.gameObject.name)); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Assign out any additional controllers only after both left and right have been assigned. | |
//if (leftIndex != OpenVR.k_unTrackedDeviceIndexInvalid && rightIndex != OpenVR.k_unTrackedDeviceIndexInvalid) | |
{ | |
for (uint deviceIndex = 0; deviceIndex < connected.Length; deviceIndex++) | |
{ | |
if (objectIndex >= objects.Length) | |
break; | |
if (!connected[deviceIndex]) | |
continue; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using UnityEngine; | |
public class TriggerTester : MonoBehaviour | |
{ | |
private SteamVR_TrackedObject trackedObject; | |
[SerializeField] | |
private bool trigger; | |
[SerializeField] | |
private bool trackpad; |