Unity5 Implementations (aka How to do shit)
In Unity5 there are often many different ways to accomplish your goals. Additionally there are many different things you can do but it isn’t always obvious that they are possible or how to do them. This page shows you implementations of things that can be done in Unity3D v5 which is why I subtitled this article: How to do shit.
Inversion Of Control
If you want to do Inversion of Control or Dependency Injection in Unity this is how
https://strangeioc.github.io/strangeioc/
and use UNIRx for less tightly coupled code
https://ornithoptergames.com/reactiverx-in-unity3d-part-1/
or
https://github.com/neuecc/UniRx/blob/master/README.md
How to make things move smoothly
I was looking into available “tweening systems” this evening and found more than I bargained for:
Tweening Systems:
- iTween is the most popular but everyone complains about it having garbage collection problems.
- DoTween and LeanTween are the runners up in the popularity contest but they don’t have any GC issues and are probably better choices overall
- DoTween is documented better and some say is laid out better and is perhaps a more “complete”package but it requires that you get comfortable with lambda expressions
- LeanTween has less documentation and examples but many people say it is straightforward, and incredibly fast
- They are both free and open source
Alternatives:
Theres this package called “Movement Over Time” which apparently does things different than a tweening system and is “more like a whole new way of thinking of and doing movement in your game” (from one of the reviews on the asset store). the same reviewer also said “I am amazed by all the new things I can do in only a couple of lines of code in this framework that seemed impossible before.”
Then I learned about Animation Curves which are built in and can apparently be used in the context of lerping to make that process entirely easy: transform.position = Vector3.Lerp(fromPosition, toPosition, animationCurve.Evaluate(t));
In the process I learned more about events and delegates which is really powerful shit
How to set pseudo breakpoints
How to make a map from an excel spreadsheet
http://saor-gaming.co.uk/tile-based-map-generation-sabrecsg/
How to make Editor Scripts
Heres an article about a number of things including Creating Editor Scripts.
http://saor-gaming.co.uk/tile-based-map-generation-sabrecsg/
Terrains
This shows how to draw a pattern and make a terrain out of it!
This shows how to make a terrain in Unity that resembles a part of the planet ear
Simplest setting of HUD text
Making the Graphics better in Unity (more like Unreal)
Making a High Score Screen
Making Warp Points
Simplest Texture application in Unity3D
Lists of other implementations
Here is a large list of GIFs of Unity tips and tricks