コード例 #1
0
ファイル: LemmingAI.cs プロジェクト: digonalmeida/lemmings3d
 private bool CheckIsBlocker()
 {
     if (MovementController.CheckChangeDirectionOrders() != Direction.None)
     {
         return(false);
     }
     return(stateController.checkIsBlocker());
 }
コード例 #2
0
    public Direction CheckChangeDirectionOrders()
    {
        int hits = Physics.OverlapSphereNonAlloc(targetPositionAddress, 0.5f, overlapSphereHits, lemmingsActionLayerMask);

        for (int i = 0; i < hits; i++)
        {
            var hit = overlapSphereHits[i];
            LemmingStateController otherLemmingStateController = hit.GetComponentInParent <LemmingStateController>();

            if (otherLemmingStateController != null)
            {
                if (otherLemmingStateController.checkIsBlocker())
                {
                    var direction = otherLemmingStateController.BlockingDirection;
                    return(direction);
                }
            }
        }

        return(Direction.None);
    }