Exemplo n.º 1
0
    void DollSelected()
    {
        if (Input.GetMouseButtonDown(0))
        {
            RaycastHit Doll = new RaycastHit();
            bool       hit  = Physics.Raycast(Camera.main.ScreenPointToRay(Input.mousePosition), out Doll);

            if (hit)
            {
                if (Doll.transform.gameObject.tag == "Doll")
                {
                    Debug.Log("Mouse");
                    SoundManager.instance.Play("Player", SoundManager.instance.clipList.DollClick);
                    if (spawn.gamelevel == 0)
                    {
                        spawn.CreatDoll();
                    }
                    else if (spawn.gamelevel == 1)
                    {
                        spawn.CreatDoll2();
                    }
                    else if (spawn.gamelevel == 2)
                    {
                        spawn.CreatDoll2();
                    }


                    Destroy(GameObject.Find("Aninha(Clone)"), 0f);
                }
            }
        }
    }