Bu Derste Input Get Axıs Metodunu Öğreneceksiniz...
AXIS EXAMPLE:
C#
using UnityEngine;
using System.Collections;
public class AxisExample : MonoBehaviour
{
public float range;
public GUIText textOutput;
void Update ()
{
float h = Input.GetAxis("Horizontal");
float xPos = h * range;
transform.position = new Vector3(xPos, 2f, 0);
textOutput.text = "Value Returned: "+h.ToString("F2");
}
}
JS
#pragma strict
public var range : float;
public var textOutput : GUIText;
function Update ()
{
var h : float = Input.GetAxis("Horizontal");
var xPos : float = h * range;
transform.position = new Vector3(xPos, 2f, 0);
textOutput.text = "Value Returned: "+h.ToString("F2");
}
AXIS RAW EXAMPLE:
C#
using UnityEngine;
using System.Collections;
public class AxisRawExample : MonoBehaviour
{
public float range;
public GUIText textOutput;
void Update ()
{
float h = Input.GetAxisRaw("Horizontal");
float xPos = h * range;
transform.position = new Vector3(xPos, 2f, 0);
textOutput.text = "Value Returned: "+h.ToString("F2");
}
}
JS
#pragma strict
public var range : float;
public var textOutput : GUIText;
function Update ()
{
var h : float = Input.GetAxisRaw("Horizontal");
var xPos : float = h * range;
transform.position = new Vector3(xPos, 2f, 0);
textOutput.text = "Value Returned: "+h.ToString("F2");
}
DUAL AXIS EXAMPLE:
C#
using UnityEngine;
using System.Collections;
public class DualAxisExample : MonoBehaviour
{
public float range;
public GUIText textOutput;
void Update ()
{
float h = Input.GetAxis("Horizontal");
float v = Input.GetAxis("Vertical");
float xPos = h * range;
float yPos = v * range;
transform.position = new Vector3(xPos, yPos, 0);
textOutput.text = "Horizontal Value Returned: "+h.ToString("F2")+"\nVertical Value Returned: "+v.ToString("F2");
}
}
JS
#pragma strict
public var range : float;
public var textOutput : GUIText;
function Update ()
{
var h : float = Input.GetAxis("Horizontal");
var v : float = Input.GetAxis("Vertical");
var xPos : float = h * range;
var yPos : float = v * range;
transform.position = new Vector3(xPos, yPos, 0);
textOutput.text = "Horizontal Value Returned: "+h.ToString("F2")+"\nVertical Value Returned: "+v.ToString("F2");
}
İlgili Yazı
UNİTY 3D ANDROİD REMOTE
Unity 3D De Android için Bir Oyun Veya Uygulama Yapıyorsanız en çok başınızı ağrıtan işl
UNİTY 3D COOKİE
UNİTY 3D COOKİE
Bu Derste Cookie İşlemini öğreneceğiz.
Cookie Işıkların önündeki Texturen
UNİTYE GİRİŞ
UNİTY 3D iki Boyutlu Ve Üç Boyutlu Bir Oyun Hazırlama Platformudur.
Bu Platformda Windows,İOS,And
UNİTY 3D TERRAİN
Unity 3d Programında belirli objeleri oluşturmanıza olanak sunar küp,küre,silindir
UNİTY 3D PARENT
UNİTY 3D PARENT - CHİLD
Parent Child Bir objenin altındaki objelerdir bu genelde pek işimi
ROFF TEXTURE
ROOF TEXTURE
İNDİR