コード例 #1
0
ファイル: VendorManager.cs プロジェクト: mnijaki/GlitchGarden
 // Initialization.
 void Start()
 {
   // Get animator.
   this.anim=this.GetComponent<Animator>();
   // Get attacker.
   this.attacker=this.GetComponent<AttackerManager>();
 } // End of Start
コード例 #2
0
  } // End of Update

  // Return information if is time to spawn passed attacker.
  private bool IsTimeToSpawn(AttackerManager attacker)
  {
    // Compute spawns per second.
    float spawns_per_second=1/attacker.seconds_to_spawn;
    // Time.deltaTime guarantee that when FPS will drop down then propability
    // of launching projectile will go up. Calculation is dividied by 5 becouse there is 
    // 5 lanes of attackers.
    return (Random.value < ((Time.deltaTime*spawns_per_second*this.spawn_rate + (PlayerPrefsManager.DifficultyGet()/10)) / 5));
  } // End of IsTimeToSpawn
コード例 #3
0
 void Awake()
 {
     location = this.gameObject.transform;
     charMan  = this.gameObject.GetComponent <AttackerManager>();
     velocity = charMan.Speed;
 }