Exemplo n.º 1
0
    public void DidDie()
    {
        deathRotationSpeed  = Random.Range(deathRotationSpeedMin, deathRotationSpeedMax);
        deathRotationSpeed *= (Random.value < 0.5) ? -1f : 1f;
        deathRotation       = 0f;
        bodyRenderer.sprite = airTimeSprites[0];
        deathScaleLerper    = gameObject.AddComponent <VectorLerper>();
        var endScale = new Vector3(targetDeathScale, targetDeathScale, targetDeathScale);

        deathScaleLerper.Lerp(graphicsRoot, "localScale", Vector3.one, endScale, deathScaleLerpTime, LerpStyle.OutCubic);
    }
Exemplo n.º 2
0
 public void SetupWithTarget(Vector3 target)
 {
     if (gameManager.gameState != GameState.Game)
     {
         return;
     }
     spawnTime      = lerpSpeed;
     positionLerper = gameObject.AddComponent <VectorLerper>();
     positionLerper.Lerp(transform, "position", transform.position,
                         target, lerpSpeed, LerpStyle.InCubic);
 }
Exemplo n.º 3
0
 public void RetreatHand()
 {
     if (isRetreating)
     {
         return;
     }
     if (positionLerper != null)
     {
         Destroy(positionLerper);
     }
     positionLerper = gameObject.AddComponent <VectorLerper>();
     positionLerper.Lerp(transform, "position", transform.position,
                         initialPosition, retreatSpeed, LerpStyle.OutQuintic);
     isRetreating = true;
 }