public void ReplaceProgressionView(ProgressionController newValue)
    {
        var index     = GameComponentsLookup.ProgressionView;
        var component = (ProgressionViewComponent)CreateComponent(index, typeof(ProgressionViewComponent));

        component.Value = newValue;
        ReplaceComponent(index, component);
    }
    public GameEntity SetProgressionView(ProgressionController newValue)
    {
        if (hasProgressionView)
        {
            throw new Entitas.EntitasException("Could not set ProgressionView!\n" + this + " already has an entity with ProgressionViewComponent!",
                                               "You should check if the context already has a progressionViewEntity before setting it or use context.ReplaceProgressionView().");
        }
        var entity = CreateEntity();

        entity.AddProgressionView(newValue);
        return(entity);
    }
    public void ReplaceProgressionView(ProgressionController newValue)
    {
        var entity = progressionViewEntity;

        if (entity == null)
        {
            entity = SetProgressionView(newValue);
        }
        else
        {
            entity.ReplaceProgressionView(newValue);
        }
    }
Ejemplo n.º 4
0
    private void Start()
    {
        //projectile not found
        if (!_hurtBox)
        {
            _controller     = Commons.PlayerProgression;
            ShooterIsPlayer = true;
            return;
        }

        //Check who shot the projectile
        if (_hurtBox.Shooter.IsPlayer())
        {
            _controller     = Commons.PlayerProgression;
            ShooterIsPlayer = true;
        }
        else
        {
            _controller     = Commons.EnemyProgression;
            ShooterIsPlayer = false;
        }
    }
Ejemplo n.º 5
0
 /// <summary>
 /// Deals a certain amount of base damage scaled by the provided progression manager
 /// </summary>
 /// <param name="baseDamage"></param>
 /// <param name="fromWhom"></param>
 public void DealScaledDamage(int baseDamage, ProgressionController fromWhom)
 {
     DealDamage(fromWhom.GetScaledDamage(baseDamage));
 }