Beginner Scripting: DataTypes
The code is as follows
using UnityEngine; using System.Collections; public class DatatypeScript : MonoBehaviour { void Start () { //Value type variable Vector3 pos = transform.position; pos = new Vector3(0, 2, 0); //Reference type variable Transform tran = transform; tran.position = new Vector3(0, 2, 0); } }
Comments
Post a Comment