Пример #1
0
	private bool TruckInPosition(ConvoyTruck truck) {
		if(!truck) return false;
		float closeEnough = 3.0f;
		Vector3 truckPos = truck.transform.position;
		bool xInPos = truckPos.x > destination.x - closeEnough && truckPos.x < destination.x + closeEnough;
		bool zInPos = truckPos.z > destination.z - closeEnough && truckPos.z < destination.z + closeEnough;
		return xInPos && zInPos;
	}
Пример #2
0
    private bool TruckInPosition(ConvoyTruck truck)
    {
        if (!truck)
        {
            return(false);
        }
        float   closeEnough = 3.0f;
        Vector3 truckPos    = truck.transform.position;
        bool    xInPos      = truckPos.x > destination.x - closeEnough && truckPos.x < destination.x + closeEnough;
        bool    zInPos      = truckPos.z > destination.z - closeEnough && truckPos.z < destination.z + closeEnough;

        return(xInPos && zInPos);
    }
Пример #3
0
    public override bool PlayerMeetsConditions(Player player)
    {
        ConvoyTruck truck = player.GetComponentInChildren <ConvoyTruck>();

        return(player && !player.IsDead() && TruckInPosition(truck));
    }