Comments (15)
Ok, thank you for all the convincing arguments, I can see your point now.
It would just be nice to include it in a way that won't break all current projects (force everyone to add the namespace to every file that uses it to get their projects working again).
I think I might look into a LeanTween Preferences editor script that would toggle on the namespace attribute... this way I could leave it up to the user.
from leantween.
PS: check out InAudio 2 to see what I mean. Create a blank Unity project, import all of InAudio 2 and then import all of LeanTween.
If you wrap the LeanTween classes in a namespace, all those errors disappear.
from leantween.
Full disclosure: I'm currently not using LeanTween due to expanded client/project animation requirements.
I suggested the use of a namespace mainly because I was using a separate tweening library that also had a "TweenAction" entity and it was frustrating to have to qualify which entity I was referring to every time it was used in code. I also suggested the use of a namespace to improve the professionalism of LeanTween: if I come across a library that does not conform to the basic best practices of its language then that raises a red flag, no matter the quality of the code.
I would like to avoid it just as a convenience thing, for every time you want to use LeanTween you would have to declare the namespace at the top of your file, which can be annoying.
That's a personal preference, but given that even the smallest of projects which uses LeanTween will almost certainly include other third party libraries, or even other Unity / Mono namespaces, it is surely not much of a burden to add another line at the top. Personally, I much rather having control over what is imported in each of my script files.
In the end it is your project and your choise - hence my [Suggestion] prefix. LeanTween is a very impressive library either way and thank you for all your work.
from leantween.
Sounds like a great solution.
By the way, I'd also like to underline idlepixel's closing comment - I wish I'd had his grace to say this earlier. LeanTween is a truly wonderful thing and I have used it to replace iTween in my projects. Thank you so much for sharing it.
from leantween.
I think I might look into a LeanTween Preferences editor script that would toggle on the namespace attribute... this way I could leave it up to the user.
A final suggestion: You could add a namespace when you release version 3.00 of the library, along with any other breaking changes you need to make.
from leantween.
^^^ What idlepixel said ^^^
Using a namespace will make LeanTween play nicer with other assets, esp. InAudio
from leantween.
I am not sure how this would help? Is this because other frameworks are using the class LeanTween or LTDescr? I somehow doubt those are very common... besides avoiding class name collision, is there some other benefit I am unaware of? I would like to avoid it just as a convenience thing, for every time you want to use LeanTween you would have to declare the namespace at the top of your file, which can be annoying.
from leantween.
It helps because InAudio bundles LeanTween. They have put their version inside a namespace ("InAudioLeanTween") but, unless I wrap "real" LeanTween inside a different namespace, I get a whole load of errors, presumably due to the versions being different.
As soon as I wrapped a namespace around LeanTween and then adding using to my code (using RealLeanTween, say), the incompatibility probs went away.
In other words, adding a namespace to LeanTween would allow third parties to bundle LeanTween (or parts of LeanTween) without affecting other code. The bundled LeanTween would just need to make sure it uses a unique namespace.
from leantween.
Hello,
I have added an editor script that you can turn on/off namespaces. If you guys could give it a spin that would be helpful. To activate find the LeanTween preferences window at Edit->LeanTween Preferences. Thanks!
from leantween.
Hey - apologies for the delay.
It certainly did but was a little tricky to implement.
I basically had to first remove all the LeanTween source files from the plugin folder, then comment out every LeanTween reference in my code so that the preferences item would appear. (Otherwise, I had compiler errors due to the clash with InAudio, and the preferences menu item is not built as long as there are compiler errors.) After that, I had to copy the files back to plugins and go back and uncomment all references through my codebase back in again.
But after this it seems to be happy 👍 Thank you!
from leantween.
Ooof, yeah that doesn't work very well if you already have compile errors to begin with :-/. Maybe InAudio wants to add it to their own namespace, which would help.
from leantween.
No, the compile errors are caused by the lack of a namespace in LeanTween. The LeanTween copy has a namespace in InAudio, but because the LeanTween version doesn't it causes errors as the InAudio code picks it up first - the using in their files is ignored.
from leantween.
But, hey, it does work
from leantween.
Honestly, don't worry about it. It seems in the whole history of LeanTween only 2 people have ever pointed out the suggestion, so it's not affecting very many people and, if it does, they can find this text and will work out what to do.
I'm really pleased with how it works now - and I will be able to upgrade to any future LeanTween without breaking code.
Thanks again - and have a wonderful 2017 🥇
from leantween.
Ahhh ok yeah that does make sense. Thanks! Hope your 2017 is going well too 🎉
from leantween.
Related Issues (20)
- isPaused copy-paste error
- Package Manager shipping ? HOT 1
- Please continue this magnificent package. Don't let it die... HOT 3
- "EndlessPiece" has missing script HOT 6
- LeanTween.move inconsistent HOT 3
- LeanTween.delayedCall does not clear when tween finishes
- Editor List renderer problem with Unity 2021.1 or higher.
- Unexpected pause & resume behavior HOT 2
- Documentation website isn't opening HOT 1
- SetFrom with SetDelay
- Does not contain sequence HOT 1
- Type or namespace 'LTSeq' could not be found HOT 3
- Weird bugs from .setIgnoreTimeScale(false) HOT 2
- Errors - Downloaded from Asset store getting Assets\LeanTween\Framework\LeanTweenExt.cs(31,166): error CS1503: Argument 3: cannot convert from 'System.Action' to 'Action' HOT 2
- Documentation Website not available HOT 3
- LeanTween.delayedCall() is bugged/unreliable, will occasionally not perform call HOT 3
- Rotation and Value Tween stopping even when no cancel called HOT 1
- LeanTween.scale seems to run perfectly first run, after it stop to run HOT 2
- Image alpha bug.
- Actions execute after canceling LeanTween sequence
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from leantween.