Created
January 4, 2018 13:48
-
-
Save raveneer/f738be84346c5550aefc37ff7a8c2df7 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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