本文整理汇总了C#中Storage.SetTracker方法的典型用法代码示例。如果您正苦于以下问题:C# Storage.SetTracker方法的具体用法?C# Storage.SetTracker怎么用?C# Storage.SetTracker使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Storage
的用法示例。
在下文中一共展示了Storage.SetTracker方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: Start
public void Start()
{
switch (traceFormat) {
case "json":
this.traceFormatter = new SimpleJsonFormat ();
break;
case "xapi":
this.traceFormatter = new XApiFormat ();
break;
default:
this.traceFormatter = new DefaultTraceFromat ();
break;
}
filePath = GeneratePath ();
switch (storageType) {
case "net":
filePath += "Pending";
mainStorage = new NetStorage (this, host, trackingCode);
mainStorage.SetTracker (this);
backupStorage = new LocalStorage (filePath);
backupStorage.SetTracker (this);
break;
default:
mainStorage = new LocalStorage (filePath);
mainStorage.SetTracker (this);
break;
}
this.startListener.SetTraceFormatter (this.traceFormatter);
this.Connect ();
this.nextFlush = flushInterval;
UnityEngine.Object.DontDestroyOnLoad (this);
}
示例2: Start
public void Start ()
{
switch (traceFormat) {
case "json":
this.traceFormatter = new SimpleJsonFormat ();
break;
case "xapi":
this.traceFormatter = new XApiFormat ();
break;
default:
this.traceFormatter = new DefaultTraceFromat ();
break;
}
switch (storageType) {
case "net":
storage = new NetStorage (this, host, trackingCode);
break;
default:
String path = Application.persistentDataPath;
#if UNITY_ANDROID
AndroidJavaObject env = new AndroidJavaObject("android.os.Environment");
AndroidJavaObject file = env.CallStatic<AndroidJavaObject>("getExternalStorageDirectory");
path = file.Call<String>("getAbsolutePath");
#endif
if (!path.EndsWith ("/")) {
path += "/";
}
path += "traces";
if (debug) {
Debug.Log ("Storing traces in " + path);
}
storage = new LocalStorage (path);
break;
}
storage.SetTracker (this);
this.startListener.SetTraceFormatter (this.traceFormatter);
this.Connect ();
this.nextFlush = flushInterval;
UnityEngine.Object.DontDestroyOnLoad (this);
}