- Home /
Question by
LemonPepper · Feb 26, 2014 at 02:20 PM ·
systemapplication
Detect Linux OS
In my game, I'm able to detect MacOS and Windows in order for my game to recognize the Xbox controller for either system. But I didn't see a way of detecting Linux in the Unity Script Reference. Does any know what the syntax would be for Linux, if needed? Code example below. Thanks.
public class InfoAxis : MonoBehaviour {
public bool macController;
public bool winController;
void Start () {
if (Application.platform == RuntimePlatform.WindowsPlayer){
winController=true;
}else{
winController=false;
}
if (Application.platform == RuntimePlatform.OSXPlayer){
macController=true;
}else{
macController=false;
}
}
void Update () {
...etc, etc ...
}
}
Comment
Answer by CHPedersen · Feb 26, 2014 at 02:54 PM
RuntimePlatform.LinuxPlayer is defined, it just isn't written in the docs.
Your answer
Follow this Question
Related Questions
The name 'Joystick' does not denote a valid type ('not found') 2 Answers
How can you make an inventory and crafting system? 0 Answers
Applying scripts 1 Answer
Script for Application initialisation 1 Answer
Play Scene help 1 Answer