// Se o GameCenter esta ativo na plataforma // ps: Se o método for executado em qualquer plataforma que não seja iOS, retornara false public static bool GameCenterAvailable() { #if UNITY_IPHONE return(GameCenterBinding.isGameCenterAvailable()); #else return(false); #endif }
public override void Init() { PRODUCT_IDENTIFIERS[0] = GOLD_200; PRODUCT_IDENTIFIERS[1] = GOLD_500; PRODUCT_IDENTIFIERS[2] = GOLD_4000; Application.targetFrameRate = 45; GameObject gcm; GameObject skm; GameObject etcm; GameObject etcl; GameObject cbm; if (GameObject.Find("GameCenterManager") == null && GameObject.Find("GameCenterManager(Clone)") == null) { gcm = (GameObject)Instantiate(Resources.Load(PRIME31_DIRECTORY + "GameCenterManager")); } if (GameObject.Find("StoreKitManager") == null && GameObject.Find("StoreKitManager(Clone)") == null) { skm = (GameObject)Instantiate(Resources.Load(PRIME31_DIRECTORY + "StoreKitManager")); } if (GameObject.Find("EtceteraManager") == null && GameObject.Find("EtceteraManager(Clone)") == null) { etcm = (GameObject)Instantiate(Resources.Load(PRIME31_DIRECTORY + "EtceteraManager")); } if (GameObject.Find("EtceteraEventListener") == null && GameObject.Find("EtceteraEventListener(Clone)") == null) { etcl = (GameObject)Instantiate(Resources.Load(PRIME31_DIRECTORY + "EtceteraEventListener")); } if (GameObject.Find("ChartBoostManager") == null && GameObject.Find("ChartBoostManager(Clone)") == null) { cbm = (GameObject)Instantiate(Resources.Load(PRIME31_DIRECTORY + "ChartBoostManager")); } #if UNITY_IPHONE ChartBoostBinding.init(CHARTBOOST_APPID, CHARTBOOST_SIGNATURE); StoreKitBinding.requestProductData(PRODUCT_IDENTIFIERS); if (GameCenterBinding.isGameCenterAvailable()) { GameCenterBinding.authenticateLocalPlayer(); } #endif }