public void Update()
        {
            hitPoint = ToolUtilities.RaycastGridOnly(input.GetControllerPoint(),
                                                     input.GetControllerDirection(), gridController.GetGridCollider(), 200);

            // if we are placing a prop
            if (curObject != null && curObject.ResourceMetadata.wwObjectMetadata.type == WWType.Prop)
            { // raycast against all tiles and ignore the grid
                hitPoint = ToolUtilities.RaycastGridThenCustom(input.GetControllerPoint(),
                                                               input.GetControllerDirection(), gridController.GetGridCollider(), WWType.Tile, 200);
            }
        }
Esempio n. 2
0
        private void Update()
        {
            var lastHitPoint = hitPoint;

            hitPoint = ToolUtilities.RaycastGridOnly(input.GetControllerPoint(),
                                                     input.GetControllerDirection(), gridController.GetGridCollider(), 200);
            if (OnlyMovingProps())
            {
                hitPoint = ToolUtilities.RaycastGridThenCustom(input.GetControllerPoint(),
                                                               input.GetControllerDirection(), gridController.GetGridCollider(), WWType.Tile, 200);
            }
            if (hitPoint.Equals(Vector3.zero))
            {
                hitPoint = lastHitPoint;
            }
            Debug.DrawLine(Vector3.zero, hitPoint, Color.red);
        }