File tree Expand file tree Collapse file tree 2 files changed +18
-3
lines changed
InteropUnityCUDA/Assets/Actions Expand file tree Collapse file tree 2 files changed +18
-3
lines changed Original file line number Diff line number Diff line change @@ -40,7 +40,7 @@ public abstract class InteropHandler : MonoBehaviour
40
40
41
41
protected virtual int ReserveCapacity => 16 ;
42
42
43
- protected void Start ( )
43
+ public void InitializeInteropHandler ( )
44
44
{
45
45
// initialize log
46
46
StartLog ( ) ;
@@ -58,7 +58,7 @@ protected virtual void InitializeActions()
58
58
{
59
59
}
60
60
61
- protected void Update ( )
61
+ public void UpdateInteropHandler ( )
62
62
{
63
63
//to update the time used in InteropDll
64
64
SetTime ( Time . time ) ;
@@ -73,7 +73,7 @@ protected virtual void UpdateActions()
73
73
{
74
74
}
75
75
76
- protected void OnDestroy ( )
76
+ public void OnDestroyInteropHandler ( )
77
77
{
78
78
OnDestroyActions ( ) ;
79
79
}
Original file line number Diff line number Diff line change
1
+ using System ;
1
2
using System . Runtime . InteropServices ;
2
3
using Unity . Mathematics ;
3
4
using UnityEngine ;
@@ -108,6 +109,11 @@ private void CreateBuffer()
108
109
_particlesDrawer . InitParticlesBuffer ( _computeBuffer , _sizeBuffer , 0.1f ) ;
109
110
}
110
111
112
+ private void Start ( )
113
+ {
114
+ InitializeInteropHandler ( ) ;
115
+ }
116
+
111
117
/// <summary>
112
118
/// Create the texture and the buffer. Construct action from them. Register these action in InteropUnityCUDA and
113
119
/// call start function on it
@@ -136,6 +142,10 @@ protected override void InitializeActions()
136
142
CallFunctionStartInAction ( _ActionTextureArrayName ) ;
137
143
}
138
144
145
+ public void Update ( )
146
+ {
147
+ UpdateInteropHandler ( ) ;
148
+ }
139
149
140
150
/// <summary>
141
151
/// call update function of the two registered actions
@@ -152,6 +162,11 @@ protected override void UpdateActions()
152
162
_rawImageTextureArray1 . texture = _renderTextureForDisplay1 ;
153
163
}
154
164
165
+ public void OnDestroy ( )
166
+ {
167
+ OnDestroyInteropHandler ( ) ;
168
+ }
169
+
155
170
/// <summary>
156
171
/// call onDestroy function of the two registered actions
157
172
/// </summary>
You can’t perform that action at this time.
0 commit comments