File tree Expand file tree Collapse file tree
Engine3DRadSpace/Projects Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -68,6 +68,7 @@ static void validateEvents(IObject* obj, ObjectList* lst)
6868
6969 auto fn2 = dynamic_cast <IReflectedFunction*>(fn->Clone ().release ());
7070 event->Bind (std::move (std::unique_ptr<IReflectedFunction>(fn2)), invocRepr.OwnerObject , invocRepr.FunctionID );
71+ (event->end () - 1 )->Object = objPtr;
7172 }
7273 }
7374 }
@@ -321,6 +322,7 @@ json Engine3DRadSpace::Projects::Serializer::SerializeObject(IObject* obj)
321322 case FieldRepresentationType::Model:
322323 case FieldRepresentationType::Font:
323324 case FieldRepresentationType::Skybox:
325+ case FieldRepresentationType::Sound:
324326 {
325327 unsigned texture = field->GetAtOffset <unsigned >(objPtr, offset);
326328 jsonField[subFieldName][str_i] = texture;
@@ -658,6 +660,7 @@ json Engine3DRadSpace::Projects::Serializer::SerializeObject(IObject* obj)
658660 case FieldRepresentationType::Model:
659661 case FieldRepresentationType::Font:
660662 case FieldRepresentationType::Skybox:
663+ case FieldRepresentationType::Sound:
661664 {
662665 unsigned value = jsonField.get <unsigned >();
663666
Original file line number Diff line number Diff line change @@ -14,7 +14,7 @@ class MyGame : public Engine3DRadSpace::Game
1414public:
1515 MyGame () : Game(" MyGame" )
1616 {
17- this ->AppendScene (" D:\\ Projects\\ 3D_Rad_Space\\ 3DRadSpace\\ out \\ build \\ x64-Release \\ Projects\\ SpriteBillboard Demo .3drsp" );
17+ this ->AppendScene (" D:\\ Projects\\ 3D_Rad_Space\\ 3DRadSpace\\ Projects\\ SoundEffect + EventOnKey demo .3drsp" );
1818 }
1919
2020 void Update () override
Original file line number Diff line number Diff line change 1+ {
2+ "assets": {
3+ "1": {
4+ "name": "sound",
5+ "path": ".\\D ata \\S ounds\\s o und.wav",
6+ "type": {
7+ "Data1": 3648383198,
8+ "Data2": 29555,
9+ "Data3": 17760,
10+ "Data4": {
11+ "0": 144,
12+ "1": 251,
13+ "2": 156,
14+ "3": 25,
15+ "4": 184,
16+ "5": 70,
17+ "6": 252,
18+ "7": 214
19+ }
20+ }
21+ },
22+ "2": {
23+ "name": "arial",
24+ "path": ".\\D ata \\F o nts\\a rial.ttf",
25+ "type": {
26+ "Data1": 2057170463,
27+ "Data2": 41950,
28+ "Data3": 20053,
29+ "Data4": {
30+ "0": 180,
31+ "1": 216,
32+ "2": 236,
33+ "3": 27,
34+ "4": 254,
35+ "5": 23,
36+ "6": 59,
37+ "7": 134
38+ }
39+ }
40+ }
41+ },
42+ "numAssets": 3,
43+ "numObjects": 3,
44+ "objects": {
45+ "0": {
46+ "Children": [],
47+ "Looping": {
48+ "f": {
49+ "0": false
50+ }
51+ },
52+ "Name": {
53+ "f": {
54+ "0": "SoundEffect"
55+ }
56+ },
57+ "Parent": -1,
58+ "Pitch": {
59+ "f": {
60+ "0": 0.5
61+ }
62+ },
63+ "Play at start": {
64+ "f": {
65+ "0": false
66+ }
67+ },
68+ "Sound": {
69+ "f": {
70+ "0": 1
71+ }
72+ },
73+ "UUID": {
74+ "Data1": 1285180970,
75+ "Data2": 39388,
76+ "Data3": 20065,
77+ "Data4": {
78+ "0": 181,
79+ "1": 203,
80+ "2": 61,
81+ "3": 117,
82+ "4": 181,
83+ "5": 105,
84+ "6": 83,
85+ "7": 31
86+ }
87+ },
88+ "Volume": {
89+ "f": {
90+ "0": 1.0
91+ }
92+ }
93+ },
94+ "1": {
95+ "Children": [],
96+ "Enabled": {
97+ "f": {
98+ "0": true
99+ }
100+ },
101+ "Event": {
102+ "f": {
103+ "0": {
104+ "Invocations": {
105+ "0": {
106+ "FunctionID": 0,
107+ "OwnerObject": 0
108+ }
109+ },
110+ "NumInvocations": 1
111+ }
112+ }
113+ },
114+ "Key": {
115+ "f": {
116+ "0": 32
117+ }
118+ },
119+ "Name": {
120+ "f": {
121+ "0": "EventOnKey"
122+ }
123+ },
124+ "Parent": -1,
125+ "UUID": {
126+ "Data1": 4192075626,
127+ "Data2": 7468,
128+ "Data3": 18957,
129+ "Data4": {
130+ "0": 145,
131+ "1": 117,
132+ "2": 226,
133+ "3": 69,
134+ "4": 158,
135+ "5": 79,
136+ "6": 117,
137+ "7": 210
138+ }
139+ }
140+ },
141+ "2": {
142+ "Children": [],
143+ "Color": {
144+ "f": {
145+ "0": {
146+ "A": 1.0,
147+ "B": 1.0,
148+ "G": 1.0,
149+ "R": 1.0
150+ }
151+ }
152+ },
153+ "Depth": {
154+ "f": {
155+ "0": 0.0
156+ }
157+ },
158+ "Font": {
159+ "f": {
160+ "0": 2
161+ }
162+ },
163+ "Name": {
164+ "f": {
165+ "0": "TextPrint"
166+ }
167+ },
168+ "Parent": -1,
169+ "Position": {
170+ "X": {
171+ "0": 0.3499999940395355
172+ },
173+ "Y": {
174+ "1": 0.5
175+ }
176+ },
177+ "Rotation (rad)": {
178+ "f": {
179+ "0": 0.0
180+ }
181+ },
182+ "Scale": {
183+ "X": {
184+ "0": 1.0
185+ },
186+ "Y": {
187+ "1": 1.0
188+ }
189+ },
190+ "Text": {
191+ "f": {
192+ "0": "Press [Space] to play the sound!"
193+ }
194+ },
195+ "UUID": {
196+ "Data1": 313679566,
197+ "Data2": 43392,
198+ "Data3": 19032,
199+ "Data4": {
200+ "0": 147,
201+ "1": 136,
202+ "2": 135,
203+ "3": 42,
204+ "4": 234,
205+ "5": 159,
206+ "6": 210,
207+ "7": 181
208+ }
209+ },
210+ "Visible": {
211+ "f": {
212+ "0": true
213+ }
214+ }
215+ }
216+ }
217+ }
You can’t perform that action at this time.
0 commit comments