Пример #1
0
 void Start()
 {
     slerpRate    = 5f;
     mutationRate = 1;
     foreach (Transform child in transform)
     {
         if (child.tag == "Canvas")
         {
             foreach (Transform grandChild in child)
             {
                 if (grandChild.tag == "Text")
                 {
                     generationDisplay = grandChild.gameObject.GetComponent <GenerationDisplay>();
                 }
             }
         }
         if (child.tag == "Goal")
         {
             goalTransform = child;
         }
     }
     currentGen = 1;
     generationDisplay.genText.text = "Generation: " + currentGen;
     slider1 = GameObject.Find("Slider-speed");
     slider2 = GameObject.Find("Slider-mutate");
     slider3 = GameObject.Find("Slider-population");
     slider4 = GameObject.Find("Slider-slerp");
     button1 = GameObject.Find("Button - start sim");
 }
Пример #2
0
 private void Awake()
 {
     main        = this;
     gameControl = GetComponent <ButtonScript>();
     timeControl = GetComponent <TimeScript>();
     display     = GetComponent <GenerationDisplay>();
 }