Example #1
0
	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);
	}
Example #2
0
    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);
    }
Example #3
0
        /// <summary>
        /// DONT USE THIS METHOD. UNITY INTERNAL MONOBEHAVIOUR.
        /// </summary>
        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();
            rawFilePath = filePath + "Raw.csv";

            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);
        }
Example #4
0
	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);
	}
Example #5
0
 public void SetTraceFormatter(ITraceFormatter traceFormatter)
 {
     this.traceFormatter = traceFormatter;
 }
Example #6
0
 public void SetTraceFormatter(ITraceFormatter traceFormatter)
 {
     this.traceFormatter = traceFormatter;
 }