Entitas.Context.SetCoins C# (CSharp) Method

SetCoins() public method

public SetCoins ( int newCount ) : Entity
newCount int
return Entity
        public Entity SetCoins(int newCount)
        {
            if(hasCoins) {
                throw new EntitasException("Could not set coins!\n" + this + " already has an entity with CoinsComponent!",
                    "You should check if the context already has a coinsEntity before setting it or use context.ReplaceCoins().");
            }
            var entity = CreateEntity();
            entity.AddCoins(newCount);
            return entity;
        }