Cocos2d-like Actions for Unity3d
Unity3d is a very good game engine. It's almost perfect for quick prototyping. After switching from Cocos2D to Unity3d, i'm still missing just one cocos's feature - actions. It's a great combination of simplicity and flexibility, and i haven't found the suitable replacement for it. Since actions are quite simple, i implemented them myself.
How to use
- Place the coa4u folder from Assets/scripts in your Assets/scripts folder.
- Then attach the Actor.cs script to the object you want.
- See the ActorSampleActions.cs class, if you need examples.
You can also add actions on the fly, by using the AttachAction method of the Actor class.
All actions are capable to work both in 3D (use Vector3) and 2D (use Vector2) scenes.
- Repeat and Loop implemented in one action
Every reversable action has a reverse() method. So, no plans for Reverse action right now.
- Delay and RandomDelay implemented in one action
- JumpTo uses Bezier action to move the object
- JumpBy uses Bezier action to move the object
if you want to manipulate alpha with the following actions, your material should support transparency (i.e. use Transparent shader)
- Place renamed to SetPlace
- CallFunc renamed to SendMessage
There are no plans for 3DGrid actions. You can use the 3D actions instead.
Some additional actions
- Random - randomly choises and does one action from the given list.
- SetRotation - instantly rotates the object to the given euler angles.
- SetTint - instantly tints the object to the given color.
- SetDirection - instantly rotates the object to look at the given actor.
- Stop - stops all actions for this object.
No future plans.
There were some ideas (you can find in coa4uext), but no plans to develop them further.
Just like Cocos2D, this code licensed under the MIT License