-
Notifications
You must be signed in to change notification settings - Fork 160
Expand file tree
/
Copy pathUnityTools.cs
More file actions
55 lines (48 loc) · 912 Bytes
/
UnityTools.cs
File metadata and controls
55 lines (48 loc) · 912 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
//
// @brief: unity相关功能封装
// @version: 1.0.0
// @author helin
// @date: 03/7/2018
//
//
//
#if _CLIENTLOGIC_
using UnityEngine;
#endif
using System.Collections;
public class UnityTools {
public static string playerPrefsGetString(string key)
{
#if _CLIENTLOGIC_
return PlayerPrefs.GetString(key);
#else
return "";
#endif
}
public static void playerPrefsSetString(string key, string value)
{
#if _CLIENTLOGIC_
PlayerPrefs.SetString(key, value);
#endif
}
public static void setTimeScale(float value)
{
#if _CLIENTLOGIC_
Time.timeScale = value;
#endif
}
public static void Log(object message)
{
#if _CLIENTLOGIC_
UnityEngine.Debug.Log(message);
#else
System.Console.WriteLine (message);
#endif
}
public static void LogError(object message)
{
#if _CLIENTLOGIC_
Debug.LogError(message);
#endif
}
}