Пример #1
0
    public void SelectPhoto(GameObject photo)
    {
        Ray        ray = Camera.main.ScreenPointToRay(Input.mousePosition);
        RaycastHit hit;

        if (Physics.Raycast(ray, out hit) == true)
        {
            Renderer renderer = photo.transform.GetComponent <Renderer>();

            foreach (List <string> list in listPhotos)
            {
                if (list[0] == hit.transform.name.ToString())
                {
                    if (list.Contains(renderer.name) == false)
                    {
                        list.Add(renderer.name);

                        Raycast photoInstance = GameObject.Find(Raycast.GetPhotoZoom().transform.name).GetComponent <Raycast>();
                        photoInstance.CreateMarcadorPhoto(Raycast.GetPhotoZoom(), hit.transform.gameObject.GetComponent <Renderer>().material.color);

                        UpdateTextContainer(hit.transform.name.ToString());
                    }
                    break;
                }
            }

            /*colorContainer = transform.GetComponent<Renderer>().material.color;
             * Debug.Log("luego del while" + colorContainer);
             * StartCoroutine(MarcarContainer(hit.transform.gameObject));
             * Debug.Log("luego del while" + colorContainer);
             * hit.transform.GetComponent<Renderer>().material.color = colorContainer;*/
        }
    }