Herramientas de usuario

Herramientas del sitio


fw:unity3d:plugins

Diferencias

Muestra las diferencias entre dos versiones de la página.

Enlace a la vista de comparación

Ambos lados, revisión anterior Revisión previa
Próxima revisión
Revisión previa
fw:unity3d:plugins [2014/04/24 10:45]
alfred [Atlas]
fw:unity3d:plugins [2020/05/09 09:25] (actual)
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 =====+===== TouchScript ​======
   * [[https://​github.com/​InteractiveLab/​TouchScript|Source Code]]   * [[https://​github.com/​InteractiveLab/​TouchScript|Source Code]]
   * [[http://​interactivelab.github.io/​TouchScript/​tutorials.internals.html|Documentation]]   * [[http://​interactivelab.github.io/​TouchScript/​tutorials.internals.html|Documentation]]
Línea 61: Línea 61:
  
  
-====== NGUI ======+===== NGUI =====
   * [[http://​www.tasharen.com/?​page_id=140|Web page]]   * [[http://​www.tasharen.com/?​page_id=140|Web page]]
   * [[http://​www.tasharen.com/​ngui/​docs/​|Documentation]]   * [[http://​www.tasharen.com/​ngui/​docs/​|Documentation]]
  
-===== Start with NGUI =====+==== Start with NGUI ====
 First of all you should copy the NGUI folder into the Assets folder. Open the unity interface an ''​Ctrl+R''​. ​ 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. 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.
  
-===== Atlas =====+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. 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.
  
Línea 77: Línea 78:
 === Notes === === Notes ===
   * The render mode for atlas is given into the UIAtlas settings menú.   * 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>​
fw/unity3d/plugins.1398336324.txt.gz · Última modificación: 2020/05/09 09:24 (editor externo)