Beispiel #1
0
 public void SaveImage(Texture2D texture, string imageKey)
 {
     if (texture == null)
     {
         return;
     }
     ES3.SaveImage(texture, $"{imageKey}.png");
 }
Beispiel #2
0
    private IEnumerator TakeScreenshot(string fileName)
    {
        //Wait 1 frame so the ui disables itself before we take a screenshot
        yield return(new WaitForEndOfFrame());

        Texture2D newTexture = ScreenCapture.CaptureScreenshotAsTexture();

        ES3.SaveImage(newTexture, fileName + ".png");
        Destroy(newTexture);
    }
Beispiel #3
0
 public override void Enter()
 {
     ES3.SaveImage((Texture2D)texture2D.Value, imagePath.Value, GetSettings());
 }
Beispiel #4
0
    public void Save(string name)
    {
        existingProjects = ES3.Load <List <string> >("Existing Projects");
        if (!FlikittCore.checkExistance(name))
        {
            existingProjects.Add(name);
            ES3.Save <List <string> >("Existing Projects", existingProjects);
        }

        string find = "Project " + name;

        //Save name
        string nm = FlikittCore.project.getName();

        ES3.Save <string>(name + " name", nm);

        //Save size
        int size = FlikittCore.project.getAllFrames().Count;

        ES3.Save <int>(name + " size", size);

        //Save orientations
        List <string> orientations = new List <string>();

        foreach (var frame in FlikittCore.project.getAllFrames())
        {
            orientations.Add(frame.getOrientation());
        }
        ES3.Save <List <string> >(name + " orientations", orientations);

        //Save transparencies
        List <float> transparencies = new List <float>();

        foreach (var frame in FlikittCore.project.getAllFrames())
        {
            transparencies.Add(frame.getTransparency());
        }
        ES3.Save <List <float> >(name + " transparencies", transparencies);

        //Save all images
        foreach (var frame in FlikittCore.project.getAllFrames())
        {
            Texture2D pic = frame.getPicture() as Texture2D;
            ES3.SaveImage(pic, "Project " + name + " Frame " + frame.getNumber() + " image.jpg");
        }

        //Save all lines
        List <Frame> frames = FlikittCore.project.getAllFrames();

        foreach (Frame frm in frames)
        {
            Transform     frameT     = frm.getGOSelf().transform;
            string        frmname    = frameT.gameObject.name;
            int           childCount = frameT.childCount;
            List <string> lineNames  = new List <string>();
            ES3.Save <int>("Project " + name + " " + frameT.gameObject.name + " Child count", childCount);
            for (int i = 0; i < childCount; i++)
            {
                GameObject     ln     = frameT.GetChild(i).gameObject;
                LineRenderer   lr     = ln.GetComponent <LineRenderer>();
                List <Vector3> points = new List <Vector3>();

                for (int p = 0; p < lr.positionCount; p++)
                {
                    points.Add(lr.GetPosition(p));
                }

                lineNames.Add(frameT.GetChild(i).gameObject.name);

                float thickness = lr.startWidth;
                Color lineColor = lr.startColor;

                ES3.Save <float>("Project " + name + " " + frmname + " " + frameT.GetChild(i).gameObject.name + " Thickness", thickness);
                ES3.Save <Color>("Project " + name + " " + frmname + " " + frameT.GetChild(i).gameObject.name + " Color", lineColor);
                ES3.Save <List <Vector3> >("Project " + name + " " + frmname + " " + frameT.GetChild(i).gameObject.name + " Points", points);
            }
            ES3.Save <List <string> >("Project " + name + " " + frmname + " Line names", lineNames);
        }

        //Save Audio, if there is audio, of course.
        if (FlikittCore.project.getAllAudio() != null)
        {
            if (FlikittCore.project.getAllAudio().Count >= 1 && FlikittCore.project.checkAudioCompletion())
            {
                int trackCount = FlikittCore.project.getAllAudio().Count;

                int counter = 1;
                foreach (var clip in FlikittCore.project.getAllAudio())
                {
                    ES3.Save <AudioClip>("Project " + name + " Track " + counter.ToString(), clip);
                    counter++;
                }

                ES3.Save <int>("Project " + name + " Track Amount", trackCount);
            }
        }

        //Save fps
        float fps = FlikittCore.project.getFps();

        ES3.Save <float>(name + " fps", fps);
    }