Ejemplo n.º 1
0
    private void Awake()
    {
        Generator = new GridGenerator(GridSize, Querier);

        if (Generator != null)
        {
            QueryItems = Generator.Items(transform);
        }
    }
Ejemplo n.º 2
0
    private void OnDrawGizmos()
    {
        Generator = new GridGenerator(GridSize, Querier);

        if (Generator != null)
        {
            QueryItems = Generator.Items(transform);
        }

        if (QueryItems != null)
        {
            foreach (EnvQueryItem item in QueryItems)
            {
                var col = Physics.OverlapSphere(item.GetWorldLocation(), .25f);


                if (col.Length > 0)
                {
                    Gizmos.color = Color.yellow;
                    Gizmos.DrawWireSphere(item.GetWorldLocation(), 0.25f);
                    // item.IsColliding = true;
                }
                else
                {
                    if (item.RunConditionCheck(Enemy))
                    {
                        Gizmos.color = Color.red;
                        Gizmos.DrawWireSphere(item.GetWorldLocation(), 0.25f);
                        // item.EnemyNearby = true;
                    }
                    else
                    {
                        Gizmos.color = Color.blue;
                        Gizmos.DrawWireSphere(item.GetWorldLocation(), 0.25f);
                        //  item.EnemyNearby = false;
                    }
                }
            }
        }
    }