Beispiel #1
0
    protected override void Update()
    {
        if (active)
        {
            timer += Time.deltaTime;

            damage   = maxDamage * ((lifeTime - timer) / lifeTime);
            stunTime = maxStun * ((lifeTime - timer) / lifeTime);

            lineWidth = novaCharge + 10;

            size += Time.deltaTime * expandSpeed;
            base.Update();
        }
        else
        {
            transform.position = owner.transform.position;

            if (size < unActiveSize)
            {
                size += Time.deltaTime * expandSpeed * 0.2f;
            }
            else
            {
                size += Time.deltaTime * expandSpeed * 0.02f;
            }
            //size = unActiveSize;

            if (novaCharge < MAX_NOVA_POWER)
            {
                novaCharge += Time.deltaTime * 50;
            }
            else
            {
                novaCharge = MAX_NOVA_POWER;
                owner.StunNova();
            }

            //novaPowerBar.value = novaCharge / MAX_NOVA_POWER;
            lineWidth = (novaCharge * 0.3f) + 5;
        }

        transform.localScale = new Vector3(size, size, 0);
        DrawCircle((size / 2), circle);
    }