public void ReplaceParticleFXParent(ILinkedView newValue)
    {
        var index     = GameComponentsLookup.ParticleFXParent;
        var component = (ParticleFXParentComponent)CreateComponent(index, typeof(ParticleFXParentComponent));

        component.Value = newValue;
        ReplaceComponent(index, component);
    }
Ejemplo n.º 2
0
    public void ReplaceLinkedView(ILinkedView newValue)
    {
        var index     = GameComponentsLookup.LinkedView;
        var component = (LinkedViewComponent)CreateComponent(index, typeof(LinkedViewComponent));

        component.Value = newValue;
        ReplaceComponent(index, component);
    }
Ejemplo n.º 3
0
    public void OnLinkedView(GameEntity entity, ILinkedView value)
    {
        var mono = value as MonoBehaviour;

        if (mono != null)
        {
            var time = Random.Range(_configuration.BalloonSpawnAnimationDurationRange.x,
                                    _configuration.BalloonSpawnAnimationDurationRange.y);

            var positionTween = mono.transform.DOMove(entity.slotIndex.Value.IndexToPosition(_configuration), time);
            var scaleTween    = mono.transform.DOScale(Vector3.one, time);

            positionTween.onUpdate   += () => { entity.ReplacePosition(mono.transform.position); };
            scaleTween.onUpdate      += () => { entity.ReplaceScale(mono.transform.localScale); };
            positionTween.onComplete += () => { entity.isStableBalloon = true; };
        }

        entity.RemoveLinkedViewListener(this);
    }
    public void OnLinkedView(GameEntity entity, ILinkedView value)
    {
        var mono = value as MonoBehaviour;

        if (mono != null)
        {
            var tween = mono.transform.DOMove(_configuration.ThrowerSpawnPoint, 1f);

            tween.onUpdate += () => { entity.ReplacePosition(mono.transform.position); };

            tween.onComplete += () =>
            {
                entity.isMovable     = true;
                entity.isReadyToLoad = true;
            };
        }

        entity.RemoveLinkedViewListener(this);
    }
Ejemplo n.º 5
0
    public void OnLinkedView(GameEntity entity, ILinkedView value)
    {
        var mono = value as MonoBehaviour;

        // find thrower
        var thrower = _contexts.game.throwerEntity;

        if (mono != null)
        {
            var tween = mono.transform.DOScale(Vector3.one, 1f);
            thrower.isReadyToLoad = false;

            tween.onUpdate += () => { entity.ReplaceScale(mono.transform.localScale); };

            tween.onComplete += () =>
            {
                thrower.isReadyToThrow = true;
                thrower.ReplaceThrowerLoadedProjectile(entity);
            };
        }

        entity.RemoveLinkedViewListener(this);
    }
 private void Awake()
 {
     _listener = GetComponent <ILinkedView>();
 }