Muestra las diferencias entre dos versiones de la página.
| Ambos lados, revisión anterior Revisión previa Próxima revisión | Revisión previa | ||
|
fw:unity3d:plugins [2014/04/04 16:13] alfred [UniBill] |
fw:unity3d:plugins [2020/05/09 09:25] (actual) |
||
|---|---|---|---|
| Línea 39: | Línea 39: | ||
| Also called PGP Plugin, it allows to take profit from Google Play Games platform and its services. [[https://developers.google.com/games/services/|Here]] is the oficial webpage where its capabilities are listed. It interacts with the unity social API to provide an unified platform. | Also called PGP Plugin, it allows to take profit from Google Play Games platform and its services. [[https://developers.google.com/games/services/|Here]] is the oficial webpage where its capabilities are listed. It interacts with the unity social API to provide an unified platform. | ||
| - | ===== NGUI ===== | + | |
| ===== Anti-Cheat Toolkit ===== | ===== Anti-Cheat Toolkit ===== | ||
| * [[http://blog.codestage.ru/unity-plugins/act/|Presentation]] | * [[http://blog.codestage.ru/unity-plugins/act/|Presentation]] | ||
| Línea 55: | Línea 55: | ||
| To install it you'll need to go to Assets>Import Package>Custom Package and browse to the package location on your hard disk. Leave all the files checked and click “Import”. | To install it you'll need to go to Assets>Import Package>Custom Package and browse to the package location on your hard disk. Leave all the files checked and click “Import”. | ||
| + | ===== TouchScript ====== | ||
| + | * [[https://github.com/InteractiveLab/TouchScript|Source Code]] | ||
| + | * [[http://interactivelab.github.io/TouchScript/tutorials.internals.html|Documentation]] | ||
| + | To detect hand gestures | ||
| + | |||
| + | |||
| + | ===== NGUI ===== | ||
| + | * [[http://www.tasharen.com/?page_id=140|Web page]] | ||
| + | * [[http://www.tasharen.com/ngui/docs/|Documentation]] | ||
| + | |||
| + | ==== Start with NGUI ==== | ||
| + | First of all you should copy the NGUI folder into the Assets folder. Open the unity interface an ''Ctrl+R''. | ||
| + | |||
| + | To create an interface you will need to do ''Main Menu -> NGUI -> Create -> 2D UI''. It will create a new camera which you should put into a new layer. | ||
| + | |||
| + | You will add widgets to the scene, then attach a label script, a button script, etc. | ||
| + | ==== Atlas ==== | ||
| + | An atlas is an image file which contains several other subimages that can be rotated and disorganized to optimize space. It's used as unique texture\image for game elements, it's generated a text file which is attached to the atlas to indicate image coordinates and orientation. It improves the performance in the graphics engine when use it as a simple texture for several elements. | ||
| + | |||
| + | In NGUI you can create an Atlas using the Atlas Maker tool and adding sprites to it, then you will create a material. This material will be assigned to the NGUI widgets (buttons, 2d sprites...) and it will be specified which sprite is the selected one. | ||
| + | |||
| + | === Notes === | ||
| + | * The render mode for atlas is given into the UIAtlas settings menú. | ||
| + | ==== How to... ==== | ||
| + | === Make a label follow a GameObject === | ||
| + | Being in the GameObject script... \\ | ||
| + | Being the guiCamera the NGUI camera... \\ | ||
| + | Being the continueLabelPosition variable for margins in the image... \\ | ||
| + | <code csharp> | ||
| + | Vector3 pos = Camera.main.WorldToViewportPoint(transform.position); | ||
| + | theLabel.transform.position = guiCamera.ViewportToWorldPoint(pos + continueLabelPosition); | ||
| + | pos = theLabel.transform.localPosition; | ||
| + | pos.x = Mathf.RoundToInt(pos.x); | ||
| + | pos.y = Mathf.RoundToInt(pos.y); | ||
| + | pos.z = 0f; | ||
| + | theLabel.transform.localPosition = pos; | ||
| + | theLabel.text = (GameManager.instance.continueTimeLeft-1).ToString(); | ||
| + | </code> | ||