Last active
December 29, 2015 08:38
-
-
Save yumehachi/7644354 to your computer and use it in GitHub Desktop.
端末によってFPSを変更する
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using UnityEngine; | |
using System.Collections; | |
/// <summary> | |
/// Game manager. | |
/// </summary> | |
/// <author> | |
/// Create by yumehachi on 2013/11/26 | |
/// </author> | |
public class GameManager : MonoBehaviour | |
{ | |
void Awake () | |
{ | |
//FPS Setting | |
Application.targetFrameRate = SetFps (); | |
} | |
/// <summary> | |
/// 適切なFPSを返します | |
/// </summary> | |
/// <returns>FPS</returns> | |
private int SetFps () | |
{ | |
switch (iPhone.generation) { | |
case iPhoneGeneration.iPhone5: | |
case iPhoneGeneration.iPhone5C: | |
case iPhoneGeneration.iPhone5S: | |
return 60; | |
break; | |
} | |
//default fps | |
return 30; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment