Example #1
0
    void Start()
    {
        clickSound = Fruit1.GetComponent <AudioSource>();
        bgMusic    = GetComponent <AudioSource>();
        int randomnum = Random.Range(0, 5);

        for (int i = 0; i < randomnum; i++)
        {
            randomPos(x);
        }
        check2        = 0;
        check         = 0;
        time          = 0;
        Fruit7iniPost = Fruit7.transform.position;
        Fruit5iniPost = Fruit5.transform.position;
        Fruit8iniPost = Fruit8.transform.position;
        Fruit6iniPost = Fruit6.transform.position;
        Fruit1iniPost = Fruit1.transform.position;
        Fruit3iniPost = Fruit3.transform.position;
        Fruit2iniPost = Fruit2.transform.position;
        Fruit4iniPost = Fruit4.transform.position;

        Fruit1.SetActive(false); //cat
        Fruit2.SetActive(false); //cow
        Fruit3.SetActive(false); //kancil
        //deer fruit4

        Fruit7.SetActive(false); //bear
        Fruit8.SetActive(false); //frog

        Fruit5.SetActive(false); //fox
        Fruit6.SetActive(false); //mice
        buttonnext1.SetActive(false);
    }
Example #2
0
    public void DropBear()
    {
        float Distance = Vector3.Distance(Fruit7.transform.position, Fruit7black.transform.position);

        if (Distance < 50)
        {
            Fruit7.transform.position = Fruit7black.transform.position;
            ScoreDrag.totalscore     += 20;
            // level3++;
            Bearb = false; clickSound.Play();
            Fruit5.SetActive(true); check++;
        }
        else
        {
            Fruit7.transform.position = Fruit7iniPost;
        }
    }
Example #3
0
 public void allinactive()
 {
     Fruit1.SetActive(false);
     Fruit2.SetActive(false);
     Fruit3.SetActive(false);
     Fruit4.SetActive(false);
     Fruit7black.SetActive(false);
     Fruit5black.SetActive(false);
     Fruit8black.SetActive(false);
     Fruit7.SetActive(false);
     Fruit5.SetActive(false);
     Fruit8.SetActive(false);
     Fruit6.SetActive(false);
     Fruit4.SetActive(false);
     Fruit1black.SetActive(false);
     Fruit6black.SetActive(false);
     Fruit3black.SetActive(false);
     Fruit2black.SetActive(false);
     Fruit4black.SetActive(false);;
 }