Skip to content

Instantly share code, notes, and snippets.

@yumehachi
Last active December 29, 2015 08:38
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save yumehachi/7644354 to your computer and use it in GitHub Desktop.
Save yumehachi/7644354 to your computer and use it in GitHub Desktop.
端末によってFPSを変更する
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