// Use this for initialization void Awake() { base_s = gameObject.GetComponent<entityBaseS>(); mech_s = gameObject.GetComponent<entityMechS>(); enemy_list = new List<entityEnemyS>(); resource_node_list = new List<entityNodeS>(); entity_dict = new Dictionary<EntityE, GameObject>(); entity_dict.Add(EntityE.Base, base_entity); entity_dict.Add(EntityE.Player, player_entity); entity_dict.Add(EntityE.Enemy, enemy_entity); node_dict.Add(Node.Factory, node_entity); node_dict.Add(Node.Outpost, node_entity); node_dict.Add(Node.Junkyard, node_entity); part_dict.Add(Part.Gear, particle_gear); part_dict.Add(Part.Plate, particle_plate); part_dict.Add(Part.Piston, particle_piston); part_dict.Add(Part.Strut, particle_strut); }
//create a base for the level public static bool instantiateBase(int x, int z, float starting_hp_percentage) { bool is_first_base = base_s == null; print (is_first_base + "base make"); GameObject new_entity = instantiateEntity(x, z, EntityE.Base); base_s = (entityBaseS) new_entity.AddComponent("entityBaseS"); if(base_s == null) throw new System.Exception("Base Entity not created properly D: | " + (base_s == null)); base_s.x = x; base_s.z = z; base_s.setCurrentHPviaPercentage(starting_hp_percentage); return is_first_base; }