Ejemplo n.º 1
0
 private void OnEnable()
 {
     if (_isTracked)
     {
         _tracker = FindObjectOfType <Tracker>();
         _tracker.AddToTrack(_maxSpawns);
     }
     _playArea = FindObjectOfType <PlayArea>();
 }
        private void DrawRectangle(PlayArea playArea)
        {
            Vector3 pos = playArea.transform.position;

            Vector3[] verts = new Vector3[]
            {
                new Vector3(pos.x - playArea.Width, pos.y, pos.z - playArea.Length),
                new Vector3(pos.x - playArea.Width, pos.y, pos.z + playArea.Length),
                new Vector3(pos.x + playArea.Width, pos.y, pos.z + playArea.Length),
                new Vector3(pos.x + playArea.Width, pos.y, pos.z - playArea.Length)
            };

            Handles.DrawSolidRectangleWithOutline(verts, faceColor, outLineColor);
        }
        void OnSceneGUI()
        {
            PlayArea playArea = target as PlayArea;

            DrawRectangle(playArea);
        }