示例#1
0
    private void Death()
    {
        Lives = 0;
        var renderers = GetComponentsInChildren <MeshRenderer>(true);

        foreach (var renderer in renderers)
        {
            renderer.sharedMaterial = deathMaterial;
        }
        Effects.Blow(transform.position);
        weapon.gameObject.SetActive(false);
        Game.Stress(0.7f);
    }
示例#2
0
 private void Update()
 {
     if (delayTimer > 0)
     {
         delayTimer -= Time.deltaTime;
         return;
     }
     if (timer > 0)
     {
         timer -= Time.deltaTime;
         var normalizedTime = timer / flyTime;
         var centralTime    = normalizedTime * 2f - 1f;
         transform.position = Vector3.Lerp(targetPosition, startPosition, normalizedTime) + Vector3.up * (distance * 0.4f * (1f - centralTime * centralTime));
     }
     else
     {
         gameObject.SetActive(false);
         MechController.BlowMechsInPosition(targetPosition, hitRadius, 1);
         Effects.Blow(targetPosition);
         Game.Stress(0.3f);
     }
 }