Example #1
0
    public void LoadKolores()
    {
        if (TheKamera != null)
        {
            TheKamera.Init();
        }



        if ((Colores != null) && (Kolores.FullList.Count <= 0))
        {
            Kolores.ParseFromFile(Colores);

            SetChildrenCount(Kolores.FullList.Count);

            Select("grises");

            foreach (CopyColor t in Targets)
            {
                if (t)
                {
                    t.CopyColorFromKolor(Kolores.FullList[DefaultColor]);
                }
            }
        }



        int projectCount = KProjectManager.SearchForProjects();

        Debug.Log("Kauel: Proyectos existentes = " + projectCount);
    }
Example #2
0
    private IEnumerator LoadPreviewCoroutine(int id)

    {
        if (!KProjectManager.CheckIfExists(id))

        {
            if (targetRawImage.texture != null)
            {
                DestroyImmediate(targetRawImage.texture);
            }
        }

        else

        {
            string filepreview = Application.persistentDataPath + "/preview" + id + ".png";

            WWW www = new WWW("file://" + filepreview);

            yield return(www);

            if (targetRawImage.texture != null)
            {
                DestroyImmediate(targetRawImage.texture);
            }

            targetRawImage.texture = www.texture;

            www.Dispose();

            Debug.Log("Kauel: Fin IEnumrator");
        }
    }
Example #3
0
    private IEnumerator Load()

    {
        if (!KProjectManager.CheckIfExists(id))

        {
            Debug.LogError("Kauel: No existe el proyecto " + id);
        }

        else

        {
            string filecolor = Application.persistentDataPath + "/color" + id + ".png";

            string filemask = Application.persistentDataPath + "/mask" + id + ".png";

            string fileinfo = Application.persistentDataPath + "/info" + id + ".ceresita";



            Debug.Log("Kauel: Inicio Load");



            //Imagen de Color

            WWW www1 = new WWW("file://" + filecolor);

            yield return(www1);

            Texture2D www1Tex = www1.texture;

            Kamera.Singleton.StartFile(www1Tex);

            www1.Dispose();



            //Mascara

            WWW www2 = new WWW("file://" + filemask);

            yield return(www2);

            Texture2D www2Tex = www2.texture;

            Mat mask = www2Tex.GetNewMat();

            CvInvoke.Flip(mask, mask, FlipType.Vertical);

            Mat wall = Kamera.Singleton.CameraMask();

            mask.CopyTo(wall);

            wall.ApplyToTexture2D(Kamera.Singleton.OutputMaskTexture);

            mask.Dispose();

            www2.Dispose();



            //Color

            WWW www3 = new WWW("file://" + fileinfo);

            yield return(www3);

            string json = www3.text;

            JsonUtility.FromJsonOverwrite(json, this);

            Kamera.Singleton.SelectedColors[0].CopyColorFromKolor(Kolores.FullList[KolorIndex1]);

            Kamera.Singleton.SelectedColors[1].CopyColorFromKolor(Kolores.FullList[KolorIndex2]);

            www3.Dispose();



            Alert.Singleton.CloseAlert(true);



            Kamera.Singleton.Canvas.ShowOnlyThisPanel(3);
        }
    }