private async Task UpdateBounds() { Bounds = await GetBounds(); Center = await GetCenter(); Zoom = await GetZoom(); OnBoundsChanged?.Invoke(this, new EventArgs()); }
void Update() { if (m_IsMoving) { Vector3 dir = (m_TargetPosition - transform.position).normalized; Vector3 deltaDistance = dir * Speed * Time.deltaTime; AABB2D oldBounds = Bounds; Vector2 centerPosition = Bounds.Center + new Vector2(deltaDistance.x, deltaDistance.z); AABB2D newBounds = new AABB2D(centerPosition, Bounds.Extents); transform.position = new Vector3(newBounds.Center.x, 0, newBounds.Center.y); Bounds = newBounds; OnBoundsChanged.Invoke(this, oldBounds, newBounds); if (Vector3.Distance(transform.position, m_TargetPosition) < 0.1f) { RandomMove(); } } }
private void OnCompositeBoundsChanged(IBounds <T> bounds, EventArgs eventArgs) { OnBoundsChanged?.Invoke(this, eventArgs); }
private void OnStatModifiedValueChanged(IStat <int> stat, EventArgs eventArgs) { OnBoundsChanged?.Invoke(this, eventArgs); }