public override void InitializeAgent()
 {
     // logFile = new System.IO.StreamWriter(@"C:\Users\matt\Haskell\xUnity\LD_ML\mLogFile.txt");
     // Time.timeScale = 10;
     Debug.Log(1.0f / Time.deltaTime);
     academy               = FindObjectOfType(typeof(Academy)) as Academy;
     PlayerRoutine         = GetComponent <xPlayer>();
     player                = GameObject.Find("Player");
     CurrentEnemyPositions = new Vector2[NumEnemies];
     CurrentEnemyPositions.Initialize();
     PriorEnemyPositions         = new Vector2[NumEnemies];
     aKeepScore                  = FindObjectOfType <keepScor>();
     isEnemyActive               = new bool[NumEnemies];
     CurrentPlayerLaserPositions = new Vector2[NumPlayerLasers];
     CurrentPlayerLaserPositions.Initialize();
     isPlayerLaserActive = new bool[NumPlayerLasers];
     isPlayerLaserActive.Initialize();
     PlayerLaserProjectileSpeed = GetComponent <xPlayer>().projectileSpeed;
     CurrentEnemyLaserPositions = new Vector2[NumEnemyLasers];
     CurrentEnemyLaserPositions.Initialize();
     PriorEnemyLaserPositions = new Vector2[NumEnemyLasers];
     PriorEnemyLaserPositions.Initialize();
     isEnemyLaserActive = new bool[NumEnemyLasers];
     isPlayerLaserActive.Initialize();
     xInitializeArrays();
 }
示例#2
0
 // Use this for initialization
 void Start()
 {
     shotCounter = Random.Range(minTimeBetweenShots, maxTimeBetweenShots);
     health      = StartHealth;
     //Debug.Log("enemy laser from Start:"+xProjectile);
     aKeepScore = FindObjectOfType <keepScor>();
     agent      = FindObjectOfType <LaserAgent>();
     Player     = GameObject.Find("Player");
     if (agent != null)
     {
         thisEnemyIndex = agent.getFirstAvailableEnemyIndex(1);
         if (thisEnemyIndex >= 0)
         {
             agent.setEnemyActive(1, thisEnemyIndex, true); /* turn enemy to active*/
         }
         else
         {
             Destroy(gameObject);
         }
     }
     else
     {
         Destroy(gameObject);
     }
 }
示例#3
0
 // Use this for initialization
 void Start()
 {
     SetUpMoveBoundaries();
     // Debug.Log("player laser" + aLaser);
     health     = StartHealth;
     agent      = FindObjectOfType <LaserAgent>();
     aKeepScore = FindObjectOfType <keepScor>();
 }
示例#4
0
 // Use this for initialization
 void Start()
 {
     keepScor = FindObjectOfType <keepScor>();
     Stext    = GetComponent <Text>();
 }