Example #1
0
 public void Start()
 {
     //determines which way the new object will move
     moveDir = (Random.value >= 0.5f);
     //adds a bound check to bndCheck that has been initialized
     bndCheck = GetComponent <checkBounds>();
 }
Example #2
0
 // Start is called before the first frame update
 void Awake()
 {
     //initiates the singleton
     S = this;
     //sets the bndCheck to the checkBounds script that is a component of the camera
     bndCheck = GetComponent <checkBounds>();
     //starts the spawn enemy method and spawns the ever second
     Invoke("SpawnEnemy", 1f / enemySpawnPerSecond);
 }