Exemplo n.º 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);
    }
Exemplo n.º 2
0
    public void DropKancil()
    {
        float Distance = Vector3.Distance(Fruit3.transform.position, Fruit3black.transform.position);

        if (Distance < 50)
        {
            Fruit3.transform.position = Fruit3black.transform.position;
            Fruit6.SetActive(true); clickSound.Play();
            ScoreDrag.totalscore += 20;
            Kancilb = false;
            check++;
            //level2++;
            // level3++;
        }
        else
        {
            Fruit3.transform.position = Fruit3iniPost;
        }
    }
Exemplo n.º 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);;
 }