예제 #1
0
        private async Task UpdateBounds()
        {
            Bounds = await GetBounds();

            Center = await GetCenter();

            Zoom = await GetZoom();

            OnBoundsChanged?.Invoke(this, new EventArgs());
        }
예제 #2
0
    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();
            }
        }
    }
예제 #3
0
 private void OnCompositeBoundsChanged(IBounds <T> bounds, EventArgs eventArgs)
 {
     OnBoundsChanged?.Invoke(this, eventArgs);
 }
예제 #4
0
 private void OnStatModifiedValueChanged(IStat <int> stat, EventArgs eventArgs)
 {
     OnBoundsChanged?.Invoke(this, eventArgs);
 }