Пример #1
0
    void Update()
    {
        if (Input.GetMouseButton(0))
        {
//			if(MyCube != null)
//				MyCube.GetComponent<Renderer>().material.color = Color.red;

//			try
//			{
                                #if UNITY_ANDROID
            //if(flashControlHelperClass != null)
            flashControlHelperClass.ToggleLight();
                                #endif

//			}
//			catch (System.Exception ex)
//			{
//				Debug.Log(ex.Message);
//				string errorMessage = ex.Message;
//			}

            if (MyCube != null)
            {
                MyCube.GetComponent <Renderer>().material.color = Color.cyan;
            }
        }
        else
        {
            if (flashControlHelperClass == null && MyCube != null)
            {
                MyCube.GetComponent <Renderer>().material.color = Color.red;
            }
            else if (MyCube != null)
            {
                MyCube.GetComponent <Renderer>().material.color = Color.green;
            }
        }
    }
Пример #2
0
    void OnMouseDown()
    {
        GetComponent <Renderer>().material.color = Color.red;

        try
        {
                        #if UNITY_ANDROID
            flashControlHelperClass.ToggleLight();
                        #endif
        }
        catch (System.Exception ex)
        {
            Debug.Log(ex.Message);
        }
    }