GUI

Display GameObject position and rotation.

July 31, 2013   ·   0 Comments

using UnityEngine;
using System.Collections;

public class day3_3b : MonoBehaviour {

	// Use this for initialization
	void Start () {
	
	}
	
	// Update is called once per frame
	void Update () {
	
	}
	
	 void OnGUI(){
		Vector3 t1=gameObject.transform.position;

		 GUI.Label(new Rect(0,50,100,100),"Position X:"+
			t1.x+"y:"+t1.y+" Z:"+t1.z);
		 GUI.Label(new Rect(0,80,100,100),"Rotate X:"+ 
			gameObject.transform.localRotation.x
			+"y:"+gameObject.transform.localRotation.y
			+" Z:"+gameObject.transform.localRotation.z);
		
	}
	
	
}

shareShare on FacebookShare on Google+Share on LinkedInEmail this to someonePrint this pageBuffer this pageDigg thisFlattr the authorShare on RedditPin on PinterestShare on StumbleUponShare on TumblrTweet about this on Twitter

By


Readers Comments (0)


You must be logged in to post a comment.

PowenKo’s Online Store

powenko_arduinoBook
Unity3D4

Amazon

adsbygoogle

Recent Posts

Categories

Amazon