forked from Unity-Technologies/UnityCsReference
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathCustomEventData.bindings.cs
More file actions
63 lines (54 loc) · 1.8 KB
/
Copy pathCustomEventData.bindings.cs
File metadata and controls
63 lines (54 loc) · 1.8 KB
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
56
57
58
59
60
61
62
63
// Unity C# reference source
// Copyright (c) Unity Technologies. For terms of use, see
// https://unity3d.com/legal/licenses/Unity_Reference_Only_License
using System;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.Bindings;
using UnityEngine.Scripting;
using Object = UnityEngine.Object;
namespace UnityEngine.Analytics
{
[StructLayout(LayoutKind.Sequential)]
[NativeHeader("Modules/UnityAnalytics/Events/UserCustomEvent.h")]
internal partial class CustomEventData : IDisposable
{
[System.NonSerialized]
internal IntPtr m_Ptr;
private CustomEventData() {}
public CustomEventData(string name)
{
m_Ptr = Internal_Create(this, name);
}
~CustomEventData()
{
Destroy();
}
void Destroy()
{
if (m_Ptr != IntPtr.Zero)
{
Internal_Destroy(m_Ptr);
m_Ptr = IntPtr.Zero;
}
}
public void Dispose()
{
Destroy();
GC.SuppressFinalize(this);
}
internal static extern IntPtr Internal_Create(CustomEventData ced, string name);
[ThreadSafe]
internal static extern void Internal_Destroy(IntPtr ptr);
public extern bool AddString(string key, string value);
public extern bool AddInt32(string key, Int32 value);
public extern bool AddUInt32(string key, UInt32 value);
public extern bool AddInt64(string key, Int64 value);
public extern bool AddUInt64(string key, UInt64 value);
public extern bool AddBool(string key, bool value);
public extern bool AddDouble(string key, double value);
}
}