1234567891011121314151617181920212223 |
- using UnityEngine;
- using System.Collections;
- /// <summary>
- /// This is responsible for keeping data for the min and max y in screen coordinates
- /// of where this enemy can be spawned.
- /// This was mainly created for Formations and Sine Movemements where the enemy spawn manager
- /// would need to know this information, so that it doesn't spawn it offscreen.
- /// It was kept separate from Enemy class, since not all enemies need this information, and due to Formation
- /// not inheriting from Enemy. Kept the component based principles rather than having inheritance
- /// </summary>
- public class EnemyBounds : MonoBehaviour
- {
- [HideInInspector]
- public float minY;
- [HideInInspector]
- public float maxY;
- public float Range()
- {
- return maxY - minY;
- }
- }
|