- Home /
How to detect gpu name?
How can i display with c# smartphone's gpu name ? I red about sytemInfo but i cant make it work.... Any help appreciated.
Answer by Reynarz · Jul 20, 2017 at 04:36 PM
What are you doing in your code? this doesn't work for you?
string name = SystemInfo.graphicsDeviceName;
Answer by AjelG · Jul 20, 2017 at 05:03 PM
Right now i just want to display it with debug.log.
here is the code i wrote. using System.Collections; using System.Collections.Generic; using UnityEngine;
public class SystemInfo : MonoBehaviour {
public static string graphicsDeviceName;
public static int maxTextureSize;
public static string graphicsDeviceVersion;
void Info () {
print (SystemInfo.graphicsDeviceName);
print (SystemInfo.maxTextureSize);
print (SystemInfo.graphicsDeviceVersion);
}
void Start(){
Info ();
}
}
Why are you making a SystemInfo Class? unity already have that class by default. you dont need do that. Delete that code and make this.
class myClass : $$anonymous$$onoBehaviour
{
private void Start()
{
string name = SystemInfo.graphicsDeviceName;
//Or
print(SystemInfo.graphicsDeviceName);
}
}
Just to make it clear what you did wrong. You create a class which you called "SystemInfo". That will "hide" Unity's SystemInfo class- So whenever you try to access "SystemInfo" the compiler will use your class.
If, for whatever reason, you do want to call your own class "SystemInfo" you can do:
void Info () {
print (UnityEngine.SystemInfo.graphicsDeviceName);
print (UnityEngine.SystemInfo.maxTextureSize);
print (UnityEngine.SystemInfo.graphicsDeviceVersion);
}
If you do this (which i do not recommend) you should at least put your own class in a seperate namespace to avoid conflicts with other classes which might use Unity's "SystemInfo" class.
In general you want to avoid using class names of existing classes for your own classes.
Your answer
Follow this Question
Related Questions
why SystemInfo.deviceUniqueIdentifier can be changed 1 Answer
How can I count GFLOPS or Memory clock of a graphic card in my game? 0 Answers
Accessing local system ( File Browser ) 2 Answers
Checking SystemInfo in browser 0 Answers
TimeZoneInfo.GetSystemTimeZones().Count gives 0 for unity android app 0 Answers