protected virtual void Start() { float width = 1 - skinWidth * 2; leftChecker = new RaycastArrayChecker(leftHit, raysPerSide, width, Vector3.left, Vector3.left * (0.5f - skinWidth)); rightChecker = new RaycastArrayChecker(rightHit, raysPerSide, width, Vector3.right, Vector3.right * (0.5f - skinWidth)); downChecker = new RaycastArrayChecker(downHit, raysPerSide, width, Vector3.down, Vector3.down * (0.5f - skinWidth)); upChecker = new RaycastArrayChecker(upHit, raysPerTop, width, Vector3.up, Vector3.up * (0.5f - skinWidth)); }
protected virtual void OnDrawGizmosSelected() { float width = 1 - skinWidth * 2; float rayLenght = skinWidth + baseRayLenght; RaycastArrayChecker.DrawPreview(transform.position, rayLenght, Color.white, raysPerSide, width, Vector3.left, Vector3.left * (0.5f - skinWidth)); RaycastArrayChecker.DrawPreview(transform.position, rayLenght, Color.white, raysPerSide, width, Vector3.right, Vector3.right * (0.5f - skinWidth)); RaycastArrayChecker.DrawPreview(transform.position, rayLenght, Color.white, raysPerSide, width, Vector3.down, Vector3.down * (0.5f - skinWidth)); RaycastArrayChecker.DrawPreview(transform.position, rayLenght, Color.white, raysPerTop, width, Vector3.up, Vector3.up * (0.5f - skinWidth)); }
public void Setup() { arrayChecker = new RaycastArrayChecker(hit, 2, 1, Vector3.down); Assert.AreEqual(0, Object.FindObjectsOfType <Transform>().Length); }