Пример #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));
    }