Nelze vybrat více než 25 témat Téma musí začínat písmenem nebo číslem, může obsahovat pomlčky („-“) a může být dlouhé až 35 znaků.
Tento repozitář je archivovaný. Můžete prohlížet soubory, klonovat, ale nemůžete nahrávat a vytvářet nové úkoly a požadavky na natažení.
Ivan "KaiSD" Korystin 1d69dfd8f3 Optimization: caching unity components před 10 roky
src Optimization: caching unity components před 10 roky
README.md Optimization: caching unity components před 10 roky

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

Just put the src folder into your assets folder. Then attach the Actor.cs script to the object you want. See the examples folder, there's a sample script there.

You can also subclass the Actor and add all the actions you want to the Start() method.

Included actions (ready and WIP)

All actions are designed to word in 3D scene (i.e. using Vector3 for movement, rotation and scaling). You can use it in 2D with apropriate vectors, but i'm going to add support for 2D actions soon.

Base actions

  • Sequence
  • Parallel
  • Repeat and Loop implemented in one action
  • Reverse not yet, but every reversable action has working reverse() method

Interval actions

  • Delay and RandomDelay implemented in one action
  • MoveTo
  • MoveBy
  • RotateTo
  • RotateBy
  • ScaleTo
  • ScaleBy
  • TintBy if you want to manipulate alpha, your material must support transparency
  • TintTo if you want to manipulate alpha, your material must support transparency
  • FadeOut if you want to manipulate alpha, your material must support transparency
  • FadeIn if you want to manipulate alpha, your material must support transparency
  • FadeTo if you want to manipulate alpha, your material must support transparency
  • FadeBy if you want to manipulate alpha, your material must support transparency
  • BezierAbs
  • BezierRel
  • JumpTo uses Bezier action to move the object
  • JumpBy uses Bezier action to move the object
  • Blink

Instant actions

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

Some additional actions

Interval actions

  • SkewBy
  • SkewTo

Instant actions

  • SetRotation
  • SetTint

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.