Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add workaround for "Enter Play Mode" feature to enable initial values #182

Merged
merged 3 commits into from Sep 6, 2020

Conversation

hazarartuner
Copy link
Contributor

@hazarartuner hazarartuner commented Jul 18, 2020

This may not be the optimal solution but It seems working and we can think this as a workaround until we find a better approach.

Important Note: If you enable the "Enter Pay Mode" feature in Unity, you have to restart the editor to make this workaround work.

Copy link
Collaborator

@soraphis soraphis left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

are lists the only things affected? wouldn't we need those changes on basically all atom types?

@hazarartuner
Copy link
Contributor Author

are lists the only things affected? wouldn't we need those changes on basically all atom types?

Actually it should affect all atom variables, not just atom lists. It collects all atom instances in a List maybe this looks to you like it is working only for lists but it is not.

@soraphis
Copy link
Collaborator

soraphis commented Jul 25, 2020

are lists the only things affected? wouldn't we need those changes on basically all atom types?

Actually it should affect all atom variables, not just atom lists. It collects all atom instances in a List maybe this looks to you like it is working only for lists but it is not.

oh, dang. you're right. I let the _instances variable confuse me. sorry, my bad.

Why not using a HashSet instead of a list? you wouldn't need to remove+add

@hazarartuner
Copy link
Contributor Author

are lists the only things affected? wouldn't we need those changes on basically all atom types?

Actually it should affect all atom variables, not just atom lists. It collects all atom instances in a List maybe this looks to you like it is working only for lists but it is not.

oh, dang. you're right. I let the _instances variable confuse me. sorry, my bad.

Why not using a HashSet instead of a list? you wouldn't need to remove+add

You are right :) I've replaced the List type with HashSet :D

@AdamRamberg
Copy link
Collaborator

@hazarartuner Thanks for this PR! The PR looks good. I would like however you to do 2 things before I will merge this change:

  1. Could you rebase with current canary changes.
  2. Would like you to add this feature under a feature flag for now, since it's considered a work around and will very likely be changed in a future minor release of Unity Atoms. I want you to add a flag similar to IsDebugModeEnabled in AtomPreferences and call it something like "Enter Play Mode (Experimental)" / IsEnterPlayModeEnabled. Then use that variable to toggle the code that you added in your previous commits.

Let me know if you got any questions!

@soraphis
Copy link
Collaborator

soraphis commented Sep 4, 2020

Would like you to add this feature under a feature flag for now...

not sure if this is necessary, since it already uses if (EditorSettings.enterPlayModeOptionsEnabled). so users already need to toggle one experimental flag in the settings, which will break unity atoms, leaving the feature broken until a second flag is toggled on seems to be quite redundant.

@hazarartuner could you please rebase this feature onto the current canary? thanks.

@hazarartuner
Copy link
Contributor Author

@soraphis @AdamRamberg I rebased it. Is it enough?

@soraphis
Copy link
Collaborator

soraphis commented Sep 5, 2020

@AdamRamberg @miikalo I'd accept this PR even though there is not a Atom Specific "feature toggle" in the settings, because I think toggling the feature itself in unity should be enough.

what do you think (if I receive no answer till tomorrow, I'll accept the PR)

@miikalo
Copy link
Collaborator

miikalo commented Sep 6, 2020

@AdamRamberg @miikalo I'd accept this PR even though there is not a Atom Specific "feature toggle" in the settings, because I think toggling the feature itself in unity should be enough.

what do you think (if I receive no answer till tomorrow, I'll accept the PR)

Without workaround: "Enter play mode" enabled in Unity, Atoms breaks, feature disabled, Atoms works.
With workaround: "Enter play mode" enabled in Unity, Atoms works, feature disabled, still works.

So if the workaround does not bother Unity when the "Enter play mode" feature is disabled, everything should be fine. I agree with @soraphis that an additional flag would confuse things here.

@soraphis soraphis merged commit 5a0a29f into unity-atoms:canary Sep 6, 2020
@soraphis soraphis added this to the v4.4 milestone Oct 5, 2020
@TowerCrow
Copy link

Does this PR also addresses Start Cleared option on ValueLists? Because that also doesn't work when the new Enter Play Mode settings are enabled.

CaseyHofland added a commit that referenced this pull request Apr 11, 2021
* #160 - Hook up OnFixedUpdate handler

* Debug events by displaying stack traces for events (#159)

* Add stack trace toggled via user prefs

* Add docs regarding preferences

* Rename color getter functions

* Fix minior order of execution bug

* Use GUID + improved styling of detailed stack view

* - Changed the AddStackTrace method to be conditional (from one of your initial suggestions).
- Removed the implicit conversion operator in StackTraceEntry and is instead using ToString explicitly when needed.
- Improved implementation of GetFirstLine
- Simplified Equals implementation of the StackTraceEntry class

* Changelog + assembly fixes

* #164 - Does not work in Unity 2018.3

* Add #164 to changelog

* 🐝 v4.2.0

* Hacks to get docs generator working

* - Fixed clear button handler for StackTraces
- Fixed and rearranged StackTraces compiler flags

* 🐞v4.2.1

* Make IsUnityAtomsRepo OS agnostic (#168)

* Make Examples path check OS agnostic.

Co-authored-by: jrmacgill <jmacgill@gmail.com>

* Update AtomBaseReferenceDrawer.cs (#174)

* Update AtomBaseReferenceDrawer.cs

* Update AtomBaseReferenceDrawer.cs

* Instancer improvements (#172)

* Added Raise method and default base event for event instancers

* Added default value for Variable when base is null

* Added Event Instancer Raise editor

* Generator creates compilable code with type specific modifications (#169)

* Make Examples path check OS agnostic.

* Examples path check OS agnostic.

* Update Runtime.cs

* Re-generate and patch back in type specific changes

* Add missing UnityEngine using.

* Marked as not sealed

* Support the current value type as a conditional.

* Nested if blocks

* Use next char instead of next linefeed.

* Remove debug lines.

* Keep Atom Base Variable sepecfic code.

* Fix position of endif

* Add Raise for void type

* Add void and FSM specific logic

* Add is numeric conditional

* Add more type specific logic

* Add is Vector to generator.

* Add type specific logic

* Add collider type

* Add color specific logic

* Working on whitespace diffs

* Working on whitespace diffs

* remove unused test assembly

* removed example nested if

* test comment removed after regen

* missing ValueEquals

* missing ValueEquals on colliders

* missing color speciifc code.

* whitesapce cleanup

* whitesapce cleanup

* whitesapce cleanup

* whitesapce cleanup

* whitesapce cleanup

* whitesapce cleanup

* remove temp debug

* Generated events now follows editoconfig. + Inline conditionals now supports white spaces.

Co-authored-by: jrmacgill <jmacgill@gmail.com>
Co-authored-by: Adam Ramberg <adam@mambojambostudios.com>

* Fix Sub FSM Value Set issue (#178)

* Default Value For Changed and ChangedWithHistory (#179)

* Changed now is created even if null

* Added changedwithhistory

* Removed initial implementation

* #179 - Fixes to AtomDrawer + FSM editor

* Added StartCleared to ValueList (#180)

* Added StartCleared to ValueLists

closes #175

* Update BaseAtomValueList.cs

* Made StartCleared Protected

* #180 - Minor style fix

* Bump lodash from 4.17.15 to 4.17.19 in /website (#181)

Bumps [lodash](https://github.com/lodash/lodash) from 4.17.15 to 4.17.19.
- [Release notes](https://github.com/lodash/lodash/releases)
- [Commits](lodash/lodash@4.17.15...4.17.19)

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

* Creating new atom in current directory improvement (#184)

* small improvement for creating new atoms in inspector window

* fixed getting directory path instead of full file path

* 🧞‍♀️ v4.3.0

* #189 Restructure tutorials and add two new tutorials (#190)

* Restructure tutorials and add two new tutorials

- Non-generated documentation review and edit
  - Consistent terminology
  - Stylistic changes
  - Minor structure changes
  - Minor clarifications
  - Typo fixes

- Split basic tutorial into two
- Tutorials are easier to follow when they are short and to the point
- Added event and variable instancer tutorials
- Had to bump node version for the docker container to work

* #189 - Fixing minor nitpicks

Co-authored-by: Adam Ramberg <adam@mambojambostudios.com>

* Bump prismjs from 1.17.1 to 1.21.0 in /website (#188)

Bumps [prismjs](https://github.com/PrismJS/prism) from 1.17.1 to 1.21.0.
- [Release notes](https://github.com/PrismJS/prism/releases)
- [Changelog](https://github.com/PrismJS/prism/blob/master/CHANGELOG.md)
- [Commits](PrismJS/prism@v1.17.1...v1.21.0)

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

* #154 adds a searchable menu for faster atom creation.  (#186)

* #154 adds a searchable menu for faster atom creation. default hotkey is ALT+1

* better name representation

* added missing meta file

* #154 - Minor nitpick fixes

Co-authored-by: Adam Ramberg <adam@mambojambostudios.com>

* Added miikalo as a maintainer

* Add workaround for "Enter Play Mode" feature to enable initial values (#182)

* Add workaround for Unity's "Enter Play Mode" feature to enable initial values

* exclude UnityEditor from build

* use HashSet to store AtomVariable instances

* fixing #200 (UnregisterAll for AtomEventBase)
UnregisterAll did not unregister for listeners of OnEventNoValue.

* more clarity to installation process (#193)

mention in the readme where manifest.json is located in the unity project

* asset based atoms generation (#187)

* Added Scriptable objects to define which types to be (re)generated

* added folder inspector to allow UnityAtoms specific actions and shortcuts to improve usability

* added command to regenerate all atom files

* storing AssemblyQualifiedName for generation
also showing value types that are not specifically marked as serializable

* fixed code style and cleanup
 - removed unused imports
 - removed commented-out code

* Fixing #196 (EventReferenceListener null reference) (#199)

The EventReference isn't initialized as null anymore, but require a default constructor as generic constraint.

* #52 Basic implementation of conditions for listeners (#191)

* Basic implementation of conditions for listeners

* Tweak code style and add generated Conditions

* Added for AtomReference a check to see if an Atom is actually assigned. (#202)

* Unity Atoms Input System Integration (#212)

* Unity Atoms Input System Integration

This is just a quick demo to suggest to the Unity Atoms team. There 'was' a line on the github that said to contact you... but creating a Pull Request is the more funner way of doing things.

Here we have a YouTube link that explains what these scripts are for. The scene is a bit bare bones since testbed and all that.
https://www.youtube.com/watch?v=q7W8FyTIriQ&feature=youtu.be

* Input System Interpreters and Workflow cemented

No in-game demo this time D:< but I did make a video to explain the workflow, because it beats writing you a 3 page pdf:
https://www.youtube.com/watch?v=g7mCpOZpJ4I

Like I say in the video, 2 things I still want to do before final:
1. Create ALL the Interpreters! (Mostly things like support for EyeControls.)
2. Write a few lines of documentation.

2 Interpreters I still need to create are for Double and Quaternion, which will then need accompanying Variables and Events. I was wondering if I should push these separately to the base atoms package.

* Add Double and Quaternion Variables to BaseAtoms

I also put some comments in RegenerateAllAtoms for some clear separation.

* Add InputSystem 1.0.1 as a dependency

Updates the README as well.

* Generator support for nested types

If a type is nested, e.g. class Foo.Bar, the Generator will now correctly resolve to:
public abstract class Foo_BarAction : AtomAction<Foo.Bar>

Dots are replaced with underscores. This way it is certain the resolved type won't conflict with any Microsoft Standard types (their naming conventions forbid it). It is recommended the type name is still changed by the programmer afterwards.
^ in fact, I wanted to make an extra field for this in the generator editor to help with this, but I have not much experience with uielements and the codebase relied heavily on _valueType making it an uphill battle for a later date perhaps.

Note that I had to change GeneratorEditor and RegenerateAllAtoms as well, since these were erasing the changes from the Generator.CreateTemplateVariablesMap method (good one guys, ya got me). You might think I missed capitalizing the templateVariables["VALUE_TYPE_NAME"], but this already happens in that Maps method.

* Remove version defines on assemblies

This is no longer needed now that the InputSystem is a dependency of this package.

* Add the PlayerInput and CallbackContext to RegenerateAllAtoms

With it, all the atoms generated from PlayerInput and CallbackContext have been regenerated as well, so this push may appear bigger than it really is. Only RegenerateAllAtoms.cs has changed significantly.

* Add Double- and QuaternionInterpreter + icons

The icon just felt missing. If you had a different color in mind just send me a file.

* First commit

* Squashed commit of the following:

commit 847eff0
Author: Adam Ramberg <andersson.adam.89@gmail.com>
Date:   Sun Mar 17 22:09:38 2019 +0100

    #17 - Serializable not needed for ScriptableObject

commit 593b275
Author: Adam Ramberg <andersson.adam.89@gmail.com>
Date:   Sun Mar 17 21:59:33 2019 +0100

    18 - IGameEvent<T1, T2> RegisterListener

commit 40443ce9bd4b1c339aaf19cfcb119f2336608dae
Author: Adam Ramberg <andersson.adam.89@gmail.com>
Date:   Fri Mar 8 16:35:04 2019 +0100

    Remove some more warnings

commit bd45311
Author: Adam Ramberg <andersson.adam.89@gmail.com>
Date:   Fri Mar 8 16:33:30 2019 +0100

    Update README

commit 90977b8
Author: Adam Ramberg <andersson.adam.89@gmail.com>
Date:   Fri Mar 8 16:31:45 2019 +0100

    Initialize to null to get rid off warnings

commit 38b7f5c
Author: Adam Ramberg <andersson.adam.89@gmail.com>
Date:   Fri Mar 8 16:15:53 2019 +0100

    More fixes to enable local unity project

commit 404e1cb
Author: Adam Ramberg <andersson.adam.89@gmail.com>
Date:   Fri Mar 8 16:12:37 2019 +0100

    Remove duplicated asmdef

commit 5734300
Author: Adam Ramberg <andersson.adam.89@gmail.com>
Date:   Fri Mar 8 16:09:46 2019 +0100

    Change files to include

commit d1e42b1
Author: Adam Ramberg <andersson.adam.89@gmail.com>
Date:   Fri Mar 8 16:05:56 2019 +0100

    Added root package json

commit 1709a03
Author: Adam Ramberg <andersson.adam.89@gmail.com>
Date:   Fri Mar 8 15:30:44 2019 +0100

    #16 - Add test and examples Unity project

commit a3ea1a1
Author: Adam Ramberg <andersson.adam.89@gmail.com>
Date:   Fri Mar 8 13:12:02 2019 +0100

    #13 - Make usage of UPM (package manager)

commit 492a30e
Author: Adam Ramberg <andersson.adam.89@gmail.com>
Date:   Fri Mar 8 11:28:56 2019 +0100

    Added extensions + code formatting fixes

commit 709949a
Author: Oliver Biwer <soraphis@users.noreply.github.com>
Date:   Fri Mar 8 10:16:45 2019 +0100

    More AtomicTags changes (#15)

    * - added assembly defintions, and unit tests
    - improved AtomicTags in regards of #8, #9 and #10

    * Fixes #11
    - Added Equality Members (inclusive HashCode) for ScriptableObjectVariableBase

    * removed Rider Plugins from git

    * Further AtomicTag optimization

commit ae6584c
Author: Adam Ramberg <andersson.adam.89@gmail.com>
Date:   Fri Mar 8 10:08:36 2019 +0100

    Editor config

commit 197d706
Author: Adam Ramberg <andersson.adam.89@gmail.com>
Date:   Fri Mar 8 09:23:12 2019 +0100

    Added editor config file

commit 53d6adc
Author: Oliver Biwer <soraphis@users.noreply.github.com>
Date:   Tue Mar 5 22:57:47 2019 +0100

    More efficient AtomicTags (#12)

    * - added assembly defintions, and unit tests
    - improved AtomicTags in regards of #8, #9 and #10

    * Fixes #11
    - Added Equality Members (inclusive HashCode) for ScriptableObjectVariableBase

    * removed Rider Plugins from git

commit 81209d8
Author: Adam Ramberg <andersson.adam.89@gmail.com>
Date:   Wed Dec 12 20:54:17 2018 +0100

    Added MonoHooks + ColliderType + bug fixes

commit c6b240c
Author: Adam Ramberg <andersson.adam.89@gmail.com>
Date:   Sat Dec 1 00:23:10 2018 +0100

    Experimenting with adding UI state management

commit dfd70a8
Author: Adam Ramberg <andersson.adam.89@gmail.com>
Date:   Fri Nov 30 23:10:21 2018 +0100

    Issue #6 - AtomicTags

commit 8907763
Author: Adam Ramberg <andersson.adam.89@gmail.com>
Date:   Fri Nov 30 22:42:29 2018 +0100

    First commit of v1.0.0

* New repo structure

* Fix empty line issue for conditionals in generator

* Generator now handles namespaces

* Add sub unity atoms namespace to generator + generate new atoms for TouchUserInput

* Generate new SceneField atoms

* AtomicTags -> UnityAtomsTags

* New simpler / better icon system

* Regenerate core atoms with new icon system

* Update TouchUserInput icons

* Update SceneField with new icon system

* Update the last missing atoms with new icon system

* Add publish scripts to Github registry

* Add files meta in package.jsons

* Add missing meta + adjust package.json

* Fix warnings when importing package

* Use NPM instead of Github registry

* Add website for documentation

* Added eslint + prettier and updated .editorconfig

* Fix assembly references

* Rename Listener GameEvent -> Event

* ResetValue -> Reset

* UseIcon -> EditorIcon

* Bug fix

* Generate docs - document tags

* Correct namespace

* Remove unused interfaces

* Docs for mobile api

* Create documentation WIP

* Document Core WIP

* Use compiler flag UNITY_2019_1_OR_NEWER - docs gen

* Regenerate TouchUserInput Atoms

* Document Atom Listener

* Add docs to Atom List

* Docs WIP

* Update Unity Events template comments

* Remove interfaces not used

* Generate docs for Atom Variable

* Regenerate docs for bool Atoms

* Regenerate docs for Color Atoms

* Regenerate docs for Collider Atoms

* Regenerate docs for Collider2D Atoms

* Regenerate docs for float Atoms

* Regenerate docs for GameObject Atoms

* Regenerate docs for int Atoms

* Regenerate docs for string Atoms

* Regenreate docs for Vector2 Atoms

* Regenerate docs for Vector3 Atoms

* Regenerate docs for Void Atoms

* Regenerate docs for SceneField Atoms

* Various docs fixes

* Generate more docs for scene mgmt

* Readd MonoHooks as a subpackage

* - Added a top menu bar option to regenerate all existing Atoms. Nifty when developing the library.
- Added the option to use a Constant in Atom References. Related to #58

* #54 - temp workaround for Unity serialization bug

* #41 - Create BaseAtomListener including dev desc

* UATags -> AtomTags

* Remove all FormerlySerializedAs attributes

* Add missing MonoHooks folder meta

* Set default values to remove MH warnings

* #65 - Fix indent and ui state issues of drawer

* Expose get property InitialValue for Variables

* #68 Temporarily dissalow multiobject editing

* #68 - render default drawer when multi editing

* V2.0.0 🎉

* Setter to AtomReference's Value was added in order to set the value depending on _usage

* Update AtomReference.cs

small change to be more future-proof.
 - when the Usage-Enum is extended this will not silently do nothing

* Changed AddComponentMenu names for Listeners/Hooks (#84)

* changed AddComponentMenu names for Listeners

* renamed AddComponentMenu Listeners names in other packages

* renamed AddComponentMenu for hooks

* renamed double Listeners to "x 2" convention

* #87 bug fixed

* Better user guidance for working with AtomVariables (#70)

* #69 added custom editor for Variable Types, to guide the usage flow and reduce errors.

* allows unlocking of initialvalue in playmode

* adjustments to Variable Inspector

* Generator now works with all kinds of setups. just select the Packages folder when calling RegenerateAll.
Used this to regenerate the CustomEditors

* supports now structs

* Added RaiseButtons in VariableEditor. #72
Adding simple logging helper on listeners, for fast debugging.

* Call `serializedObject.Update();` before `OnInspectorGUI` in the editor script in order to update old value when changing value.
Show children for PropertyFields for initial and old value.
Some minor refactoring - renaming variables
Clean up in `RegenereateAllAtoms`
Use `OnEnable` instead of `OnAfterDeserialize` when setting inital value for variable. `OnAfterDeserialize` was causing major issues with the custom editor, eg. it did run when focusing a Variable and showing the inspector, basically making it worthless to change or even inspect the Variable at runtime. `OnEnable` is only called ones when the ScriptableObject is loaded in runtime, which is what we really want. This has been tested running in the editor and in builds.
Add missing editors scripts `TouchUserInputVariableEditor`and `SceneFieldVariableEditor`

* Variable and Constant Drawers show a preview value (#89)

* Drawers of Variables and Constants show value field

* #89 Adjust preview width for Vector2 and Vector3

* Name OnTriggerHook class properly. (#91)

* Bux fix - name OnTriggerHook class properly.

* Add entry to CHANGELOG

* #84 parameterless atom listener (#86)

* added base class for AtomAction; modified VoidAction; added Register/UnregisterListener to non-generic AtomEvent; added parameterless AtomListener; small polishing

* removed EditorIcon from AtomAction; fixed misspelled word in AtomEvent

* v2.1.0 🚀

* Unity v2018.4 Support (#98)

* - Fixed MonoHooks asmdef reference to Core asmdef was broken.
- Fixed dependancy issue for Package Manager.
- Removed Generator function in version 2018.4.

* Updated to include 2018.4 define directive.

* Fix Remove Tag from AtomTags and Fix Remove Tag Test (#102)

* v2.1.1 🤖

* Update AtomVariable.cs

* Added pre change transformers to Variables + Clamp Int / Float (#93)

* Added pre change transformers to Variable + Clamp Value Function (first pre change transformer implementation)
- Added a list of pre change transformers to AtomVariable
- Added docs
- Added two AtomFunctions - ClampInt and ClampFloat
- Added custom editors for ClampInt and ClampFloat
- AtomFunction<T, T> is not part of the generator
- Regenerated all the Atoms

* - Created a base class for the editor for ClampFloat and ClampInt. Apparently it is not allowed to have multiple CustomEditor attributes defined for the same class. To implement this I also created an interface called `IIsValid` (for casting purposes in the editor).
- Initialize `PreChangeTransformers ` at declaration and removed initialization `OnEnable`
- Moved call to `RunPreChangeTransformers ` from `OnEnable` to `OnValidate`. Running it 2 times, once for initialValue and once for value since value can be changed at runtime via editor.
- Made the variable PreChangeTransformers private and created a property instead in order to make it impossible to overwrite the list with `null` from the outside.
- Moved `ClampInt` and `ClampFloat` in the `CreateAssetMenu` for `Unity Atoms/Functions/Transformers`

* IsUnityAtomsRepo should never be settable (#108)

* Fix indentation bug in variable drawer (#109)

* Reactivate Generator function in Unity 2018.4. (#106)

Co-authored-by: Adam Ramberg <adam@mambojambostudios.com>

* Fix variable equality issues (#111)

* Added Variable Instancer, Event Reference, Atom Collection and Atom List (old Atom List renamed to Atom Value List) (#110)

AtomVariableInstancer
- Added AtomVariableInstancer as an option to AtomReference.
- Added AtomVariableInstancer to generator.
- Added editor icon for AtomVariableInstancer.

AtomEventReference
- Added an AtomEventReference class (and AtomEventX2Reference). It’s similar to an AtomReference, but for Events. Let’s you pick between an Event, Variable (will select the Changed event) and a VariableInstancer (see above).
- Added AtomEventReference and AtomEventX2Reference to generator.
- Added a drawer for AtomEventReference.
- Listeners are now using AtomEventReference instead of AtomEvent.
- Refactoring of VoidHooks since Listeners are now using AtomEventReference.

AtomCollection
- Created an AtomCollection - a collection of Atoms associated with key strings (AtomReferences).
- Added new editor icon for collections.
- Created a SerializableDictionary class, which AtomCollection is using.
- Custom property drawer for SerializableDictionary.
- SerializableDictionary supports nested structures meaning that a AtomCollection can have a KVP that is pointing to another AtomCollection.
- AtomCollections have 3 events: Added, Removed, Cleared.
- Added an option to sync an InstanceVariable to collection - adding it to the collection when created (using gameObject’s instance id as key) and removing it from the collection when destroyed.

AtomList
- Renamed old AtomList to AtomValueList
- Added AtomList, like Collection, but a list
- Added new icon for AtomList
- Created a AtomBaseVariableList class, which AtomList is using.
- Custom property drawer for AtomBaseVariableList.
- AtomLists have 3 events: Added, Removed, Cleared.
- Added an option to sync an InstanceVariable to list - adding it to the list when created and removing it from the list when destroyed.

* Fix ValueEquals in AtomVariable template

* Add constructor with value to Reference classes (#113)

* Replay subject (#114)

* Add constructor with value to Reference classes

* Implemented ReplayBehaviour for AtomEvents

* Add util actions to Variables (#115)

* Add AddComponentMenu to Variable Instancers

* v3.0.0 🐉

* Fix typo

* WIP

* More WIP

* Update docs + remove ds store

* Fix intro scene

* Use Event Reference in MonoHooks

* Remove white spaces in Variable Instancers

* Add missing meta file for BaseAtoms

* Set default to avoid compiler warnings

* Example WIP

* WIP

* Re add accidently deleted stuff

* FSM pkg + Example WIP

* Align base event reference listener

* WIP FSM

* WIP

* WIP

* Clean up WIP

* More WIP

* WIP

* Fix transition data event reference

* Remove _base in FSM instancer

* WIP

* Fix atomstag bug

* Fix timing issues

* Tweak

* Demo scene wip

* Example WIP + Variable ID

* Finished example scene

* Move sync variable instancer to collection to its own MB

* Remove sync functionality in variable instancers

* Correctly generate comments

* Rearranging scenes

* Rename example scene

* Fix Variable with class type issues

* Docs added

* Move AtomListAttribute to core

* Rename functions correctly

* Added some more docs

* FSM docs

* FSM docs v1

* Add editor folder to FSM pkg

* 🦸‍♂️ v4.0.1

* Fixes to issues in v4.0.1

* 🦹‍♂️ v4.0.2

* Fix typos (#120)

* #122 Add Event Refs for Collections and Lists (#123)

* 💜 v4.1.0

* changed from Multiline to TextArea attribute (#128)

* Added inspector toggle for triggering Changed and ChangedWithHistory on OnEnable (#126)

* Booleans to decide if OnChanged Events are triggered on Variable's OnEnable were added

* Variable's editor was updated to show both booleans

* Docs updated with new variables

* Changelog update

* Change variable visibility to private and add explicit default value

Co-authored-by: Ignacio Ruiz <iruizm@hiberus.com>

* Changes in GetEvent implementation to allow inheritance (#140)

* Removed duplicate check before adding an item to AtomValueList (#145)

* Fix code generation bug (#147)

* Add GetParent / GetValue extenstions for SerializedProperty

* Fixing drawer for generated reference of complex struct type (#155)

* Adding proposals to fix #153

FIx custom reference doesn't appear properly

* Fix #153

Fix custom reference doesn't appear properly

* Fix #153

Fix custom reference doesn't appear properly

Co-authored-by: Bastien Guyl <bguyl@smart-tale.com>

* #131 - Added forceEvent parameter for SetValue function on AtomVariable (#157)

* #132 - Add GetEvent and SetEvent functions to AtomReference (#158)

* Fix bug where usage popup sometimes were hidden

* #160 - Hook up OnFixedUpdate handler

* Debug events by displaying stack traces for events (#159)

* Add stack trace toggled via user prefs

* Add docs regarding preferences

* Rename color getter functions

* Fix minior order of execution bug

* Use GUID + improved styling of detailed stack view

* - Changed the AddStackTrace method to be conditional (from one of your initial suggestions).
- Removed the implicit conversion operator in StackTraceEntry and is instead using ToString explicitly when needed.
- Improved implementation of GetFirstLine
- Simplified Equals implementation of the StackTraceEntry class

* Changelog + assembly fixes

* #164 - Does not work in Unity 2018.3

* 🐝 v4.2.0

* Hacks to get docs generator working

* - Fixed clear button handler for StackTraces
- Fixed and rearranged StackTraces compiler flags

* 🐞v4.2.1

* Make IsUnityAtomsRepo OS agnostic (#168)

* Make Examples path check OS agnostic.

Co-authored-by: jrmacgill <jmacgill@gmail.com>

* Update AtomBaseReferenceDrawer.cs (#174)

* Update AtomBaseReferenceDrawer.cs

* Update AtomBaseReferenceDrawer.cs

* Instancer improvements (#172)

* Added Raise method and default base event for event instancers

* Added default value for Variable when base is null

* Added Event Instancer Raise editor

* Generator creates compilable code with type specific modifications (#169)

* Make Examples path check OS agnostic.

* Examples path check OS agnostic.

* Update Runtime.cs

* Re-generate and patch back in type specific changes

* Add missing UnityEngine using.

* Marked as not sealed

* Support the current value type as a conditional.

* Nested if blocks

* Use next char instead of next linefeed.

* Remove debug lines.

* Keep Atom Base Variable sepecfic code.

* Fix position of endif

* Add Raise for void type

* Add void and FSM specific logic

* Add is numeric conditional

* Add more type specific logic

* Add is Vector to generator.

* Add type specific logic

* Add collider type

* Add color specific logic

* Working on whitespace diffs

* Working on whitespace diffs

* remove unused test assembly

* removed example nested if

* test comment removed after regen

* missing ValueEquals

* missing ValueEquals on colliders

* missing color speciifc code.

* whitesapce cleanup

* whitesapce cleanup

* whitesapce cleanup

* whitesapce cleanup

* whitesapce cleanup

* whitesapce cleanup

* remove temp debug

* Generated events now follows editoconfig. + Inline conditionals now supports white spaces.

Co-authored-by: jrmacgill <jmacgill@gmail.com>
Co-authored-by: Adam Ramberg <adam@mambojambostudios.com>

* Fix Sub FSM Value Set issue (#178)

* Default Value For Changed and ChangedWithHistory (#179)

* Changed now is created even if null

* Added changedwithhistory

* Removed initial implementation

* #179 - Fixes to AtomDrawer + FSM editor

* Added StartCleared to ValueList (#180)

* Added StartCleared to ValueLists

closes #175

* Update BaseAtomValueList.cs

* Made StartCleared Protected

* #180 - Minor style fix

* Creating new atom in current directory improvement (#184)

* small improvement for creating new atoms in inspector window

* fixed getting directory path instead of full file path

* 🧞‍♀️ v4.3.0

* Unity Atoms Input System Integration

This is just a quick demo to suggest to the Unity Atoms team. There 'was' a line on the github that said to contact you... but creating a Pull Request is the more funner way of doing things.

Here we have a YouTube link that explains what these scripts are for. The scene is a bit bare bones since testbed and all that.
https://www.youtube.com/watch?v=q7W8FyTIriQ&feature=youtu.be

* Input System Interpreters and Workflow cemented

No in-game demo this time D:< but I did make a video to explain the workflow, because it beats writing you a 3 page pdf:
https://www.youtube.com/watch?v=g7mCpOZpJ4I

Like I say in the video, 2 things I still want to do before final:
1. Create ALL the Interpreters! (Mostly things like support for EyeControls.)
2. Write a few lines of documentation.

2 Interpreters I still need to create are for Double and Quaternion, which will then need accompanying Variables and Events. I was wondering if I should push these separately to the base atoms package.

* Add Double and Quaternion Variables to BaseAtoms

I also put some comments in RegenerateAllAtoms for some clear separation.

* Add InputSystem 1.0.1 as a dependency

Updates the README as well.

* Generator support for nested types

If a type is nested, e.g. class Foo.Bar, the Generator will now correctly resolve to:
public abstract class Foo_BarAction : AtomAction<Foo.Bar>

Dots are replaced with underscores. This way it is certain the resolved type won't conflict with any Microsoft Standard types (their naming conventions forbid it). It is recommended the type name is still changed by the programmer afterwards.
^ in fact, I wanted to make an extra field for this in the generator editor to help with this, but I have not much experience with uielements and the codebase relied heavily on _valueType making it an uphill battle for a later date perhaps.

Note that I had to change GeneratorEditor and RegenerateAllAtoms as well, since these were erasing the changes from the Generator.CreateTemplateVariablesMap method (good one guys, ya got me). You might think I missed capitalizing the templateVariables["VALUE_TYPE_NAME"], but this already happens in that Maps method.

* Remove version defines on assemblies

This is no longer needed now that the InputSystem is a dependency of this package.

* Add the PlayerInput and CallbackContext to RegenerateAllAtoms

With it, all the atoms generated from PlayerInput and CallbackContext have been regenerated as well, so this push may appear bigger than it really is. Only RegenerateAllAtoms.cs has changed significantly.

* Add Double- and QuaternionInterpreter + icons

The icon just felt missing. If you had a different color in mind just send me a file.

* Revert bad stuff

oeps

* - Add docs
- Fixed bug in Stack Trace Entry that was found during testing
- Regenerated all atoms -> added missing editor files
- Reverted changes in Generator since it caused issues.

* Regenerate editor scripts again after adding generator fix

* Added auto generated docs for input system

* Dont use guids as references in asmdef

* More fixes to get input system docs to show on website

* Add input system to table of contents

Co-authored-by: Adam Ramberg <andersson.adam.89@gmail.com>
Co-authored-by: AdamRamberg <adam@mambojambostudios.com>
Co-authored-by: Ignacio Ruiz <ignacio.ruiz.292@gmail.com>
Co-authored-by: Oliver Biwer <soraphis@users.noreply.github.com>
Co-authored-by: IceTrooper <51023959+IceTrooper@users.noreply.github.com>
Co-authored-by: Ice_trooper <trooperice@gmail.com>
Co-authored-by: Low Jiahao <fakegood@users.noreply.github.com>
Co-authored-by: Lucas Ribeiro <ribeiroferreiralucas@gmail.com>
Co-authored-by: Enderlook <enderlook@gmail.com>
Co-authored-by: Ignacio Ruiz <11753209+iruizmar@users.noreply.github.com>
Co-authored-by: Ignacio Ruiz <iruizm@hiberus.com>
Co-authored-by: Moh Narimani <sorencoder@gmail.com>
Co-authored-by: Bastien Guyl <bastien@guyl.me>
Co-authored-by: Bastien Guyl <bguyl@smart-tale.com>
Co-authored-by: jmacgill <jmacgill@google.com>
Co-authored-by: jrmacgill <jmacgill@gmail.com>
Co-authored-by: Gustavo Guimaraes <gustavo.ceci95@gmail.com>
Co-authored-by: Michael Liu <Michael.Liu0@Gmail.com>

* Add FAQ with comparison to another framework (#207)

* Add tutorial for Conditions (#206)

* Move atom search menu item (#217)

* Add AtomsSearchable attribute to indentify searchable atoms and apply to BaseAtom (#216)

* Clear keys and values when clearing seriazlied dict (#218)

* Fixing FSM instancer where _base always is null (#219)

* Trigger initial events for instancers (#220)

* - Trigger initial events for instancers
- Clean up event name for events instantiated at runtime
- Added properties to check if an event is set or not on a variable. This is useful in order to not accidentally create an event at runtime when just checking if it is null or not.
- Added logic to clean up events instantiated at runtime.

* Added an explicit GetOrCreateEvent method

* Add OnCollisionHook and OnCollision2DHook (#221)

* Add OnCollisionHook and OnCollision2DHook

* refactor hooks

Naming shouldn't be trigger, get outa heeeeere!

* Implement ValueEquals + simplify already implemented ValueEquals

* Fix generator for Collisions + Add missing generated conditions + support OR:ed conditions in templates

Co-authored-by: Adam Ramberg <adam@mambojambostudios.com>

* 🎅 v4.4.0

* Fix publish:all script

* #224 - Move Atoms Search back to its own sub menu. Having same sub path for both MenuItem and CreateAssetMenu is causing the menu to be removed.

* 🍾 v4.4.1

* Fix ValueEquals for EquatableAtomVariable and EquatableAtomReference

* 🍺 v4.4.2

* Update README.md (#228)

Added myself under Maintainers.

* Fix the Discord link in the FAQ (#227)

Noticed that the Discord invite link in the FAQ was broken, so updating it to match the one in the footer.

* Changes due to move to new organization

* Remove example project (moved to seperate repo)

* Bump highlight.js from 9.15.10 to 9.18.5 in /website (#244)

Bumps [highlight.js](https://github.com/highlightjs/highlight.js) from 9.15.10 to 9.18.5.
- [Release notes](https://github.com/highlightjs/highlight.js/releases)
- [Changelog](https://github.com/highlightjs/highlight.js/blob/9.18.5/CHANGES.md)
- [Commits](highlightjs/highlight.js@9.15.10...9.18.5)

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

* Revert "Bump highlight.js from 9.15.10 to 9.18.5 in /website (#244)" (#245)

This reverts commit 280a545.
Reason: it should have been merged into canary instead of master.

* fixing #240 - Value of a VariableInstancer in EditMode leads to NullRef (#241)

* fixing #240 - EditMode NullRef

* Remove Redunancy

Co-authored-by: Casey Hofland <hofland.casey@gmail.com>

* Lazy stacktrace toString conversion (#238)

when disabling atoms debug mode, StackTraceEntries are allocated, but their strings are never used.

* Create button ease of use (#229)

* Add auto focus on textfield
* Prevent PrefixLabel showing up in AtomReferences
* Add Keyboard shortcuts to confirm/deny create
* Add Focused Control Check

* compatibility with dynamic assemblies and different namespace/class conditions (#230)

* compatibility with dynamic assemblies

* fixing #232

fixed a case where the class namespace might be null

* fixing #232 + corrections, fixing #233

* Fix nested types not being generated correctly

VALUE_TYPE_NAME_NO_PAIR had an incorrect value if the type was nested.

* Reimagine the Generators Type Selector Layout

UNTESTED! I will test if the generator later this week (18/01).
UNCOMMENTED! Same as above.

The new selector will neatly separate namespaces from types, is ordered alphabetically and goes down a new level for every subnamespace. It will now also display nested types as such (so nested type Bar is displayed as Foo+Bar). This means that types of the same name but in different namespaces are now supported.

It will also ignore any abstract or generic types as Atoms can only generate solid types (...I think?)

If you want to check it out, I recommend looking at how NamespaceLevel works. It splits types up into types that have reached their namespace level and types that can still go deeper, in which case they are rooted as part of the NamespaceLevel. From there, it can handle adding dropdown items and finding a selected Type.

* Enable all GenerationOptions by default

Or on a Reset of the SO

* Ensure instantiated generator has unique assetpath

This can otherwise lead to weird behaviour if a new asset is created at the path of an existing asset

* Use variables for SerializedProperties

* Make objectfields to generated scripts readonly

These should not be edited which may lead to errors.

* Add comments

* Use hash to find which type belongs to which DropdownItem

* Use level to distinquish between namespace levels

Using TrimStart was also trimming off characters after dots (.) if appropriate.

* Safety measure

Ensure serializedObject.Update is called in the beginning of OnInspectorGUI.

* Fix size of Dropdown

It will now neatly cover all the generator options. This doesn't really matter at all, I just think it looks neat, plus it ensures there is always enough view to not have trouble selecting a type.

* Use CompilationPipeline to get assemblies

Pros: It only collects Unity Assemblies that are not Editor Only. This ensures that every type will 100% be compatible in builds.
Cons: It doesn't find any assemblies outside of Unity, for example the System assembly.

Personally I like this way better since it ensures support even for cross platform development. Imagine someone generating a type you can only find in Windows, then trying to build for Mac. We can still populate the base package with the base values from systems and people will still be able to create Atoms for unsupported values, just not using the generator.

Alternatively we could create an "unsafe" toggle.

* Use CompilationPipeline to get assemblies

Pros: It only collects Unity Assemblies that are not Editor Only. This ensures that every type will 100% be compatible in builds.
Cons: It doesn't find any assemblies outside of Unity, for example the System assembly.

Personally I like this way better since it ensures support even for cross platform development. Imagine someone generating a type you can only find in Windows, then trying to build for Mac. We can still populate the base package with the base values from systems and people will still be able to create Atoms for unsupported values, just not using the generator.

Alternatively we could create an "unsafe" toggle.

* Add Safe Search toggle to AtomGenerator

Previously, the AtomGenerator was only able to generate types that were Unity compatible and either Serializable or ScriptableObjects.

The first change is that it now also searches for Objects to account for prefabs.
The second change is a toggle next to the generator to differentiate between searching for Unity compatible types and searching for all types (denoted as "unsafe types"). This does what it promises: it gets all the (dynamic) assemblies it can find, retrieves all exported types, and makes no distinction between serializable or nonserializable. This returns the functionality to generate for example strings and ints with the generator.

* Add Quality of Life improvements to the Editor

Co-authored-by: Casey Hofland <hofland.casey@gmail.com>

* Update website URL in docs (#257)

* 🧑‍🔬 v4.4.3

* website fixes

* Remove ALL the compile errors

A lot stemmed from broken inheritence from generic classes that now only require 1 type instead of 6

* Add unnecessary .meta files to gitignore

Co-authored-by: AdamRamberg <adam@mambojambostudios.com>
Co-authored-by: jmacgill <jmacgill@google.com>
Co-authored-by: jrmacgill <jmacgill@gmail.com>
Co-authored-by: Oliver Biwer <soraphis@users.noreply.github.com>
Co-authored-by: Gustavo Guimaraes <gustavo.ceci95@gmail.com>
Co-authored-by: Michael Liu <Michael.Liu0@Gmail.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: IceTrooper <51023959+IceTrooper@users.noreply.github.com>
Co-authored-by: Miika Lönnqvist <miika.lonnqvist@gmail.com>
Co-authored-by: Mehmet Hazar Artuner <hazar.artuner@gmail.com>
Co-authored-by: Oliver Biwer <soraphis@gmail.com>
Co-authored-by: Adam Ramberg <andersson.adam.89@gmail.com>
Co-authored-by: Ignacio Ruiz <ignacio.ruiz.292@gmail.com>
Co-authored-by: Ice_trooper <trooperice@gmail.com>
Co-authored-by: Low Jiahao <fakegood@users.noreply.github.com>
Co-authored-by: Lucas Ribeiro <ribeiroferreiralucas@gmail.com>
Co-authored-by: Enderlook <enderlook@gmail.com>
Co-authored-by: Ignacio Ruiz <11753209+iruizmar@users.noreply.github.com>
Co-authored-by: Ignacio Ruiz <iruizm@hiberus.com>
Co-authored-by: Moh Narimani <sorencoder@gmail.com>
Co-authored-by: Bastien Guyl <bastien@guyl.me>
Co-authored-by: Bastien Guyl <bguyl@smart-tale.com>
Co-authored-by: Matthew Tole <matthewtole@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants