public static void GenerateResearchWeightingsByType(ResearchTypes type, float weightFactor, List <ResearchProjectDef> projs) { for (int i = 0; i < projs.Count; i++) { UndiscoveredResearchList.MainResearchDict[projs[i].defName].Weighting = weightFactor; } }
public override void Initialize(string name, int cost, int level, ResearchTypes type, float scanTime, float range) { base.Initialize(name, cost, level); this.type = type; this.scanTime = scanTime; this.range = range; }
//register that a spawn point is now avaiable public void MaterialCollected(int _index, ResearchTypes type) { if (isEnabled) { spawnPointAvailability[_index] = true; if (type == ResearchTypes.Archeology) { archMaterialsToSpawn++; } else if (type == ResearchTypes.Biology) { bioMaterialsToSpawn++; } else { geoMaterialsToSpawn++; } spawnQueue.Add(new SpawnNode(Time.time - GameManager.instance.worldStartTime, _index)); } }
protected override void OnPrefabInit() { Instance = this; researchTypes = new ResearchTypes(); }
public ResearchMaterialStruct(ResearchTypes _type, int _worth) { researchType = _type; worth = _worth; }
// Start is called before the first frame update void Start() { totalMaterials = PlayerManager.instance.pickedUpResearchMaterials.Count; storage = (StorageEquipment)PlayerManager.instance.equipment[2]; totalCapacity = storage.capacity; capacityText.text = String.Format("Capacity: {0}/{1}", totalMaterials, totalCapacity); bool foundGeo = false; bool foundArch = false; bool foundBio = false; for (int i = 2; i < PlayerManager.instance.equipment.Count; i++) { if (PlayerManager.instance.equipment[i] is ResearchEquipment) { ResearchEquipment e = (ResearchEquipment)PlayerManager.instance.equipment[i]; if (e.type == ResearchTypes.Geology) { foundGeo = true; } else if (e.type == ResearchTypes.Archeology) { foundArch = true; } else { foundBio = true; } } } if (!foundGeo) { missingResearchType = ResearchTypes.Geology; archImageSpot.sprite = archImage; bioImageSpot.sprite = bioImage; } else if (!foundBio) { missingResearchType = ResearchTypes.Biology; archImageSpot.sprite = archImage; geoImageSpot.sprite = geoImage; } else if (!foundArch) { missingResearchType = ResearchTypes.Archeology; bioImageSpot.sprite = bioImage; geoImageSpot.sprite = geoImage; } geoSlotText.text = ""; bioSlotText.text = ""; archSlotText.text = ""; equipmentPrefab = (GameObject)Resources.Load("EquipmentSlot"); equipmentParent = this.gameObject.transform.GetChild(1).gameObject; foreach (Equipment e in PlayerManager.instance.equipment) { slot = Instantiate(equipmentPrefab) as GameObject; slot.transform.SetParent(equipmentParent.transform, false); slots.Add(slot); equipmentText = slot.transform.GetChild(0).GetComponent <Text>(); levelText = slot.transform.GetChild(1).GetComponent <Text>(); equipmentText.text = String.Format("{0}", e.name); levelText.text = String.Format("Level: {0}", e.level); Image icon = slot.transform.GetChild(2).GetComponent <Image>(); if (e is TransmitterEquipment) { slot.transform.GetChild(2).GetComponent <Image>().sprite = transmitterImage; } else if (e is EnergyEquipment) { slot.transform.GetChild(2).GetComponent <Image>().sprite = batteryImage; } else if (e is StorageEquipment) { slot.transform.GetChild(2).GetComponent <Image>().sprite = storageImage; } else if (e is WeaponEquipment) { slot.transform.GetChild(2).GetComponent <Image>().sprite = weaponImage; } else if (e is ResearchEquipment) { ResearchEquipment rE = (ResearchEquipment)e; if (rE.type == ResearchTypes.Archeology) { slot.transform.GetChild(2).GetComponent <Image>().sprite = archImage; } else if (rE.type == ResearchTypes.Biology) { slot.transform.GetChild(2).GetComponent <Image>().sprite = bioImage; } else if (rE.type == ResearchTypes.Geology) { slot.transform.GetChild(2).GetComponent <Image>().sprite = geoImage; } } } equipmentParent.SetActive(equipmentToggle); }
//function prototype for the ResearchEquipment class public virtual void Initialize(string name, int cost, int level, ResearchTypes type, float scanTime, float range) { }