Skip to content

Instantly share code, notes, and snippets.

@raveneer
Created January 4, 2018 13:48
Show Gist options
  • Save raveneer/f738be84346c5550aefc37ff7a8c2df7 to your computer and use it in GitHub Desktop.
Save raveneer/f738be84346c5550aefc37ff7a8c2df7 to your computer and use it in GitHub Desktop.
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using Entitas;
public class MakeRandomDamageables : IInitializeSystem
{
private Contexts _contexts;
public MakeRandomDamageables(Contexts contexts)
{
_contexts = contexts;
}
public void Initialize()
{
MakeFlameable(10000);
}
private void MakeFlameable(int amount)
{
for (int i = 0; i < amount; i++)
{
var newFrameable = _contexts.game.CreateEntity();
newFrameable.AddHealth(Random.Range(1000, 10000));
newFrameable.AddFire(1);
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment