Beispiel #1
0
    private void Recharge()
    {
        GameEntity projectile = _contexts.game.rechargeEntity;

        projectile.isRecharge = false;
        projectile.isShoot    = true;

        Transform ball     = projectile.transform.value;
        float     duration = _contexts.global.levelConfig.value.rechargeTime;

        projectile.AddAnimationInfo(new List <System.Action> {
            delegate()
            {
                ball.parent = shootPlace;
                _contexts.global.isFireAccess = true;
            }
        });

        // TODO: change animate envelope to more usefull or interesting
        ball.DOLocalMove(_contexts.global.rechargeDistance.value, duration).onComplete += delegate()
        {
            if (projectile != null)
            {
                projectile.isAnimationDone = true;
            }
        };

        CreateRechargeEntity();
    }