public BotStats(IBotStats entityStats) { attributes = new float[STATS_COUNT]; attributes[(int)ID.maxHealth] = entityStats.health; attributes[(int)ID.maxShield] = entityStats.shield; attributes[(int)ID.armor] = entityStats.armor; attributes[(int)ID.speed] = entityStats.speed; }
public void spawnBot(IBotStats botStats) { GameObject newBot; gizmo = gameObject.GetComponent<GizmoSpawn>(); newBot = Object.Instantiate(Resources.Load(botStats.Prefab),gameObject.transform.position , Quaternion.identity) as GameObject; newBot.name = botStats.Name+botID; newBot.transform.parent = this.transform; Bot botScript = newBot.GetComponent("Bot") as Bot; botScript.botStats = botStats; botScript.init(); botID++; }
public InvadingUnit(IBotBehavior behavior, IBotStats stats) { this.behavior = behavior; this.stat = stats; }