Exemplo n.º 1
0
        void OnDrawGizmosSelected()
        {
            //On general tab selected: display mesh radius squares and collider radius
            List <Vector2> positions = TilePool.GetTilePositionsFromRadius(GenerationRadius, transform.position, Length);

            //Mesh radius squares
            foreach (Vector2 pos in positions)
            {
                Vector3 pos3d = new Vector3(pos.x * Length, 0, pos.y * Length);

                Gizmos.color = Color.white;
                Gizmos.DrawWireCube(pos3d, new Vector3(Length, 0, Length));
            }

            //Generation radius
            if (TrackedObject != null)
            {
                var     pos    = TrackedObject.transform.position;
                Vector3 extPos = new Vector3(pos.x, 0, pos.z);

                Gizmos.color = Color.blue;
                Gizmos.DrawWireCube(extPos, new Vector3(ColliderGenerationExtent, 0, ColliderGenerationExtent));
            }
        }
Exemplo n.º 2
0
 void Awake()
 {
     Pool    = new TilePool();
     Preview = new TerrainPreview();
 }