protected override void onAwake() { input = InputHandler.Instance; Raycaster = RaycastHandler.Instance; rb = GetComponent <Rigidbody>(); appearance = GetComponent <Appearance>(); sounds = GetComponent <Sounds>(); pogoBounceLevelText.transform.parent.gameObject.SetActive(false); heightText.transform.parent.gameObject.SetActive(false); }
private bool setPositionFromMouseClick() { //If the ray hits an object if (RaycastHandler.Update()) { if (ExtendLayerMask.NotGroundMask(RaycastHandler.HitInfo.transform.gameObject.layer)) { targetPosition = RaycastHandler.HitInfo.point; return(true); } } return(false); }
/// <summary> /// Get direction of mouse click /// </summary> /// <param name="direction"></param> /// <returns></returns> private bool GetDirectionOfMouseClick(ref Vector3 direction) { if (Input.GetMouseButtonDown(0)) { if (RaycastHandler.Update()) { Vector3 g = RaycastHandler.HitInfo.point; var heading = RaycastHandler.HitInfo.point - transform.position; var distance = heading.magnitude; direction = heading / distance; return(true); } } return(false); }