Ejemplo n.º 1
0
 private void Start()
 {
     ac    = ServiceLocator.GetAudioController();
     timer = new Timer(UtilRandom.RangeWithCenter(
                           secondsBetweenSounds, secondsBetweenSoundsVariance),
                       TimerFinished, true);
     timer.Run();
 }
Ejemplo n.º 2
0
    private void Fire()
    {
        AudioClip clip = sounds.GetRandomElement();

        ac.PlaySFX(clip);
        timer.SetSecondsTarget(clip.length + UtilRandom.RangeWithCenter(
                                   secondsBetweenSounds, secondsBetweenSoundsVariance));
    }
    protected override void Instantiated(GameObject obj, float secondsOverflow)
    {
        float   magnitude = UtilRandom.RangeWithCenter(valueCenter, valueRadius);
        float   direction = UtilRandom.RangeWithCenter(directionCenter, directionRadius);
        Vector2 velocity  = Angle.FromDegrees(direction).GetHeadingVector() * magnitude;

        obj.GetComponent <Velocity2D>().SetVelocity(velocity);
    }
Ejemplo n.º 4
0
    private void Start()
    {
        oscillator.enabled = false;
        lerper.enabled     = true;
        lerper.Completed  += LerpFinish;

        damage.Add(data.damage);

        timerIdle = new Timer(UtilRandom.RangeWithCenter(data.secondsToIdle,
                                                         data.secondsToIdleVariance), TimerIdleFinish, false);
        timerIdle.Run();
    }
Ejemplo n.º 5
0
    private void Start()
    {
        timerWarning = new Timer(data.secondsOfWarning, WarningFinish, false);
        timerIdle    = new Timer(data.secondsOfIdling, IdleFinish, false);
        timerWarning.Run();
        GameObject warning = Instantiate(data.prefabWarning, transform);

        warning.transform.position = transform.position + Vector3.up * warningHeight;
        // Set the destroy time for the floor spike warning.
        warning.GetComponent <MonoTimer>().SetSecondsTarget(data.secondsOfWarning);
        damage.Add(data.damage);
        heightToRise = UtilRandom.RangeWithCenter(data.heightToRise, data.heightToRiseVariance);
    }
Ejemplo n.º 6
0
 protected override void Instantiated(GameObject obj, float secondsOverflow)
 {
     obj.GetComponent <RootDamage>().Add(UtilRandom.RangeWithCenter(valueCenter, valueRadius));
 }
Ejemplo n.º 7
0
 protected override void Instantiated(GameObject obj, float secondsOverflow)
 {
     obj.GetComponent <AngularVelocity2D>().SetAngularVelocity(UtilRandom.RangeWithCenter(valueCenter, valueRadius));
 }
Ejemplo n.º 8
0
 protected override void Instantiated(GameObject obj, float secondsOverflow)
 {
     obj.GetComponent <MonoTimer>().SetSecondsTarget(UtilRandom.RangeWithCenter(valueCenter, valueRadius));
 }
Ejemplo n.º 9
0
 public void StartCooldown()
 {
     timerCooldown.SetSecondsTarget(UtilRandom.RangeWithCenter(secondsOfCooldown,
                                                               secondsOfCooldownVariance));
     timerCooldown.Run();
 }