Skip to content

Commit 32fe3ac

Browse files
committed
split files
1 parent f0960fc commit 32fe3ac

File tree

4 files changed

+95
-71
lines changed

4 files changed

+95
-71
lines changed

Assets/UXF/Scripts/DataHandling/FileSaver.cs

Lines changed: 0 additions & 70 deletions
Original file line numberDiff line numberDiff line change
@@ -291,74 +291,4 @@ public static string GetRelativePath(string relativeToDirectory, string path)
291291
return Uri.UnescapeDataString(diff.OriginalString);
292292
}
293293
}
294-
295-
296-
public abstract class LocalFileDataHander : DataHandler
297-
{
298-
[Space, Tooltip("Should the location the data is stored in be: Acquired via the UI, or, a fixed path?")]
299-
public DataSaveLocation dataSaveLocation;
300-
301-
/// <summary>
302-
/// Local path where the data should be stored.
303-
/// </summary>
304-
[Tooltip("If fixed path is selected, where should the data be stored? You could set this value by writing a script that writes to this field in Awake()."), SerializeField]
305-
[BasteRainGames.HideIfEnumValue("dataSaveLocation", BasteRainGames.HideIf.Equal, (int) DataSaveLocation.AcquireFromUI)]
306-
public string storagePath = "~";
307-
308-
[HideInInspector]
309-
public UnityEvent onValidateEvent = new UnityEvent();
310-
311-
/// <summary>
312-
/// Called when the script is loaded or a value is changed in the
313-
/// inspector (Called in the editor only).
314-
/// </summary>
315-
void OnValidate()
316-
{
317-
onValidateEvent.Invoke();
318-
}
319-
320-
321-
# if UNITY_EDITOR
322-
/// <summary>
323-
/// Returns true if this data handler is definitley compatible with this build target.
324-
/// </summary>
325-
/// <param name="buildTarget"></param>
326-
/// <returns></returns>
327-
public override bool IsCompatibleWith(UnityEditor.BuildTargetGroup buildTarget)
328-
{
329-
switch (buildTarget)
330-
{
331-
case UnityEditor.BuildTargetGroup.Standalone:
332-
return true;
333-
default:
334-
return false;
335-
}
336-
}
337-
338-
/// <summary>
339-
/// Returns true if this data handler is definitley incompatible with this build target.
340-
/// </summary>
341-
/// <param name="buildTarget"></param>
342-
/// <returns></returns>
343-
public override bool IsIncompatibleWith(UnityEditor.BuildTargetGroup buildTarget)
344-
{
345-
switch (buildTarget)
346-
{
347-
case UnityEditor.BuildTargetGroup.WebGL:
348-
case UnityEditor.BuildTargetGroup.Android:
349-
case UnityEditor.BuildTargetGroup.iOS:
350-
return true;
351-
default:
352-
return false;
353-
}
354-
}
355-
# endif
356-
357-
}
358-
359-
public enum DataSaveLocation
360-
{
361-
AcquireFromUI, Fixed
362-
}
363-
364294
}
Lines changed: 83 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,83 @@
1+
using System.Collections;
2+
using System.Collections.Generic;
3+
using UnityEngine;
4+
using UnityEngine.Events;
5+
using System;
6+
using System.IO;
7+
using System.Threading;
8+
using System.Linq;
9+
10+
11+
namespace UXF
12+
{
13+
public abstract class LocalFileDataHander : DataHandler
14+
{
15+
[Space, Tooltip("Should the location the data is stored in be: Acquired via the UI, or, a fixed path?")]
16+
public DataSaveLocation dataSaveLocation;
17+
18+
/// <summary>
19+
/// Local path where the data should be stored.
20+
/// </summary>
21+
[Tooltip("If fixed path is selected, where should the data be stored? You could set this value by writing a script that writes to this field in Awake()."), SerializeField]
22+
[BasteRainGames.HideIfEnumValue("dataSaveLocation", BasteRainGames.HideIf.Equal, (int) DataSaveLocation.AcquireFromUI)]
23+
public string storagePath = "~";
24+
25+
[HideInInspector]
26+
public UnityEvent onValidateEvent = new UnityEvent();
27+
28+
/// <summary>
29+
/// Called when the script is loaded or a value is changed in the
30+
/// inspector (Called in the editor only).
31+
/// </summary>
32+
void OnValidate()
33+
{
34+
onValidateEvent.Invoke();
35+
}
36+
37+
38+
# if UNITY_EDITOR
39+
/// <summary>
40+
/// Returns true if this data handler is definitley compatible with this build target.
41+
/// </summary>
42+
/// <param name="buildTarget"></param>
43+
/// <returns></returns>
44+
public override bool IsCompatibleWith(UnityEditor.BuildTargetGroup buildTarget)
45+
{
46+
switch (buildTarget)
47+
{
48+
case UnityEditor.BuildTargetGroup.Standalone:
49+
return true;
50+
default:
51+
return false;
52+
}
53+
}
54+
55+
/// <summary>
56+
/// Returns true if this data handler is definitley incompatible with this build target.
57+
/// </summary>
58+
/// <param name="buildTarget"></param>
59+
/// <returns></returns>
60+
public override bool IsIncompatibleWith(UnityEditor.BuildTargetGroup buildTarget)
61+
{
62+
switch (buildTarget)
63+
{
64+
case UnityEditor.BuildTargetGroup.WebGL:
65+
case UnityEditor.BuildTargetGroup.Android:
66+
case UnityEditor.BuildTargetGroup.iOS:
67+
return true;
68+
default:
69+
return false;
70+
}
71+
}
72+
# endif
73+
74+
}
75+
76+
public enum DataSaveLocation
77+
{
78+
AcquireFromUI, Fixed
79+
}
80+
81+
82+
83+
}

Assets/UXF/Scripts/DataHandling/LocalFileDataHander.cs.meta

Lines changed: 11 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

docs/wiki

Submodule wiki updated from 61e09ca to 6ed024c

0 commit comments

Comments
 (0)