void Start() { leftArrow = GameObject.Find("LeftArrow").GetComponent <DirrectionLightUp>(); rightArrow = GameObject.Find("RightArrow").GetComponent <DirrectionLightUp>(); upArrow = GameObject.Find("UpArrow").GetComponent <DirrectionLightUp>(); downArrow = GameObject.Find("DownArrow").GetComponent <DirrectionLightUp>(); cameraStartingPosition = transform.position; cameraStartingRotation = transform.rotation; delegateReference = new LeapEventDelegate(parseFrameAndRotate); cameraMovementVector = new Vector3(0, 0, 0); cameraRotationVector = new Vector3(0, 0, 0); fingerVectors = new Vector3[5]; GameObject ballGameObject = GameObject.Find("Ball"); if (ballGameObject != null) { ball = ballGameObject.transform; ballsRigidbody = ball.GetComponent <Rigidbody>(); } leftHandControllerTransform = GameObject.FindGameObjectWithTag("LeftHand").transform; rightHandControllerTransform = GameObject.FindGameObjectWithTag("RightHand").transform; leftHandController = leftHandControllerTransform.gameObject.GetComponent <HandController>(); rightHandController = rightHandControllerTransform.gameObject.GetComponent <HandController>(); leftHandControllerStartingPosition = leftHandControllerTransform.position; leftHandControllerStartingRotation = leftHandControllerTransform.rotation; rightHandControllerStartingPosition = rightHandControllerTransform.position; rightHandControllerStartingRotation = rightHandControllerTransform.rotation; BallsSpeed = 150f; offset = 0; }
void Start() { leftArrow = GameObject.Find("LeftArrow").GetComponent<DirrectionLightUp>(); rightArrow = GameObject.Find("RightArrow").GetComponent<DirrectionLightUp>(); upArrow = GameObject.Find("UpArrow").GetComponent<DirrectionLightUp>(); downArrow = GameObject.Find("DownArrow").GetComponent<DirrectionLightUp>(); cameraStartingPosition = transform.position; cameraStartingRotation = transform.rotation; delegateReference = new LeapEventDelegate(parseFrameAndRotate); cameraMovementVector = new Vector3(0, 0, 0); cameraRotationVector = new Vector3(0, 0, 0); fingerVectors = new Vector3[5]; GameObject ballGameObject = GameObject.Find("Ball"); if(ballGameObject != null) { ball = ballGameObject.transform; ballsRigidbody = ball.GetComponent<Rigidbody>(); } leftHandControllerTransform = GameObject.FindGameObjectWithTag("LeftHand").transform; rightHandControllerTransform = GameObject.FindGameObjectWithTag("RightHand").transform; leftHandController = leftHandControllerTransform.gameObject.GetComponent<HandController>(); rightHandController = rightHandControllerTransform.gameObject.GetComponent<HandController>(); leftHandControllerStartingPosition = leftHandControllerTransform.position; leftHandControllerStartingRotation = leftHandControllerTransform.rotation; rightHandControllerStartingPosition = rightHandControllerTransform.position; rightHandControllerStartingRotation = rightHandControllerTransform.rotation; BallsSpeed = 150f; offset = 0; }
//create a constructor with interface argument public FrameListener(LeapEventDelegate delegateObject) { //create a object of interface this.eventDelegate = delegateObject; }