void Update()
{
float h = ETCInput.GetAxis("Horizontal");
float v = ETCInput.GetAxis("Vertical");
if (v > 0)
{
if (h <= 1 && h > 0.75f)
{
Debug.Log(h + " you");
}
else if (h <= 0.75f && h > 0.25f)
{
Debug.Log(h + " youshang");
}
else if (h <= 0.25f && h > -0.25f)
{
Debug.Log(h + " shang");
}
else if (h <= -0.25f && h > -0.75f)
{
Debug.Log(h + " zuoshang");
}
else if (h <= -0.75f && h > -1f)
{
Debug.Log(h + " zuo");
}
}
else if (v < 0)
{
if (h <= 1 && h > 0.75f)
{
Debug.Log(h + " you");
}
else if (h <= 0.75f && h > 0.25f)
{
Debug.Log(h + " youxia");
}
else if (h <= 0.25f && h > -0.25f)
{
Debug.Log(h + " xia");
}
else if (h <= -0.25f && h > -0.75f)
{
Debug.Log(h + " zuoxia");
}
else if (h <= -0.75f && h > -1f)
{
Debug.Log(h + " zuo");
}
}
else
{
if (h > 0)
{
Debug.Log(h + " you");
}
else if (h < 0)
{
Debug.Log(h + " zuo");
}
else
{
Debug.Log("Idle");
}
}
}
EasyTouch 八方向改进--个人学习记录
最新推荐文章于 2019-10-17 15:03:46 发布