|
225 | 225 | ] |
226 | 226 | } |
227 | 227 | ], |
228 | | - "actions": [], |
| 228 | + "actions": [ |
| 229 | + { |
| 230 | + "type": { |
| 231 | + "value": "TopDownMovementAnimator::TopDownMovementAnimator::UpdateAnimationDirection" |
| 232 | + }, |
| 233 | + "parameters": [ |
| 234 | + "Object", |
| 235 | + "Behavior", |
| 236 | + "NewAnimationDirection", |
| 237 | + "" |
| 238 | + ] |
| 239 | + } |
| 240 | + ], |
229 | 241 | "events": [ |
230 | 242 | { |
231 | 243 | "type": "BuiltinCommonInstructions::Standard", |
|
244 | 256 | "actions": [ |
245 | 257 | { |
246 | 258 | "type": { |
247 | | - "value": "TopDownMovementAnimator::TopDownMovementAnimator::SetAnimationPause" |
| 259 | + "value": "TopDownMovementAnimator::TopDownMovementAnimator::UpdateAnimationPause" |
248 | 260 | }, |
249 | 261 | "parameters": [ |
250 | 262 | "Object", |
|
271 | 283 | "actions": [ |
272 | 284 | { |
273 | 285 | "type": { |
274 | | - "value": "TopDownMovementAnimator::TopDownMovementAnimator::SetAnimationSpeedScale" |
| 286 | + "value": "TopDownMovementAnimator::TopDownMovementAnimator::UpdateAnimationSpeedScale" |
275 | 287 | }, |
276 | 288 | "parameters": [ |
277 | 289 | "Object", |
|
280 | 292 | ] |
281 | 293 | } |
282 | 294 | ] |
283 | | - }, |
284 | | - { |
285 | | - "type": "BuiltinCommonInstructions::Standard", |
286 | | - "conditions": [], |
287 | | - "actions": [ |
288 | | - { |
289 | | - "type": { |
290 | | - "value": "SetNumberVariable" |
291 | | - }, |
292 | | - "parameters": [ |
293 | | - "NewAnimationDirection", |
294 | | - "=", |
295 | | - "Object.Behavior::Direction()" |
296 | | - ] |
297 | | - } |
298 | | - ], |
299 | | - "events": [ |
300 | | - { |
301 | | - "type": "BuiltinCommonInstructions::Comment", |
302 | | - "color": { |
303 | | - "b": 109, |
304 | | - "g": 230, |
305 | | - "r": 255, |
306 | | - "textB": 0, |
307 | | - "textG": 0, |
308 | | - "textR": 0 |
309 | | - }, |
310 | | - "comment": "Use a small margin is used to avoid to flicker between 2 directions." |
311 | | - }, |
312 | | - { |
313 | | - "type": "BuiltinCommonInstructions::Standard", |
314 | | - "conditions": [ |
315 | | - { |
316 | | - "type": { |
317 | | - "value": "BuiltinCommonInstructions::CompareNumbers" |
318 | | - }, |
319 | | - "parameters": [ |
320 | | - "abs(Object.Behavior::DirectionDifference(NewAnimationDirection, AnimationDirection))", |
321 | | - ">", |
322 | | - "0.5 + 0.03125" |
323 | | - ] |
324 | | - } |
325 | | - ], |
326 | | - "actions": [ |
327 | | - { |
328 | | - "type": { |
329 | | - "value": "TopDownMovementAnimator::TopDownMovementAnimator::SetAnimationDirection" |
330 | | - }, |
331 | | - "parameters": [ |
332 | | - "Object", |
333 | | - "Behavior", |
334 | | - "NewAnimationDirection", |
335 | | - "" |
336 | | - ] |
337 | | - } |
338 | | - ] |
339 | | - } |
340 | | - ], |
341 | | - "variables": [ |
342 | | - { |
343 | | - "folded": true, |
344 | | - "name": "NewAnimationDirection", |
345 | | - "type": "number", |
346 | | - "value": 0 |
347 | | - } |
348 | | - ] |
349 | 295 | } |
350 | 296 | ] |
351 | 297 | } |
|
412 | 358 | "name": "SetAnimationName", |
413 | 359 | "sentence": "", |
414 | 360 | "events": [ |
| 361 | + { |
| 362 | + "type": "BuiltinCommonInstructions::Comment", |
| 363 | + "color": { |
| 364 | + "b": 109, |
| 365 | + "g": 230, |
| 366 | + "r": 255, |
| 367 | + "textB": 0, |
| 368 | + "textG": 0, |
| 369 | + "textR": 0 |
| 370 | + }, |
| 371 | + "comment": "Also update the animation direction to avoid to play the animation in an old direction for 1 frame." |
| 372 | + }, |
415 | 373 | { |
416 | 374 | "type": "BuiltinCommonInstructions::Standard", |
417 | 375 | "conditions": [ |
|
446 | 404 | "Behavior", |
447 | 405 | "" |
448 | 406 | ] |
| 407 | + }, |
| 408 | + { |
| 409 | + "type": { |
| 410 | + "value": "TopDownMovementAnimator::TopDownMovementAnimator::UpdateAnimationDirection" |
| 411 | + }, |
| 412 | + "parameters": [ |
| 413 | + "Object", |
| 414 | + "Behavior", |
| 415 | + "NewAnimationDirection", |
| 416 | + "" |
| 417 | + ] |
449 | 418 | } |
450 | 419 | ] |
451 | 420 | } |
|
583 | 552 | }, |
584 | 553 | { |
585 | 554 | "type": { |
586 | | - "value": "TopDownMovementAnimator::TopDownMovementAnimator::SetAnimationPause" |
| 555 | + "value": "TopDownMovementAnimator::TopDownMovementAnimator::UpdateAnimationPause" |
587 | 556 | }, |
588 | 557 | "parameters": [ |
589 | 558 | "Object", |
|
737 | 706 | }, |
738 | 707 | { |
739 | 708 | "type": { |
740 | | - "value": "TopDownMovementAnimator::TopDownMovementAnimator::SetAnimationSpeedScale" |
| 709 | + "value": "TopDownMovementAnimator::TopDownMovementAnimator::UpdateAnimationSpeedScale" |
741 | 710 | }, |
742 | 711 | "parameters": [ |
743 | 712 | "Object", |
|
774 | 743 | "description": "Change the animation speed scale according to the object speed.", |
775 | 744 | "fullName": "Animation speed scale", |
776 | 745 | "functionType": "Action", |
777 | | - "name": "SetAnimationSpeedScale", |
| 746 | + "name": "UpdateAnimationSpeedScale", |
778 | 747 | "private": true, |
779 | 748 | "sentence": "Change the animation speed scale according to _PARAM0_ speed", |
780 | 749 | "events": [ |
|
856 | 825 | "description": "Pause the animation according to the object speed.", |
857 | 826 | "fullName": "Animation pause", |
858 | 827 | "functionType": "Action", |
859 | | - "name": "SetAnimationPause", |
| 828 | + "name": "UpdateAnimationPause", |
860 | 829 | "private": true, |
861 | 830 | "sentence": "Pause the animation according to _PARAM0_ speed", |
862 | 831 | "events": [ |
|
1023 | 992 | "objectGroups": [] |
1024 | 993 | }, |
1025 | 994 | { |
1026 | | - "description": "Change the animation direction of the object.", |
1027 | | - "fullName": "Animation name and direction", |
| 995 | + "description": "Update the animation direction of the object.", |
| 996 | + "fullName": "Update animation direction", |
1028 | 997 | "functionType": "Action", |
1029 | | - "name": "SetAnimationDirection", |
| 998 | + "name": "UpdateAnimationDirection", |
1030 | 999 | "private": true, |
1031 | | - "sentence": "Change the animation direction of _PARAM0_ to _PARAM2_", |
| 1000 | + "sentence": "Update the animation direction of _PARAM0_", |
1032 | 1001 | "events": [ |
1033 | 1002 | { |
1034 | 1003 | "type": "BuiltinCommonInstructions::Comment", |
|
1051 | 1020 | "value": "SetNumberVariable" |
1052 | 1021 | }, |
1053 | 1022 | "parameters": [ |
1054 | | - "AnimationDirection", |
| 1023 | + "NewAnimationDirection", |
1055 | 1024 | "=", |
1056 | | - "mod(mod(round(NewDirection), DirectionCount) + DirectionCount, DirectionCount)" |
| 1025 | + "Object.Behavior::Direction()" |
1057 | 1026 | ] |
1058 | | - }, |
1059 | | - { |
1060 | | - "type": { |
1061 | | - "value": "SetNumberVariable" |
1062 | | - }, |
1063 | | - "parameters": [ |
1064 | | - "AnimationElapsedTime", |
1065 | | - "=", |
1066 | | - "Object.Animation::ElapsedTime()" |
1067 | | - ] |
1068 | | - }, |
| 1027 | + } |
| 1028 | + ], |
| 1029 | + "events": [ |
1069 | 1030 | { |
1070 | | - "type": { |
1071 | | - "value": "TopDownMovementAnimator::TopDownMovementAnimator::UpdateAnimationName" |
| 1031 | + "type": "BuiltinCommonInstructions::Comment", |
| 1032 | + "color": { |
| 1033 | + "b": 109, |
| 1034 | + "g": 230, |
| 1035 | + "r": 255, |
| 1036 | + "textB": 0, |
| 1037 | + "textG": 0, |
| 1038 | + "textR": 0 |
1072 | 1039 | }, |
1073 | | - "parameters": [ |
1074 | | - "Object", |
1075 | | - "Behavior", |
1076 | | - "" |
1077 | | - ] |
| 1040 | + "comment": "Use a small margin is used to avoid to flicker between 2 directions." |
1078 | 1041 | }, |
1079 | 1042 | { |
1080 | | - "type": { |
1081 | | - "value": "AnimatableCapability::AnimatableBehavior::SetElapsedTime" |
1082 | | - }, |
1083 | | - "parameters": [ |
1084 | | - "Object", |
1085 | | - "Animation", |
1086 | | - "=", |
1087 | | - "AnimationElapsedTime" |
| 1043 | + "type": "BuiltinCommonInstructions::Standard", |
| 1044 | + "conditions": [ |
| 1045 | + { |
| 1046 | + "type": { |
| 1047 | + "value": "BuiltinCommonInstructions::CompareNumbers" |
| 1048 | + }, |
| 1049 | + "parameters": [ |
| 1050 | + "abs(Object.Behavior::DirectionDifference(NewAnimationDirection, AnimationDirection))", |
| 1051 | + ">", |
| 1052 | + "0.5 + 0.03125" |
| 1053 | + ] |
| 1054 | + } |
| 1055 | + ], |
| 1056 | + "actions": [], |
| 1057 | + "events": [ |
| 1058 | + { |
| 1059 | + "type": "BuiltinCommonInstructions::Standard", |
| 1060 | + "conditions": [], |
| 1061 | + "actions": [ |
| 1062 | + { |
| 1063 | + "type": { |
| 1064 | + "value": "SetNumberVariable" |
| 1065 | + }, |
| 1066 | + "parameters": [ |
| 1067 | + "AnimationDirection", |
| 1068 | + "=", |
| 1069 | + "mod(mod(round(NewAnimationDirection), DirectionCount) + DirectionCount, DirectionCount)" |
| 1070 | + ] |
| 1071 | + }, |
| 1072 | + { |
| 1073 | + "type": { |
| 1074 | + "value": "SetNumberVariable" |
| 1075 | + }, |
| 1076 | + "parameters": [ |
| 1077 | + "AnimationElapsedTime", |
| 1078 | + "=", |
| 1079 | + "Object.Animation::ElapsedTime()" |
| 1080 | + ] |
| 1081 | + }, |
| 1082 | + { |
| 1083 | + "type": { |
| 1084 | + "value": "TopDownMovementAnimator::TopDownMovementAnimator::UpdateAnimationName" |
| 1085 | + }, |
| 1086 | + "parameters": [ |
| 1087 | + "Object", |
| 1088 | + "Behavior", |
| 1089 | + "" |
| 1090 | + ] |
| 1091 | + }, |
| 1092 | + { |
| 1093 | + "type": { |
| 1094 | + "value": "AnimatableCapability::AnimatableBehavior::SetElapsedTime" |
| 1095 | + }, |
| 1096 | + "parameters": [ |
| 1097 | + "Object", |
| 1098 | + "Animation", |
| 1099 | + "=", |
| 1100 | + "AnimationElapsedTime" |
| 1101 | + ] |
| 1102 | + } |
| 1103 | + ], |
| 1104 | + "variables": [ |
| 1105 | + { |
| 1106 | + "folded": true, |
| 1107 | + "name": "AnimationElapsedTime", |
| 1108 | + "type": "number", |
| 1109 | + "value": 0 |
| 1110 | + } |
| 1111 | + ] |
| 1112 | + } |
1088 | 1113 | ] |
1089 | 1114 | } |
1090 | 1115 | ], |
1091 | 1116 | "variables": [ |
1092 | 1117 | { |
1093 | 1118 | "folded": true, |
1094 | | - "name": "AnimationElapsedTime", |
| 1119 | + "name": "NewAnimationDirection", |
1095 | 1120 | "type": "number", |
1096 | 1121 | "value": 0 |
1097 | 1122 | } |
|
1109 | 1134 | "name": "Behavior", |
1110 | 1135 | "supplementaryInformation": "TopDownMovementAnimator::TopDownMovementAnimator", |
1111 | 1136 | "type": "behavior" |
1112 | | - }, |
1113 | | - { |
1114 | | - "description": "Direction", |
1115 | | - "name": "NewDirection", |
1116 | | - "type": "expression" |
1117 | 1137 | } |
1118 | 1138 | ], |
1119 | 1139 | "objectGroups": [] |
|
0 commit comments