Beispiel #1
0
        bool OnDistance(DistanceData receiveDistance, DistanceData sendDistance)
        {
            switch (receiveDistance.distanceShape)
            {
            case DistanceShape.Sphere:
                return(Utilitys.Distance(receiveDistance.Position, sendDistance.Position, receiveDistance.distanceType) <= receiveDistance.distanceValue);

            case DistanceShape.Cube:
                return(Utilitys.CubeDistance(receiveDistance.Position, receiveDistance.Size, sendDistance.Position, receiveDistance.distanceType));

            default:
                return(false);
            }
        }
Beispiel #2
0
        bool OnDistance(DistanceInteraction receiveDistance, DistanceInteraction sendDistance, out float distanceValue)
        {
            switch (receiveDistance.distanceData.distanceShape)
            {
            case DistanceShape.Sphere:
                return(Utilitys.Distance(receiveDistance.Position, sendDistance.Position, receiveDistance.distanceData.distanceType, out distanceValue) <= receiveDistance.distanceData.distanceValue);

            case DistanceShape.Cube:
                return(Utilitys.CubeDistance(receiveDistance.Position, receiveDistance.distanceData.Size, sendDistance.Position, receiveDistance.distanceData.distanceType, out distanceValue));

            default:
                distanceValue = -1;
                return(false);
            }
        }