// Bring in everything from the ZED Plugin void Start() { planeDetectionManager = FindObjectOfType(typeof(ZEDPlaneDetectionManager)) as ZEDPlaneDetectionManager; planeDetectionManager = planeDetectionManager.GetComponent <ZEDPlaneDetectionManager>(); manager = FindObjectOfType(typeof(ZEDManager)) as ZEDManager; zedCamera = manager.zedCamera; }
/// <summary> /// Awake is used to initialize any variables or game state before the game starts. /// </summary> void Awake() { canspawnbunny = false; tracker = GetComponent <ZEDControllerTracker_DemoInputs>(); zedPlane = FindObjectOfType <ZEDPlaneDetectionManager>(); bunnySpawner = GetComponent <BunnySpawner>(); }
/// <summary> /// Use this for initialization. /// Setting up the variables, and start up states. /// </summary> void Start() { //Find the left camera object if we didn't assign it at start. if (!_leftCamera) { _leftCamera = ZEDManager.Instance.GetLeftCameraTransform().GetComponent <Camera>(); } //we're not moving at start. _moving = false; //Get our Rigidbody component. _rb = GetComponent <Rigidbody>(); //Saving our initial position. _savedPos = transform.position; //Getting the ZEDPlaneDetectionManager.cs component. _zedPlane = FindObjectOfType <ZEDPlaneDetectionManager>(); //If there is a child in position 2, use it as new centerPoint. if (transform.GetChild(2) != null) { _centerPoint = transform.GetChild(2); } else //use this transform. { _centerPoint = transform; } //Get the Animator component. anim = GetComponent <Animator>(); }
// Use this for initialization. void Start() { //Find the left camera object if we didn't assign it at start. if (!leftcamera) { leftcamera = ZEDManager.Instance.GetLeftCameraTransform().GetComponent <Camera>(); } IsMoving = false; //we're not moving at start. //Caching planeManager = FindObjectOfType <ZEDPlaneDetectionManager>(); rb = GetComponent <Rigidbody>(); //Get our Rigidbody component. anim = GetComponent <Animator>(); InitialPosition = transform.position; //Save for calculating distance traveled later. //If there is a child in position 2, use it as new centerPoint. if (transform.GetChild(2) != null) { centerpoint = transform.GetChild(2); } else //If not, use this transform. { centerpoint = transform; } }
public void OnEnable() { planeDetector = (ZEDPlaneDetectionManager)target; addPhysicsOption = serializedObject.FindProperty("addPhysicsOption"); isVisibleInSceneOption = serializedObject.FindProperty("isVisibleInSceneOption"); isVisibleInGameOption = serializedObject.FindProperty("isVisibleInGameOption"); overrideMaterialOption = serializedObject.FindProperty("overrideMaterial"); }
public void OnEnable() { //Assign the serialized properties to their appropriate properties. planeDetector = (ZEDPlaneDetectionManager)target; addPhysicsOption = serializedObject.FindProperty("addPhysicsOption"); isVisibleInSceneOption = serializedObject.FindProperty("isVisibleInSceneOption"); isVisibleInGameOption = serializedObject.FindProperty("isVisibleInGameOption"); overrideMaterialOption = serializedObject.FindProperty("overrideMaterial"); }
/// <summary> /// Awake is used to initialize any variables or game state before the game starts. /// </summary> void Awake() { _canSpawnBunny = false; trackedObj = GetComponent <ZEDControllerTracker>(); zedPlane = FindObjectOfType <ZEDPlaneDetectionManager>(); bunnySpawner = GetComponent <BunnySpawner>(); if (!leftCamera) { leftCamera = ZEDManager.Instance.GetLeftCameraTransform().gameObject.GetComponent <Camera>(); } }
// Start is called before the first frame update void Start() { zpdm = GetComponent <ZEDPlaneDetectionManager>(); }
// Called with GameObject.SendMessage() for the menu. public void toggleUnknownPlanes() { zpdm = getZpdmInstance(); zpdm.blockUnknownPlanes = !zpdm.blockUnknownPlanes; }
// Toggle from the menu UI. Needed for a GameObject.sendMessage() call. public void togglePlaneVisibilityInGame() { zpdm = getZpdmInstance(); zpdm.planesVisibleInGame = !zpdm.planesVisibleInGame; }
// Get the instance of the ZEDPlaneDetectionManager component. // Any other objects that call a method here will not have access to the instance if assigned in Start(). ZEDPlaneDetectionManager getZpdmInstance() { ZEDPlaneDetectionManager zpdm = FindObjectOfType(typeof(ZEDPlaneDetectionManager)) as ZEDPlaneDetectionManager; return(zpdm.GetComponent <ZEDPlaneDetectionManager>()); }
// Start is called before the first frame update // Can be accessed from Update(), but not from methods called with GameObject.sendMessage() void Start() { zpdm = getZpdmInstance(); }
private void Awake() { _manager = GetComponent <ZEDPlaneDetectionManager>(); }