public void SetUpJobController(BasicSpeciesScript speciesScript, EarthScript earth)
 {
     this.earth         = earth;
     this.speciesScript = speciesScript;
     SetUpSpecificJobController(speciesScript);
     Allocate();
 }
Exemple #2
0
 public EarthState SetEarthState(EarthScript earthScript)
 {
     sunPostion  = earthScript.GetSunPosition();
     earthRadius = earthScript.GetRadius();
     humidity    = earthScript.humidity;
     temperature = earthScript.tempeture;
     return(this);
 }
Exemple #3
0
    public virtual void SetupOrganismMotor(EarthScript earth, BasicOrganismScript organismScript)
    {
        this.earth          = earth;
        this.organismScript = organismScript;
        transform.parent.SetParent(earth.GetOrganismsTransform());
        Vector3 previousSize = transform.parent.localScale;

        transform.parent.localScale    = new Vector3(1, 1, 1);
        transform.parent.localPosition = new Vector3(0, .5f, 0);
        transform.localScale           = new Vector3(transform.localScale.x * previousSize.x, transform.localScale.y * previousSize.y, transform.localScale.z * previousSize.z);
    }
Exemple #4
0
 public void SetupSimulation(EarthScript earth, SunScript sun)
 {
     this.earth      = earth;
     this.sun        = sun;
     gameObject.name = speciesName;
     foreach (var organ in GetComponents <BasicSpeciesOrganScript>())
     {
         organ.SetBasicSpeciesScript(this);
     }
     SetupSpecificSimulation();
     jobController = GetComponent <BasicJobController>();
 }
    public void OnFinishedLoadingAllScene()
    {
        earth = GameObject.Find("Earth").GetComponent <EarthScript>();
        sun   = GameObject.Find("Sun").GetComponent <SunScript>();

        SpeciesManager.Instance.GetSpeciesMotor().enabled = true;
        SpeciesManager.Instance.GetSpeciesMotor().SetupSimulation(earth, sun);
        earth.SetUpEarth(earthSize, simulationSpeed);
        sun.SetupSun(earth);
        SpeciesManager.Instance.GetSpeciesMotor().StartSimulation();
        User.Instance.StartSimulation();
        simulationInitialised = true;
        earth.StartSimulation();
    }
Exemple #6
0
 public void SetupSimulation(EarthScript earth, SunScript sun)
 {
     this.earth  = earth;
     canvasUI    = GameObject.Find("Canvas");
     graphWindow = canvasUI.transform.GetChild(0).GetComponent <GraphWindow>();
     graphWindow.gameObject.SetActive(false);
     for (int i = 0; i < transform.childCount; i++)
     {
         GameObject newCountPrefab = Instantiate(populaitonCountPrefab, GetPopulationCountParent());
         newCountPrefab.GetComponent <SpeciesPopulaitonCount>().SetSpecies(transform.GetChild(i).GetComponent <BasicSpeciesScript>(), i);
     }
     foreach (var speciesHolder in GetAllSpeciesHolders())
     {
         speciesHolder.Destroy();
     }
     for (int i = 0; i < transform.childCount; i++)
     {
         allSpecies.Add(transform.GetChild(i).GetComponent <BasicSpeciesScript>());
         transform.GetChild(i).GetComponent <BasicSpeciesScript>().speciesIndex = i;
     }
     for (int i = 0; i < GetAllSpecies().Count; i++)
     {
         if (GetAllSpecies()[i].GetComponent <AnimalSpecies>() != null)
         {
             animalSpecies.Add(GetAllSpecies()[i].GetComponent <AnimalSpecies>());
             GetAllSpecies()[i].specificSpeciesIndex = animalSpecies.Count - 1;
         }
     }
     for (int i = 0; i < GetAllSpecies().Count; i++)
     {
         if (GetAllSpecies()[i].GetComponent <PlantSpecies>() != null)
         {
             plantSpecies.Add(GetAllSpecies()[i].GetComponent <PlantSpecies>());
             GetAllSpecies()[i].specificSpeciesIndex = plantSpecies.Count - 1;
         }
     }
     foreach (var species in GetAllSpecies())
     {
         species.SetupSimulation(earth, sun);
     }
 }
Exemple #7
0
    private void OnTriggerEnter(Collider HitScan)
    {
        EnemyScript enemy = HitScan.GetComponent <EnemyScript>();

        if (enemy != null)
        {
            enemy.TakeDamage(1);
            Destroy(gameObject);
        }
        BossScript Boss = HitScan.GetComponent <BossScript>();

        if (Boss != null)
        {
            Boss.TakeDamage(1);
            Destroy(gameObject);
        }
        EarthScript Wall = HitScan.GetComponent <EarthScript>();

        if (Wall != null)
        {
            Destroy(gameObject);
        }
    }
Exemple #8
0
 public void SetupZoneController(EarthScript earth)
 {
     this.earth         = earth;
     FindZoneController = GetComponent <FindZoneController>();
     FindZoneController.SetUpJobController(earth);
 }
 public void SetUpJobController(EarthScript earth)
 {
     this.earth = earth;
     Allocate();
 }
Exemple #10
0
 public void SetupSun(EarthScript earth)
 {
     this.earth = earth;
     lensFlare  = GetComponentInChildren <LensFlare>();
     sunLight   = GetComponentInChildren <Light>();
 }