Beispiel #1
0
 // Update is called once per frame
 void Update()
 {
     if (Input.GetKeyDown (KeyCode.Keypad0)) {
         EcosystemEntityTree tree = new EcosystemEntityTree();
         tree.Create();
             }
     if (Input.GetKeyDown (KeyCode.Keypad1)) {
         EcosystemEntityHuman human = new EcosystemEntityHuman();
         human.Create();
     }
     if (Input.GetKeyDown (KeyCode.Keypad2)) {
         EcosystemEntityCow cow = new EcosystemEntityCow();
         cow.Create();
     }
 }
Beispiel #2
0
    /// <summary>
    /// Ecosystems the post calculations.
    /// </summary>
    void EcosystemPostCalculations()
    {
        EcosystemEntityTree tree = new EcosystemEntityTree();
        EcosystemEntityHuman human = new EcosystemEntityHuman();
        EcosystemEntityCow cow = new EcosystemEntityCow();

        //Create Tree
        if (EcosystemAtmosphere.Co > 90) {
            tree.Create();
        }

        //Create Human
        if (EcosystemAtmosphere.Oxygen > 90) {
            human.Create();
        }
        //Create Cow
        if (EcosystemAtmosphere.Oxygen > 140) {
            cow.Create();
        }

        //Destroy Tree
        if (EcosystemAtmosphere.Co < 8) {
            tree.Remove();
        }

        //Destroy Human
        if (EcosystemAtmosphere.Oxygen < 8) {
            human.Remove();
        }
        //Destroy Cow
        if (EcosystemAtmosphere.Oxygen < 15) {
            cow.Remove();
        }
    }