Example #1
0
        private bool ShouldChangeDirection()
        {
            var curDir = CurrentDirection();

            if (curDir == MovementDirection.Left)
            {
                return(m_LeftBounds.position.x <= m_Bounds.GetHorizontalBounds().x);
            }
            else
            {
                return(m_RightBounds.position.x >= m_Bounds.GetHorizontalBounds().y);
            }
        }
Example #2
0
 /// <summary>
 /// Returns true if object has completed the movement state.
 /// </summary>
 /// <returns>true</returns>
 /// <c>false</c>
 /// <param name="owner">Owner.</param>
 public bool CompletedMove(Transform owner)
 {
     return(owner.position.x >= m_Bounds.GetHorizontalBounds().y);
 }