Du kannst nicht mehr als 25 Themen auswählen Themen müssen entweder mit einem Buchstaben oder einer Ziffer beginnen. Sie können Bindestriche („-“) enthalten und bis zu 35 Zeichen lang sein.
Dieses Repo ist archiviert. Du kannst Dateien sehen und es klonen, kannst aber nicht pushen oder Issues/Pull-Requests öffnen.
Ivan "KaiSD" Korystin 94645ea459 typo vor 10 Jahren
Assets/scripts/coa4u Reconfigured the solution. vor 10 Jahren
.gitignore Added the solution file. vor 10 Jahren
Assembly-CSharp-vs.csproj Reconfigured the solution. vor 10 Jahren
Assembly-CSharp.csproj Reconfigured the solution. vor 10 Jahren
README.md typo vor 10 Jahren
coa4u-csharp.sln Reconfigured the solution. vor 10 Jahren
coa4u.sln Reconfigured the solution. vor 10 Jahren

README.md

coa4u

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

  1. Place the coa4u folder from Assets/scripts in your Assets/scripts folder.
  2. Then attach the Actor.cs script to the object you want.
  3. 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.

Included actions (ready and WIP)

All actions are capable to work both in 3D (use Vector3) and 2D (use Vector2) scenes.

Base actions

  • Sequence
  • Parallel
  • Repeat and Loop implemented in one action

Every reversable action has a reverse() method. So, no plans for Reverse action right now.

Interval actions

  • Delay and RandomDelay implemented in one action
  • MoveTo
  • MoveBy
  • RotateTo
  • RotateBy
  • ScaleTo
  • ScaleBy
  • BezierAbs
  • BezierRel
  • JumpTo uses Bezier action to move the object
  • JumpBy uses Bezier action to move the object
  • Blink

if you want to manipulate alpha with the following actions, your material should support transparency (i.e. use Transparent shader)

  • TintBy
  • TintTo
  • FadeOut
  • FadeIn
  • FadeTo
  • FadeBy

Instant actions

  • Place renamed to SetPlace
  • CallFunc renamed to SendMessage
  • Hide
  • Show
  • ToggleVisibility

There's no plans for 3DGrid actions. You can use the 3D actions instead.

Some additional actions

Base actions

  • Random - randomly choises and does one action from the given list.

Interval actions

  • Follow - follows another actor with the given speed for the given amount of time (of forever).
  • LookAt - rotates the object to look at the given actor.
  • SkewBy - skews the mesh by given values.
  • SkewTo - skews the mesh to the given values.

Instant actions

  • 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.

Future plans

After completing these actions, i'm going to add some more to the list.

License

Just like Cocos2D, this code licensed under the MIT License

Help and donations

I'm not doing it to make profit, but if you want, you can send me a couple of bucks via PayPal.

Also, if you'll write some action based on mine, feel free to send it to me, if you want me to add it to the library. I'll put your name on this page.