public void Clear()
 {
     if (Directory.Exists(m_directoryAbsolutPath.GetValue()))
     {
         Directory.Delete(m_directoryAbsolutPath.GetValue(), true);
     }
 }
    private void SaveInTemp()
    {
        string path = GetPath();
        string json = JsonUtility.ToJson(m_tags.m_tagsList);

        File.WriteAllText(path, json);

        if (!string.IsNullOrEmpty(m_jsonSaveDirectoryPath.GetValue()))
        {
            if (!Directory.Exists(m_jsonSaveDirectoryPath.GetValue()))
            {
                Directory.CreateDirectory(m_jsonSaveDirectoryPath.GetValue());
            }

            File.WriteAllText(m_jsonSaveDirectoryPath.GetValue() + PathFileName(), json);
#if UNITY_EDITOR
            UnityEditor.AssetDatabase.Refresh();
#endif
        }
    }
예제 #3
0
    public void CheckForExistingFrame(int frameNumber)
    {
        string filePath = LookForFrame(m_framesDirectory.GetValue(), frameNumber);

        if (!string.IsNullOrEmpty(filePath))
        {
            Texture2D tex = new Texture2D(2, 2);
            // Debug.Log("Found one(" + frameNumber + "):" + filePath);
            byte[] fileData;

            if (File.Exists(filePath))
            {
                fileData = File.ReadAllBytes(filePath);

                tex.LoadImage(fileData);
            }

            Graphics.Blit(tex, m_rendererTexture);
        }
    }