示例#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);
 }