Beispiel #1
0
    bool RaycastForCommands()
    {
        var ray = Camera.main.ScreenPointToRay(Input.mousePosition);

        Debug.DrawRay(ray.origin, ray.direction * Range, Color.green);
        RaycastHit Hit;

        if (Physics.Raycast(ray, out Hit, Range, TileLayerMask))
        {
            var movePosition = Hit.transform.position;
            var cmd          = Command.CreateMoveToCommand(SelectedCrewMember.gameObject, movePosition);
            SelectedCrewMember.AddCommand(cmd);

            return(true);
        }
        return(false);
    }