Example #1
0
 // Start is called before the first frame update
 void Start()
 {
     tracker = 1;
     //finds the punnentt gameobject that holds the punnett script that calculates the punnett square
     square = GameObject.FindGameObjectWithTag("punnett").GetComponent <Punnett>();
     //GenerateTargetFlower();
     FlowerSpawning();
     //objectiveText.text = "Find two flowers petals you like";
 }
Example #2
0
    //private GameObject pod1;
    //private GameObject pod2;

    // Start is called before the first frame update
    void Start()
    {
        bgb              = breedGraphic.GetComponent <BreedGraphicBehavior>();
        square           = GameObject.FindGameObjectWithTag("punnett").GetComponent <Punnett>();
        collectText.text = "Go Outside to the Left and Collect traits!";

        //pod1 = GameObject.Find("Pod1");
        //pod2 = GameObject.Find("Pod2");
    }
Example #3
0
    // Start is called before the first frame update
    void Start()
    {
        square = GameObject.FindGameObjectWithTag("punnett").GetComponent <Punnett>();
        gm     = GameObject.FindGameObjectWithTag("GameManager").GetComponent <GameManager>();

        if (potNum == 1)
        {
            int rand;

            //find more efficent way of assigning random traits
            //COLOR
            rand = Random.Range(1, 4);

            if (rand == 1) // two big
            {
                prevColor = 1;
            }

            else if (rand == 2) // two small
            {
                prevColor = 2;
            }

            else if (rand == 3) // one big one small
            {
                prevColor = 3;
            }


            //STEM
            rand = Random.Range(1, 4);

            if (rand == 1) // two big
            {
                prevStem = 1;
            }

            else if (rand == 2) // two small
            {
                prevStem = 2;
            }

            else if (rand == 3) // one big one small
            {
                prevStem = 3;
            }


            //PETAL
            rand = Random.Range(1, 4);

            if (rand == 1) // two big
            {
                prevPetal = 1;
            }

            else if (rand == 2) // two small
            {
                prevPetal = 2;
            }

            else if (rand == 3) // one big one small
            {
                prevPetal = 3;
            }


            //THORNS
            rand = Random.Range(1, 4);

            if (rand == 1) // two big
            {
                prevThorns = 1;
            }

            else if (rand == 2) // two small
            {
                prevThorns = 2;
            }

            else if (rand == 3) // one big one small
            {
                prevThorns = 3;
            }

            GameObject flower = Instantiate(flowerPrefab, transform);
            flower.transform.localPosition = new Vector3(0, 1.25f, 0);

            flower.GetComponent <FlowerBehaviour>().colorTraits  = prevColor;
            flower.GetComponent <FlowerBehaviour>().stemTraits   = prevStem;
            flower.GetComponent <FlowerBehaviour>().petalTraits  = prevPetal;
            flower.GetComponent <FlowerBehaviour>().thornsTraits = prevThorns;
            flower.GetComponent <FlowerBehaviour>().SpawnedInPot();
        }
    }