Пример #1
0
 public new void Awake()
 {
     base.Awake();
     renderer        = GetComponent <SpriteRenderer>();
     obstacle        = GetComponent <NavObstacle>();
     currentlyInside = new List <Collider2D>();
     frozen          = frozen;
 }
Пример #2
0
 private void Awake()
 {
     renderer      = GetComponent <SpriteRenderer>();
     collider      = GetComponent <Collider2D>();
     obstacle      = GetComponent <NavObstacle>();
     startingLayer = gameObject.layer;
     open          = open;
     locked        = locked;
 }
Пример #3
0
    private void OnEnable()
    {
        obstacle = (target as NavObstacle);

        cornersContent.text    = "Corners Visible";
        cornersContent.tooltip = "The number of corners of the box to be used in making nav graphs";

        arrngmtContent.text    = "Arrangement";
        arrngmtContent.tooltip = "The arrangement of the corners used to make nav graphs";

        consecCornersContent.text    = "Consecutive Corners";
        consecCornersContent.tooltip = "Are the corners consecutive or diagonal?";
    }
Пример #4
0
    private NavTerrainTypes GetTerrainType(Vector2 point)
    {
        for (int i = 0; i < overlapCheckBuffer.Length; ++i)
        {
            overlapCheckBuffer[i] = null;
        }
        Physics2D.OverlapPointNonAlloc(point, overlapCheckBuffer);

        for (int i = 0; i < overlapCheckBuffer.Length && overlapCheckBuffer[i] != null; ++i)
        {
            NavObstacle obstacle = overlapCheckBuffer[i].GetComponent <NavObstacle>();
            if (obstacle != null)
            {
                return(obstacle.terrainType);
            }
        }

        return(NavTerrainTypes.Floor);
    }
Пример #5
0
 private void Awake()
 {
     collider = GetComponent <Collider2D>();
     renderer = GetComponent <SpriteRenderer>();
     obstacle = GetComponent <NavObstacle>();
 }