Unity

Agarrar y soltar en 2D

using UnityEngine; using System.Collections; public class Drag : MonoBehaviour { private bool draggingItem = false; private GameObject draggedObject; private Vector2 […]

Agarrar y soltar

using UnityEngine; using System.Collections; public class Drag : MonoBehaviour { private Color mouseOverColor = Color.blue; private Color originalColor = Color.yellow; […]

Simple move

using UnityEngine; using System.Collections; [RequireComponent(typeof(CharacterController))] public class SimpleMove : MonoBehaviour { public float speed = 3.0F; public float rotateSpeed = […]

Clic para mover objeto

var smooth:int; private var targetPosition:Vector3; function Update () { if(Input.GetKeyDown(KeyCode.Mouse1)) { smooth=1; var playerPlane = new Plane(Vector3.up, transform.position); var ray […]

Cambiar color de material

using UnityEngine; using System.Collections; public class ChangeColorMaterial: MonoBehaviour { void Update() { if (Input.GetKeyDown(KeyCode.R)) { GetComponent ().material.color = Color.red; } if […]

Reproducir animaciones del Animator

using System.Collections; using System.Collections.Generic; using UnityEngine; public class Animaciones : MonoBehaviour { void Update() { if (Input.GetAxis(«Horizontalusing System.Collections; using System.Collections.Generic; […]