public void AddPopulationList(List <int> _values, Color _speciesColor, BasicSpeciesScript _species) { for (int i = 0; i < _values.Count; i++) { AddNewDot(i, _values[i], _speciesColor, _species); } }
public void EditSpecies(SpeciesHolderScript _speciesHolder) { selectedSpecies = _speciesHolder.gameObject; BasicSpeciesScript species = selectedSpecies.GetComponent <BasicSpeciesScript>(); for (int i = 0; i < GetSpieciesDropDown().options.Count; i++) { if (GetSpieciesDropDown().options[i].text == species.speciesName) { GetSpieciesDropDown().SetValueWithoutNotify(i); } } GetSpieciesDropDown().interactable = false; ResetFieldInputName(); GetSpeciesPopulationCountSlider().value = species.startingPopulation; RefreshOrganismCount(); if (species.GetComponent <PlantSpeciesSeeds>() != null) { GetSpeciesSeedCountSlider().value = species.GetComponent <PlantSpeciesSeeds>().startingSeedCount; DisplaySeedSpeceis(true); } else { DisplaySeedSpeceis(false); } SetSlidersToColor(species.speciesColor); GetDoneButtonText().text = "ConfirmEdit"; editingSpecies = true; }
public void SetUpJobController(BasicSpeciesScript speciesScript, EarthScript earth) { this.earth = earth; this.speciesScript = speciesScript; SetUpSpecificJobController(speciesScript); Allocate(); }
public void SelectSpecies() { selectedSpecies = null; string speciesName = GetSpieciesDropDown().options[GetSpieciesDropDown().value].text; for (int i = 0; i < speciesPresetHolder.childCount; i++) { BasicSpeciesScript targetSpecies = speciesPresetHolder.GetChild(i).GetComponent <BasicSpeciesScript>(); if (targetSpecies.speciesName == speciesName) { selectedSpecies = targetSpecies.gameObject; color = targetSpecies.speciesColor; SetSlidersToColor(color); GetSpeciesPopulationCountSlider().value = targetSpecies.startingPopulation; RefreshOrganismCount(); if (targetSpecies.GetComponent <PlantSpeciesSeeds>() != null) { GetSpeciesSeedCountSlider().value = targetSpecies.GetComponent <PlantSpeciesSeeds>().startingSeedCount; DisplaySeedSpeceis(true); } else { DisplaySeedSpeceis(false); } ResetFieldInputName(); } } GetSpieciesDropDown().interactable = true; editingSpecies = false; GetDoneButtonText().text = "CreateSpecies"; }
public void CreateSpecies() { if (editingSpecies) { BasicSpeciesScript speciesScript = selectedSpecies.GetComponent <BasicSpeciesScript>(); speciesScript.speciesDisplayName = GetSpieciesNameInputField().text; speciesScript.startingPopulation = Mathf.RoundToInt(GetSpeciesPopulationCountSlider().value); speciesScript.speciesColor = color; if (speciesScript.GetComponent <PlantSpeciesSeeds>() != null) { speciesScript.GetComponent <PlantSpeciesSeeds>().startingSeedCount = (int)GetSpeciesSeedCountSlider().value; } selectedSpecies.GetComponent <SpeciesHolderScript>().Refresh(); } else { GameObject newSpecies = Instantiate(selectedSpecies, SpeciesManager.Instance.transform); BasicSpeciesScript speciesScript = newSpecies.GetComponent <BasicSpeciesScript>(); speciesScript.speciesDisplayName = GetSpieciesNameInputField().text; speciesScript.startingPopulation = Mathf.RoundToInt(GetSpeciesPopulationCountSlider().value); speciesScript.speciesColor = color; if (speciesScript.GetComponent <PlantSpeciesSeeds>() != null) { speciesScript.GetComponent <PlantSpeciesSeeds>().startingSeedCount = (int)GetSpeciesSeedCountSlider().value; } selectedSpecies.GetComponent <SpeciesHolderScript>().Refresh(); } editingSpecies = false; DisplayPanel(false); }
internal void SetUpOrganism(BasicSpeciesScript species) { this.species = species; meshRenderer = transform.GetChild(0).GetComponent <MeshRenderer>(); GetMeshRenderer().material.color = species.speciesColor; GetOrganismMotor().SetupOrganismMotor(species.earth, this); }
public void SetSpecies(BasicSpeciesScript _speciesScript, int _index) { speciesScript = _speciesScript; GetComponent <Image>().color = new Color(speciesScript.speciesColor.r, speciesScript.speciesColor.g, speciesScript.speciesColor.b, 1); UpdateInitialText(); index = _index; GetComponent <RectTransform>().localPosition = new Vector2(-30, 45 - (32 * _index)); }
public void AddListOfSpecies(List <GameObject> _speciesList) { for (int i = 0; i < _speciesList.Count; i++) { GameObject newSpecies = Instantiate(_speciesList[i].GetComponent <SpeciesHolderScript>().gameObject, SpeciesManager.Instance.transform); BasicSpeciesScript speciesScript = newSpecies.GetComponent <BasicSpeciesScript>(); newSpecies.transform.GetChild(1).GetComponent <Text>().text = speciesScript.speciesDisplayName; newSpecies.transform.GetComponent <Image>().color = speciesScript.speciesColor; } }
public void Refresh() { BasicSpeciesScript speciesScript = GetComponent <BasicSpeciesScript>(); GetColorImage().color = speciesScript.speciesColor; if (GetComponent <PlantSpeciesSeeds>() != null) { GetNameText().text = speciesScript.speciesDisplayName + " Pop(" + speciesScript.startingPopulation + ")(" + GetComponent <PlantSpeciesSeeds>().startingSeedCount + ")"; return; } GetNameText().text = speciesScript.speciesDisplayName + " Pop(" + speciesScript.startingPopulation + ")"; }
internal override void SetUpSpecificJobController(BasicSpeciesScript speciesScript) { plantSpecies = (PlantSpecies)speciesScript; }
public override void SetSpeciesScript(BasicSpeciesScript _species) { animalSpecies = (AnimalSpecies)_species; }
GameObject CreateCircle(Color _color, GameObject _verticalCollum, int _populationCount, BasicSpeciesScript _species) { GameObject newCircle = Instantiate(populationCircle); newCircle.transform.SetParent(_verticalCollum.transform.GetChild(2), false); newCircle.GetComponent <Image>().color = new Color(_color.r, _color.g, _color.b, 1); PopulationCircle newPopulationCircle = newCircle.GetComponent <PopulationCircle>(); newPopulationCircle.population = _populationCount; newPopulationCircle.species = _species; RectTransform rectTransform = newCircle.GetComponent <RectTransform>(); rectTransform.anchoredPosition = new Vector2(2.5f, 0); rectTransform.sizeDelta = new Vector2(5, 5); rectTransform.localPosition = new Vector2(rectTransform.localPosition.x, FindCirclePosition(_populationCount)); return(newCircle); }
public void AddNewDot(int timePosition, int populationPosition, Color _color, BasicSpeciesScript _species) { SetPopulationMax(populationPosition); CreateCircle(_color, GetVericalCollum(timePosition), populationPosition, _species); }
internal virtual void SetUpSpecificJobController(BasicSpeciesScript speciesScript) { }
public void SetBasicSpeciesScript(BasicSpeciesScript species) { speciesScript = species; SetSpeciesScript(species); }
public abstract void SetSpeciesScript(BasicSpeciesScript species);
internal override void SetUpSpecificJobController(BasicSpeciesScript speciesScript) { animalSpecies = (AnimalSpecies)speciesScript; }
public override void SetSpeciesScript(BasicSpeciesScript _species) { plantSpecies = (PlantSpecies)_species; }