17 lines
415 B
C#
17 lines
415 B
C#
using UnityEngine;
|
|
|
|
namespace CreatureControl {
|
|
|
|
public class Odorant : MonoBehaviour {
|
|
public float strength = 1;
|
|
|
|
public float StrengthAt(float distance) {
|
|
if (distance <= 0)
|
|
return this.strength;
|
|
|
|
float intensity = this.strength / (4.0f * Mathf.PI * distance * distance);
|
|
return intensity;
|
|
}
|
|
}
|
|
|
|
} |