1
0
Fork 0
This commit is contained in:
Florian RICHER (MrDev023) 2019-01-27 14:54:55 +01:00
parent 37252a4edc
commit 19ab6f65e3
258 changed files with 406592 additions and 0 deletions

76
Assets/Scripts/Manette.cs Normal file
View file

@ -0,0 +1,76 @@
using System;
using UnityEngine;
public class Manette
{
public static bool IsUp ()
{
if (Input.GetJoystickNames().Length > 0)
{
float value = Input.GetAxis("Vertical");
if (value > 0.01) return true;
else return false;
}
return false;
}
public static bool IsDown()
{
if (Input.GetJoystickNames().Length > 0)
{
float value = Input.GetAxis("Vertical");
if (value < -0.01) return true;
else return false;
}
return false;
}
public static bool IsRight()
{
if (Input.GetJoystickNames().Length > 0)
{
float value = Input.GetAxis("Horizontal");
if (value > 0.01) return true;
else return false;
}
return false;
}
public static bool IsLeft()
{
if (Input.GetJoystickNames().Length > 0)
{
float value = Input.GetAxis("Horizontal");
if (value < -0.01) return true;
else return false;
}
return false;
}
public static bool IsUse()
{
if (Input.GetJoystickNames().Length > 0)
{
return Input.GetButtonDown("Fire1");
}
return false;
}
public static bool IsTorch()
{
if (Input.GetJoystickNames().Length > 0)
{
return Input.GetButtonDown("Fire2");
}
return false;
}
public static bool IsPlaceBlock()
{
if (Input.GetJoystickNames().Length > 0)
{
return Input.GetButtonDown("Space");
}
return false;
}
}