Ejemplo n.º 1
0
    IEnumerator HitPaseTask(WeaponHitTaskPhase phase, WeaponHitTask msg, float waitMs, float min, float max)
    {
        var wait  = waitMs / 1000f;
        var range = max - min;

        SendMessage("OnWeaponHitTask", msg, SendMessageOptions.DontRequireReceiver);
        yield return(new WaitForEndOfFrame());

        wait -= Time.deltaTime;
        while (wait > 0)
        {
            msg.update(
                min + (1f - (wait / waitMs * 1000f)) * range,
                phase
                );

            SendMessage("OnWeaponHitTask", msg, SendMessageOptions.DontRequireReceiver);
            yield return(new WaitForEndOfFrame());

            wait -= Time.deltaTime;
        }

        msg.update(
            max,
            phase
            );

        SendMessage("OnWeaponHitTask", msg, SendMessageOptions.DontRequireReceiver);
    }
Ejemplo n.º 2
0
 internal void update(float ratio, WeaponHitTaskPhase phase)
 {
     this.ratio = ratio;
     this.phase = phase;
 }