Exemplo n.º 1
0
    void Awake()
    {
        polygon = GetComponent <FilledPolygon>();
        polygon.UpdateAlpha(initialAlpha);

        transform.localScale = new Vector3(LENGTH, initialSize);
    }
Exemplo n.º 2
0
    void Update()
    {
        life += Time.deltaTime;

        polygon.UpdateSize(size * (float)Math.Log10(1.0 + life * speed));
        polygon.UpdateAlpha((1 - life / maxLife) * initialAlpha);

        if (life >= maxLife)
        {
            Destroy(gameObject);
        }
    }
Exemplo n.º 3
0
    void Update()
    {
        life += Time.deltaTime;

        var remainingLifeRatio = (maxLife - life) / maxLife;

        polygon.UpdateSize(initialSize * (0.2f + 0.8f * remainingLifeRatio));
        polygon.UpdateAlpha(remainingLifeRatio);

        if (life >= maxLife)
        {
            Destroy(gameObject);
        }
    }
Exemplo n.º 4
0
    private void Update()
    {
        life += Time.deltaTime;

        transform.localScale = new Vector3(initialSize * (finalSizeRatio + (1.0f - finalSizeRatio) * (float)Math.Pow(0.9f, life * speed)), LENGTH);

        // Start fading out when the amount of life left is less then vanishLimit
        // Before this point, the polygon will not be transparent
        if (maxLife - life <= vanishLimit)
        {
            polygon.UpdateAlpha((maxLife - life) / vanishLimit * initialAlpha);

            if (life >= maxLife)
            {
                Destroy(gameObject);
            }
        }
    }
Exemplo n.º 5
0
 void Awake()
 {
     polygon = GetComponent <FilledPolygon>();
     polygon.UpdateSize(0.0f);
     polygon.UpdateAlpha(initialAlpha);
 }