Commit Graph

244 Commits

Author SHA1 Message Date
Adam Ramberg
2e11570e74 v4.5.0 2023-12-19 05:21:21 +01:00
Soraphis
7d9bb753ff
Reduced debug overhead of Events (#435)
* fix: memory allocations due to boxing when creating a StackTraceEntry with disabled DebugMode.
fix: slow repeaded lookups of EditorPrefs for determining DebugMode

* Cleaning up code that was affected by work on #434

- removed dead code
- fixed formatting

Commit-Type: Refactor
2023-12-19 05:11:30 +01:00
Adam Ramberg
4576277a19
Fix value field height in reference drawer for older Unity versions (#447)
* Fix value field height in reference drawer for older unity versions

* Fix property height for quaternions

* Fix property field height for quaternions in variable editor as well

* Fix comment
2023-12-19 00:38:03 +01:00
ToasterHead
53bc009865
#441 [FEATURE] Auto drag and drop atom references through inspector without the need to manually switch usage type (#440)
* Added the ability to drag and drop any atom reference to a `AtomReference` without the need to manually select the type through the 3 dot button on inspector

- I also refactored the `AtomBaseReferenceDrawer` script so that it's easier to read/maintain.
- The class `BaseAtomInstancer` is needed to be able to auto reference instancers. Because when we drag a `GameObject` we need to get it's `AtomInstancer` component to determine the reference type. Also, the class represents something similiar to `BaseAtom` for `ScriptableObjects` but for `MonoBehaviors`, so it makes sense to have it.

* Addressed some of the key points @soraphis made and fixed the issues I mentioned on the #442 pull

- Solved the probelms that arise when a `GameObject` has multiple different instancers in it (mentioned in the #442 pull)
- Removed `UsageIndex` class as it is not needed

* Fixed file name not matching the class name

* Addressed @soraphis issue of `GuiData` not being a struct, so I changed it and modified the `AtomBaseReferenceDrawer` to handle it as a struct

* Fixed `GuiData` isn't updated even though `position` and `label` parameters of the `OnGUI` are.

* Reversed the for loops order because the order of the components inside the `GameObject` are more important than the order of the "usages" so it fixes that problem

- Also cleaned the code a bit

* Missed a line that could be simplified

- Made `Set/GetUsageIndex` into static because we can

* Fixed issue mentioned in #442 > "you only get the first component, when dragging in a game object, so there could be the case where selecting the type manually and dragging into it will swap the field"

The issue is when there are multiple instancer components in a single `GameObject` then when you drag said `GameObject` then the atom reference will switch to the first instancer (via usage index) no matter the intent of the user. However, the intent of the user could be to pick the 2nd or 3rd reference, so he could manually select the usage type using the 3 dots button, but it won't work if he decides to drag and drop a `GameObject` that has multiple instancers that the reference could switch to automatically, which will always be the first instancer of the dragged `GameObject`, which bascially makes the experience frustrating to that particular scenario. Now, you can guess that the issue is hyper specific just because of how hard it is to me to explain it in text, so don't worry if you didn't get it on the first read. If you would like me to showcase it, I will gladly share a video example of what I mean.

* Fixed index out of range exception (I forgot that I set the usage index at the end of this method and it could be -1 because of this line)

* Redone the previous push because it was incorrect

* Response to @AdamRamberg to try to make the code section clearer by refactoring it

* * Minor cosmetic changes
* Replace switch expression to be backwards compatible (for example to be able to run the unity-atoms-example project)
* Always remove the last greater than symbol in GetPropertyTypeName to take into account generic types

* Added comment to IAtomInstancer

---------

Co-authored-by: Adam Ramberg <adam@mambojambostudios.com>
2023-12-18 22:46:11 +01:00
Adam Ramberg
37ead24dbb v4.4.8 2023-08-08 20:28:19 +02:00
Adam Ramberg
808af5bb74
Add appropriate UNITY_EDITOR compiler flags (#425) 2023-08-08 20:25:12 +02:00
Adam Ramberg
d3da0409e9 v4.4..7 2023-08-04 23:29:29 +02:00
Soraphis
2d2ae9b12f
Handling dead references when resetting objects. (#421)
* fix: handling dead references when resetting objects. (#417)

* fix: wrong state checked in AtomEvent reset (#403)

* fix: make AtomValueList compatible with disabled domain reload (#419)
fix: AtomValueList now resets runtime modifications (#418)

* fix: handling dead references when resetting objects for AtomValueList. (#417)

* removed the dead-reference handling (#417)
- this will be addressed in (#421)
compacted the Playmode state change

* Remove Atom types from their _instances lists OnDisable()

* Added disclaimer / comment regarding the solution

---------

Co-authored-by: Adam Ramberg <adam@mambojambostudios.com>
2023-08-04 23:19:42 +02:00
Adam Ramberg
0899d4113d Fixed formatting in AtomValueList 2023-08-03 23:30:17 +02:00
Soraphis
db3ed28471
AtomValueList disabled domain reload compatibility (#420)
* fix: wrong state checked in AtomEvent reset (#403)

* fix: make AtomValueList compatible with disabled domain reload (#419)
fix: AtomValueList now resets runtime modifications (#418)

* fix: handling dead references when resetting objects for AtomValueList. (#417)

* removed the dead-reference handling (#417)
- this will be addressed in (#421)
compacted the Playmode state change
2023-08-03 23:14:26 +02:00
Soraphis
7992efc98d
fix: FSM not compatible with disabled domain reload (#402) (#422) 2023-08-03 07:20:29 +02:00
Adam Ramberg
d38b8f236e v4.4.6 2023-07-22 19:18:13 +02:00
Thimo
4912480957
#67 [FEATURE] Set event name suggestion on Variable Changed event creation (#317)
* [Added] Feature for #67 event name suggestion initial version

* [Refactored] Cleaned naming code to its own class

* [Fixed] c# range is not supported in 2019.4 LTS

* * Simplified logic for suggested name in AtomDrawer
* Simplified CleanPropertyName - first if-block was catched by second block
* Replaced FilterLastIndexOf with typeof(T).Name

---------

Co-authored-by: Thimo de Ram <tdram@esites.local>
Co-authored-by: Adam Ramberg <adam@mambojambostudios.com>
2023-07-22 18:54:35 +02:00
Soraphis
62bc3c9812
fix: Event Replay Buffer not cleared when domain reload disabled (#403)
* fix: event replay buffer persisting if domain reload disabled

* fix: clearing event registrations when changing playmode stage.
2023-07-19 19:47:43 +02:00
Soraphis
b225290b48
FIX: Using TextField in AssetGenerator does not work as expected (#409)
* fix: pasting FullQualifiedName in the generators text field, not picking up the actual type

* fix: replaced TryAdd call to support lower .NET versions
2023-07-19 19:40:38 +02:00
Soraphis
f75215adba
fix: SyncGameObjectToList adding object multiple times to list (#389) 2023-07-18 23:09:23 +02:00
Soraphis
fb471754bc
prevents FiniteStateMachineMonoHook singleton from being unloaded (#386) 2023-07-18 22:48:06 +02:00
Adam Ramberg
d6d3fbb1aa
Call base impl of ImplSpecificSetup() in FSM instancer (#373) 2022-10-24 23:04:31 +02:00
Soraphis
1d498090e3
prevent null reference exceptions in editor when using not-serializab… (#371)
* prevent null reference exceptions in editor when using not-serializable types

* - Draw warning helpbox only once in AtomVariableEditor.cs
- Minor clean up

* Revert unintended removed line

Co-authored-by: Adam Ramberg <adam@mambojambostudios.com>
2022-10-24 00:22:30 +02:00
Soraphis
9cf1b60a06
fix: corrected IEquatable implementation check (#362) 2022-10-23 23:03:20 +02:00
Soraphis
bc2a68527f
fix: #363 enum property did not return int value, but index (#364) 2022-10-23 22:51:31 +02:00
Soraphis
b457ac386f
removed ondisable method, to fix #349 (#369)
* removed ondisable method, to fix #349

* Remove _changed and _changedInstantiatedAtRuntime since they are not used anymore

Co-authored-by: Adam Ramberg <adam@mambojambostudios.com>
2022-10-23 22:34:12 +02:00
Soraphis
b2e302498d
fix: #353 "Vector2/3 reference not properly showing" (#359)
* fix: #353 while keeping #289 fixed

* Fix height of popup (was covering click area of expanded type's properties)

Co-authored-by: Adam Ramberg <adam@mambojambostudios.com>
2022-10-22 23:53:10 +02:00
Miika Lönnqvist
12515aefc8
Update all version references to 4.4.5 (#350) 2022-05-09 22:50:56 +02:00
Soraphis
4ee7155b63 fix: conditional compilation for EDITOR only code 2022-04-28 07:36:58 +02:00
Miika Lönnqvist
3b39e6a2f1
Prepare for release of 4.4.4 (#343)
* Update CHANGELOG

* Update version in documentation to 4.4.4

* Remove reference to Examples directory

* Update package-lock.json

* Update API documentation
2022-04-17 22:52:38 +02:00
Thimo de Ram
5c094f1b10 [Removed] Debug mode logging 2022-03-15 21:28:03 +01:00
Thimo de Ram
a64ae84096 [Changed] NRE to Debug.Log 2022-03-15 21:28:03 +01:00
Thimo de Ram
46037ac590 fix #321 NRE when Event Reference Listeners event reference is not set 2022-03-15 21:28:03 +01:00
Soraphis
9837fff97f fixing unnecessary allocations when debug mode disabled 2022-02-27 10:07:45 +01:00
CaseyDeCoder
aecaa73ad0 Fix hasChildren display in AtomReferences
The display of an AtomReference would act a bit weird if the Atom was of e.g. a serializable class.
2021-12-28 16:14:11 +01:00
Thimo de Ram
7c372e6c38 Feature #293 changed private list variable to protected to support custom classes 2021-12-28 16:00:47 +01:00
Simon Bucher
3aa06a70a1 Fix ChangedOnOnEnable not triggered
When using an Event Reference Listener with a variable, GetOrCreateEvent() is sometimes called after TriggerInitialEvents(). This commit solves this issue.
2021-12-28 14:13:02 +01:00
eduardo
c810df67f0 FiniteStateMachine not listening to Raise Event To Complete Transition #296 2021-12-27 13:58:49 +01:00
Soraphis
a7240651f6
fix #305 empty list of tagged objects throws NRE (#306)
* fix #305 empty list of tagged objects throws NRE
* added missing indexer
2021-11-28 16:03:27 +01:00
Thimo de Ram
8c1d6f215c fix #237 Drawer property value is null error 2021-11-27 14:22:26 +01:00
Miika Lönnqvist
902f9719e8 Remove extra underscore from ChangedHistoryEvent 2021-11-27 13:51:10 +01:00
Thimo
225b8f7962
Fix #255 AtomVariableInstancer assumes Base != null (#309)
Co-authored-by: Thimo de Ram <tdram@esites.local>
2021-11-27 13:40:30 +01:00
Thimo de Ram
67833f3c29 [Fixed] event refernce listener listening to old event 2021-11-27 13:29:18 +01:00
Thimo de Ram
1c0ebd0e85 fix #254 ulong cast error 2021-11-27 13:11:55 +01:00
Thimo de Ram
7c86054f88 fix #252 Removed duplicate function definition 2021-11-27 12:00:22 +01:00
Thimo de Ram
a7b3d7b91a fix #282 changed/changedwithhistory events not created when registered in code 2021-11-27 11:54:55 +01:00
Kyrw
a7c9c69fcf
Fixed collection deserialization problem. (#300)
* Fixed collection deserialization problem

ScriptableObjects arent granted to be initialized on a particular order and might be used by the collection before they are initialized.

* Update CHANGELOG.md

Co-authored-by: eduardo <eduardo@firasoft.com>
Co-authored-by: Casey Hofland <hofland.casey@gmail.com>
2021-09-23 21:39:23 +02:00
Miika Lönnqvist
7b29e15be2
Revert "Use event references in mono hooks (#271)" (#287)
This reverts commit 25412ab2a8.
2021-07-04 12:41:05 +02:00
Simon Bucher
25412ab2a8
Use event references in mono hooks (#271) 2021-07-04 11:42:46 +02:00
Miika Lönnqvist
c2dd13712f
Fix conditions not serializing in Unity 2019 (#278) 2021-07-04 11:18:46 +02:00
Jonas Bötel
e794dcf650
Fixed specifying package dependencies (#284)
Looking good, nice work!
2021-06-21 15:20:40 +02:00
Casey Hofland
907cf70918
Speedup Atom Generation (#275)
* Speedup Atom Generation

This simple change will speed up atom generation via an AtomGenerator. The whole thing will only take 10 seconds instead of +1 minute.

* Update the changelog
2021-05-03 20:06:58 +02:00
Adam Ramberg
120a0b88c6 🧑‍🔬 v4.4.3 2021-03-07 21:49:39 +01:00
Miika Lönnqvist
989a262e10 Update website URL in docs (#257) 2021-03-07 21:49:39 +01:00