示例#1
0
    public void OnReadyToFire()
    {
        FireballController fireball = FireballPrefab.PrefabInstantiate(FireDamage, transform.position,
                                                                       (Planet.transform.position - transform.position).normalized * FireImpulse);


        CheckShots();
        counter.Reset(Random.Range(0, FirePeriod * 0.2f));
    }
示例#2
0
 // Update is called once per frame
 void Update()
 {
     if (state == Modes.Fire)
     {
         if (counter.Count(FireTime))
         {
             counter.Reset(Random.Range(0f, FireTime * TimeVariation));
             FireballPrefab.PrefabInstantiate(FireDamage, transform.position,
                                              (planet.transform.position - transform.position).normalized * FireImpulse);
         }
     }
 }