コード例 #1
0
 public void AddPopulationList(List <int> _values, Color _speciesColor, BasicSpeciesScript _species)
 {
     for (int i = 0; i < _values.Count; i++)
     {
         AddNewDot(i, _values[i], _speciesColor, _species);
     }
 }
コード例 #2
0
    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;
    }
コード例 #3
0
 public void SetUpJobController(BasicSpeciesScript speciesScript, EarthScript earth)
 {
     this.earth         = earth;
     this.speciesScript = speciesScript;
     SetUpSpecificJobController(speciesScript);
     Allocate();
 }
コード例 #4
0
    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";
    }
コード例 #5
0
    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);
    }
コード例 #6
0
 internal void SetUpOrganism(BasicSpeciesScript species)
 {
     this.species = species;
     meshRenderer = transform.GetChild(0).GetComponent <MeshRenderer>();
     GetMeshRenderer().material.color = species.speciesColor;
     GetOrganismMotor().SetupOrganismMotor(species.earth, this);
 }
コード例 #7
0
    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));
    }
コード例 #8
0
    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;
        }
    }
コード例 #9
0
    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 + ")";
    }
コード例 #10
0
 internal override void SetUpSpecificJobController(BasicSpeciesScript speciesScript)
 {
     plantSpecies = (PlantSpecies)speciesScript;
 }
コード例 #11
0
 public override void SetSpeciesScript(BasicSpeciesScript _species)
 {
     animalSpecies = (AnimalSpecies)_species;
 }
コード例 #12
0
    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);
    }
コード例 #13
0
    public void AddNewDot(int timePosition, int populationPosition, Color _color, BasicSpeciesScript _species)
    {
        SetPopulationMax(populationPosition);

        CreateCircle(_color, GetVericalCollum(timePosition), populationPosition, _species);
    }
コード例 #14
0
 internal virtual void SetUpSpecificJobController(BasicSpeciesScript speciesScript)
 {
 }
コード例 #15
0
 public void SetBasicSpeciesScript(BasicSpeciesScript species)
 {
     speciesScript = species;
     SetSpeciesScript(species);
 }
コード例 #16
0
 public abstract void SetSpeciesScript(BasicSpeciesScript species);
コード例 #17
0
 internal override void SetUpSpecificJobController(BasicSpeciesScript speciesScript)
 {
     animalSpecies = (AnimalSpecies)speciesScript;
 }
コード例 #18
0
 public override void SetSpeciesScript(BasicSpeciesScript _species)
 {
     plantSpecies = (PlantSpecies)_species;
 }