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 = […]

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; […]

Movimiento 2D con salto

using System.Collections; using System.Collections.Generic; using UnityEngine; public class PlayerController : MonoBehaviour {     public float moveSpeed; //variable que controla […]