Exemplo n.º 1
0
    void Start()
    {
        if (targetMaterial == null)
        {
            targetMaterial = GameObject.Find("Cube").GetComponent <Renderer>().material;
        }

                #if UNITY_IPHONE
        // Resume
        if (targetMaterial != null)
        {
            var resume = false;
            if (isSaveToLocalFile)
            {
                var savedTex = LoadTextureFromImagePicker.LoadFromLocalFile(saveTexFileName);
                if (savedTex != null)
                {
                    targetMaterial.mainTexture = savedTex;
                    resume = true;
                }
            }
            if (resume == false)
            {
                targetMaterial.mainTexture = defaultTexture;
            }
        }
                #endif
    }