disable resource collection outside of core range, disable purchase buttons if too much money
This commit is contained in:
parent
6a4978041c
commit
e6b04bbdd1
8 changed files with 97 additions and 56 deletions
|
|
@ -257,6 +257,12 @@ fn tick_invulnerability(
|
|||
#[derive(Component, Deref, DerefMut)]
|
||||
pub struct Range(pub f32);
|
||||
|
||||
impl Range {
|
||||
pub fn within(&self, a: Vec3, b: Vec3) -> bool {
|
||||
a.distance_squared(b) < self.0 * self.0
|
||||
}
|
||||
}
|
||||
|
||||
impl Default for Range {
|
||||
fn default() -> Self {
|
||||
Self(5.)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue