예제 #1
0
    int             registerHandle(HandleSaveScreenshotEvent h)
    {
        int id = internal_id++;

        handles.Add(id, h);
        return(id);
    }
예제 #2
0
	public void		SaveScreenshotToPublicGalleryAsync(string filename, string album, HandleSaveScreenshotEvent handle)
	{
		if (File.Exists(Application.persistentDataPath + "/" + unique_agent_temp_filename)) File.Delete(Application.persistentDataPath + "/" + unique_agent_temp_filename);
		Application.CaptureScreenshot(unique_agent_temp_filename);
		
		if (!Directory.Exists(GetPublicGalleryPath(album) + "/")) Directory.CreateDirectory(GetPublicGalleryPath(album) + "/");
		StartCoroutine(waitAndCheckForLatestScreenshot(unique_agent_temp_filename, GetPublicGalleryPath(album) + "/" + filename, handle));
		RefreshGallery();
	}
예제 #3
0
 public void             SaveScreenshotAsync(string filepath, HandleSaveScreenshotEvent handle)
 {
     if (File.Exists(Application.persistentDataPath + "/" + unique_agent_temp_filename))
     {
         File.Delete(Application.persistentDataPath + "/" + unique_agent_temp_filename);
     }
     Application.CaptureScreenshot(unique_agent_temp_filename);
     StartCoroutine(waitAndCheckForLatestScreenshot(unique_agent_temp_filename, filepath, handle));
 }
예제 #4
0
    IEnumerator waitAndCheckForLatestScreenshot(string source, string destpath, HandleSaveScreenshotEvent handle)
    {
        yield return(new WaitForSeconds(1));

        if (System.IO.File.Exists(Application.persistentDataPath + "/" + source))
        {
            if (destpath != "")
            {
                if (File.Exists(destpath))
                {
                    File.Delete(destpath);
                }
                System.IO.File.Move(Application.persistentDataPath + "/" + source, destpath);
            }
            if (handle != null)
            {
                handle(SaveScreenshotEvent.Success);
            }
        }
        else
        {
            StartCoroutine(waitAndCheckForLatestScreenshot(source, destpath, handle));
        }
    }
예제 #5
0
	public void		SaveScreenshotAsync(string filepath, HandleSaveScreenshotEvent handle)
	{
		if (File.Exists(Application.persistentDataPath + "/" + unique_agent_temp_filename)) File.Delete(Application.persistentDataPath + "/" + unique_agent_temp_filename);
		Application.CaptureScreenshot(unique_agent_temp_filename);
		StartCoroutine(waitAndCheckForLatestScreenshot(unique_agent_temp_filename, filepath, handle));
	}
예제 #6
0
	int		registerHandle(HandleSaveScreenshotEvent h)
	{
		int id = internal_id++;
		handles.Add(id, h);
		return id;
	}
예제 #7
0
	IEnumerator waitAndCheckForLatestScreenshot(string source, string destpath, HandleSaveScreenshotEvent handle)
	{
		yield return new WaitForSeconds(1);
		if (System.IO.File.Exists(Application.persistentDataPath + "/" + source))
		{
			if (destpath != "")
			{
				if (File.Exists(destpath)) File.Delete(destpath);
				System.IO.File.Move(Application.persistentDataPath + "/" + source, destpath);
			}
			if (handle != null) handle(SaveScreenshotEvent.Success);
		} else
			StartCoroutine(waitAndCheckForLatestScreenshot(source, destpath, handle));
	}
예제 #8
0
    public void             SaveScreenshotToPrivateFolderAsync(string filename, string album, HandleSaveScreenshotEvent handle)
    {
        if (File.Exists(Application.persistentDataPath + "/" + unique_agent_temp_filename))
        {
            File.Delete(Application.persistentDataPath + "/" + unique_agent_temp_filename);
        }
        Application.CaptureScreenshot(unique_agent_temp_filename);

        if (!Directory.Exists(GetPrivateFolderPath(album) + "/"))
        {
            Directory.CreateDirectory(GetPrivateFolderPath(album) + "/");
        }
        StartCoroutine(waitAndCheckForLatestScreenshot(unique_agent_temp_filename,
                                                       GetPrivateFolderPath(album) + "/" + filename
                                                       , handle));
    }