public void Awake(){ Debug.Log ("GooglePlayManager : AWAKE"); GooglePlayManager.instance = this; // Activate the Google Play Games platform PlayGamesPlatform.Activate (); //check who was logged in earlier to set currentAccount if (!PlayerPrefs.HasKey ("currentAccount")) { PlayerPrefs.SetString ("currentAccount", "Local"); currentAccount = "Local"; Debug.Log ("currentAccount = " + currentAccount); } else { currentAccount = PlayerPrefs.GetString ("currentAccount"); Debug.Log ("currentAccount = " + currentAccount); } if (!PlayerPrefs.HasKey ("userName")) { PlayerPrefs.SetString ("userName", "Local"); userName = "******"; } else { userName = PlayerPrefs.GetString ("userName"); } }
void Awake() { if (mainManager == null) { mainManager = this; DontDestroyOnLoad(gameObject); PlayGamesPlatform.Activate(); } else { Destroy(gameObject); } }
void Awake() { if (instance != null) { instance.resetScore(); Destroy(gameObject); } else { DontDestroyOnLoad(gameObject); instance = this; } }
private void Awake() { _LoadManager.LoadingScreen(true); if (MenuManager == null) { MenuManager = FindObjectOfType <GoogleMainMenuManager>(); } if (_NoticeManage == null) { _NoticeManage = NoticeManager.SingleTonyStark; } singletonGooglePlay = this; if (!PlayGamesPlatform.Instance.localUser.authenticated) { PlayGamesClientConfiguration config = new PlayGamesClientConfiguration.Builder().Build(); PlayGamesPlatform.InitializeInstance(config); PlayGamesPlatform.Activate(); PlayGamesPlatform.DebugLogEnabled = true; } if (Application.platform == RuntimePlatform.Android) { print("Android"); if (PlayerPrefs.HasKey(GoogleSignInTracking)) { DebugMaster.OnDebugging(" Old player - Account found!"); TestAuthLogin(); } else { DebugMaster.OnDebugging(" New player - No login records found!"); } } //else if (Application.platform == RuntimePlatform.IPhonePlayer) //{ // print("Iphone"); //} //else //{ // print("Editor"); //} }
private void Awake() { if (Instance == null) { isAchievesLoaded = false; Instance = this; PlayGamesPlatform.Activate(); LogIn(); DontDestroyOnLoad(gameObject); } else { Destroy(gameObject); } }
// Method for the show achievements button. public void ShowAchievements() { SoundManager.Instance.ButtonSFX(); // If the user is logged into google play services. if (Social.localUser.authenticated) { GooglePlayManager.ShowAchievementUI(); } // Ask the user if the would like to try logging in. else { // Run the not signed in method. NoAuth(); } }
private void Start() { if (instance == null) { instance = this; DontDestroyOnLoad(gameObject); PlayGamesPlatform.DebugLogEnabled = true; PlayGamesPlatform.Activate(); LogIn(); } else { Destroy(gameObject); } }
/// <summary> /// 로드시에 부르는 메소드 /// </summary> public static void LoadAll(bool isCloud, voidFunc onCloudLoadComplete = null, voidFunc onCloudLoadFail = null) { OnCloudLoadCompleteEvent += onCloudLoadComplete; OnCloudLoadFailEvent += onCloudLoadFail; byte[] binary = BinaryLocalLoad(SaveManager.FileName, SaveManager.Path); if (binary != null) { string json = Encoding.UTF8.GetString(binary); saveData = JsonConvert.DeserializeObject <SaveData>(json); Debug.Log("Local Save Loaded" + json); } ApplySave(); if (isCloud) { GooglePlayManager.LoadFromCloud(FileName); } }
// Use this for initialization void Awake() { if (instance != null && instance != this) { Destroy(gameObject); } else { instance = this; GameObject.DontDestroyOnLoad(gameObject); PlayGamesClientConfiguration config = new PlayGamesClientConfiguration.Builder().Build(); PlayGamesPlatform.InitializeInstance(config); PlayGamesPlatform.Activate(); } SignIn(); }
private void Awake() { singleTonGooglePlayMenu = this; if (gpm == null) { gpm = Behaviour.FindObjectOfType <GooglePlayManager>(); gpm.MenuManager = this; } if (_LoadingManager == null) { _LoadingManager = Behaviour.FindObjectOfType <LoadingManager>(); } OnCheckingGooglePlayUser(); }
void Awake() { if (instance == null) { instance = this; } else if (instance != this) { UnityEngine.Debug.LogError("SingleTone Error : " + this.name); Destroy(this); } //FadeTool.FadeIn(1f, ()=> { isBtnEnable = true; }); #region 안드로이드 설정 Input.multiTouchEnabled = false; Application.targetFrameRate = 60; #endregion canvas = GameObject.Find("Canvas").transform; tutorial = canvas.Find("Tutorial").gameObject.GetComponent <Tutorial>(); _new = canvas.Find("NewIcon").gameObject; option = canvas.Find("Option").gameObject.GetComponent <Option>(); exitPanel = canvas.Find("ExitPanel").gameObject.GetComponent <Exit>(); diary = canvas.Find("Diary").gameObject.GetComponent <Diary>(); intro = canvas.Find("Intro").gameObject.GetComponent <Intro>(); loadPanel = canvas.Find("LoadPanel").gameObject; startPanel = canvas.Find("StartPanel").gameObject; if (!SaveManager.isintroSeen) { SaveManager.isintroSeen = true; Database.ReadDatas(); ArchLoader.instance.StartCache(); SaveManager.LoadAll(false); LoadPanelOn(); GooglePlayManager.Init(); GooglePlayManager.LogIn(LoadPanelOff, LoadPanelOff); intro.On(() => { isBtnEnable = true; }); } #if !UNITY_ANDROID LoadPanelOff(); #endif }
/* Realiza la conexión con GooglePlay */ public void ConnectBt() { if (Social.localUser.authenticated) { PlayGamesPlatform.Instance.SignOut(); ChangeConnectBt(false); } else { Social.localUser.Authenticate((bool success) => { if (Social.localUser.authenticated) { ChangeConnectBt(true); GooglePlayManager.CheckAchievements(); } }); } }
/* Se encarga de instanciar enemigos */ void Update() { if (boss == false) { ghostRespawn(); if (timerScript.GetTime() > bossTime) { boss = true; } } else { if (bossRespawned == false) { /* Quitar todos los otros fantasmas */ int enemyCount = enemyParent.transform.childCount; for (int i = 0; i < enemyCount; i++) { enemyParent.transform.GetChild(i).GetComponent <EnemyIA>().disappearGhost(); } /* Hacerlo más grande */ spawnable.transform.localScale = new Vector3(4, 4, 1); /* Spawn fantasma grande */ spawnEnemy(); /* Vuelta a normalidad -> Es el mismo recurso y se queda permanente */ spawnable.transform.localScale = new Vector3(1, 1, 1); bossRespawned = true; if (Social.localUser.authenticated) { GooglePlayManager.SetOnlineAchievement("CgkInJLw2NEXEAIQEg"); } } else { ghostRespawn(); } } }
private void OnInvitationReceived(string data) { string[] storeData = data.Split(AndroidNative.DATA_SPLITTER [0]); GP_Invite inv = new GP_Invite(); inv.Id = storeData[0]; inv.CreationTimestamp = System.Convert.ToInt64(storeData[1]); inv.InvitationType = (GP_InvitationType)System.Convert.ToInt32(storeData[2]); inv.Variant = System.Convert.ToInt32(storeData [3]); inv.Participant = GooglePlayManager.ParseParticipanData(storeData, 4); if (inv.InvitationType == GP_InvitationType.INVITATION_TYPE_REAL_TIME) { _invitations.Add(inv); ActionInvitationReceived(inv); } }
private void OnParticleCollision(GameObject col) { // get the amount of spiders sprayed. spidersSprayedCount = PlayerPrefs.GetInt("SpidersSprayed", 0); // Add 1 to the spider squished count spidersSprayedCount += 1; // Check if we have reached an achievment target. switch (spidersSprayedCount) { case 50: GooglePlayManager.UnlockAchievement(GPGSIds.achievement_50_spiders_sprayed); break; case 100: GooglePlayManager.UnlockAchievement(GPGSIds.achievement_100_spiders_sprayed); break; case 250: GooglePlayManager.UnlockAchievement(GPGSIds.achievement_250_spiders_sprayed); break; case 500: GooglePlayManager.UnlockAchievement(GPGSIds.achievement_500_spiders_sprayed); break; case 1000: GooglePlayManager.UnlockAchievement(GPGSIds.achievement_1000_spiders_sprayed); break; default: break; } // set the player prefs SpidersSquished value to the new spidersSquishedcount. PlayerPrefs.SetInt("SpidersSprayed", spidersSprayedCount); // Play the die SFX SoundManager.Instance.DieSFX(); // Destroy the sprayed spider. Destroy(transform.parent.gameObject); }
/// <summary> /// Init. /// </summary> void Awake() { GC = GameObject.FindGameObjectWithTag("GameController"); uiCam = GameObject.FindGameObjectWithTag("UICamera").GetComponent <Camera>(); googlePlayManager = GameObject.FindGameObjectWithTag("GameController").GetComponent <GooglePlayManager>(); isPaused = false; Time.timeScale = 1.0f; Time.fixedDeltaTime = 0.02f; if (pausePlane) { pausePlane.SetActive(false); } uiNewSkinCell.SetActive(false); isSkinCellVisible = false; AdManagerObject = GameObject.FindGameObjectWithTag("AdManager"); }
/// <summary> /// 아래 함수를 제외한 특수한 업적달성시 콜 할 것 /// </summary> /// <param name="i">업적번호</param> public static void GetAchivement(int i) { if (GetAchiveUnlockData(i) == true) { return; } if (!SetAchiveUnlockData(i, true)) { return; } Debug.Log("Save - [Achivement] , Num : " + i); if (Database.achiveDatas[i].reward.Length != 0) { SetDiaryUnlockData(int.Parse(Database.achiveDatas[i].reward), true); } /*if (Database.achiveDatas[i].cardReward.Length != 0) * { * SetCardUnlockData(int.Parse(Database.achiveDatas[i].cardReward), true); * }*/ GooglePlayManager.CheckGoogleAchive(i); SaveAll(); }
void OnGUI() { high = 10; if (CreateBtn("登录")) { GooglePlayManager.Authenticating(AuthenticatingCallBack); } if (CreateBtn("注销")) { GooglePlayManager.SignOut(); } if (CreateBtn("上传分数")) { GooglePlayManager.PostScore(123, "CgkImoOim_EUEAIQAQ"); } if (CreateBtn("显示排行榜")) { GooglePlayManager.ShowLeaderboard("CgkImoOim_EUEAIQAQ"); } }
public void OnAchiveClear() { GooglePlayManager.UnlockAchievement(GPGSIds.achievement, 100); }
public void OnLeaderboardScore() { GooglePlayManager.ReportScore(GPGSIds.leaderboard_aklg, 5); }
public void OnLeaderboard() { GooglePlayManager.ShowLeaderboardUI(); }
public void OnLogOut() { GooglePlayManager.LogOut(); }
public void OnLogIn() { GooglePlayManager.LogIn(null, null); }
void Awake() { Instance = this; DontDestroyOnLoad(this); }
public void OnSelect() { GooglePlayManager.ShowSelectUI(); }
// Use this for initialization void Start() { GooglePlayManager.Init(); }
// Use this for initialization void Start() { obj = GameObject.Find("BagImage"); obj4 = GameObject.Find("Gerenciador"); obj5 = GameObject.Find("ItemDatabase"); script4 = (GerenciadorMissao)obj4.GetComponent(typeof(GerenciadorMissao)); inventory = (Inventory)obj.GetComponent(typeof(Inventory)); database = (ItemDatabase)obj5.GetComponent(typeof(ItemDatabase)); //log = (LogScript)obj4.GetComponent(typeof(LogScript)); setSlotScripts[0] = (SetSlotScript)GameObject.Find("SlotWeapon").GetComponent(typeof(SetSlotScript)); setSlotScripts[1] = (SetSlotScript)GameObject.Find("SlotArmor").GetComponent(typeof(SetSlotScript)); googleManager = (GooglePlayManager)obj4.GetComponent(typeof(GooglePlayManager)); BlacksmithWeapon = new Item(); BlacksmithArmor = new Item(); }
void Start() { Debug.Log ("W"+Screen.width); Debug.Log ("H"+Screen.height); obj = GameObject.Find("ItemDatabase"); obj4 = GameObject.Find("Gerenciador"); database = (ItemDatabase) obj.GetComponent(typeof (ItemDatabase)); script4 = (GerenciadorMissao)obj4.GetComponent(typeof(GerenciadorMissao)); missao = (Missao)obj4.GetComponent(typeof(Missao)); //log = (LogScript)obj4.GetComponent(typeof(LogScript)); googleManager = (GooglePlayManager)obj4.GetComponent(typeof(GooglePlayManager)); int SlotAmmount = 0; for (int i = 0; i < 30; i++) {; Slots.Add(this.transform.GetChild(i).gameObject); Items.Add(new Item()); } }
public void ShowLeaderboard() { GooglePlayManager.ShowLeaderboards(); }
public void OnAchive() { GooglePlayManager.ShowAchievementUI(); }
public void OnInit() { GooglePlayManager.Init(); }
public void OnAchiveButtonDown() { MainMenu.ButtonDown(); GooglePlayManager.ShowAchievementUI(); }
// Use this for initialization void Start() { GameObject[] enemys = GameObject.FindGameObjectsWithTag("PlayManager"); if (enemys.GetLength(0) != 1) { Destroy(transform.gameObject); } instance = this; games_count = 0; count = 0; AppLovin.InitializeSdk(); AppLovin.PreloadInterstitial(); AppLovin.SetUnityAdListener(gameObject.name); //AdMob init //Admob.Instance ().initAdmob ("ca-app-pub-5744130550718724/8983149295", "ca-app-pub-5744130550718724/6345910496"); //Admob.Instance().loadInterstitial(); //RequestBanner (); //ShowBannerTop (); //RequestInterstitial (); //Chartboost.cacheInterstitial (CBLocation.HomeScreen); //StartApp AudioSrc = GetComponent <AudioSource> (); PlayGamesPlatform.Activate(); PlayGamesPlatform.Instance.Authenticate((bool success) => { //IsConnectedToGooglePlay = success; }); SetHiScore(); //Social.ReportScore (PlayerPrefs.GetInt ("HighScore"), "FirstDaily", GPGSIds.leaderboard_top_ninjas, (bool success) => { //}); if (PlayerPrefs.HasKey("Pirate")) { GooglePlayManager.instance.UnlockAchi("Pirate"); } if (PlayerPrefs.HasKey("Maiden")) { GooglePlayManager.instance.UnlockAchi("Maiden"); } if (PlayerPrefs.HasKey("Samurai")) { GooglePlayManager.instance.UnlockAchi("Samurai"); } if (PlayerPrefs.HasKey("Spy")) { GooglePlayManager.instance.UnlockAchi("Spy"); } if (PlayerPrefs.HasKey("Ranger")) { GooglePlayManager.instance.UnlockAchi("Ranger"); } if (PlayerPrefs.GetInt("HighScore") >= 40) { GooglePlayManager.instance.UnlockAchi("cow"); PlayerPrefs.SetInt("EnemyUnlocked", 11); } if (PlayerPrefs.GetInt("HighScore") >= 70) { GooglePlayManager.instance.UnlockAchi("Ghost"); PlayerPrefs.SetInt("EnemyUnlocked", 12); } if (PlayerPrefs.GetInt("HighScore") >= 100) { GooglePlayManager.instance.UnlockAchi("Hero"); PlayerPrefs.SetInt("EnemyUnlocked", 13); } }
public void ShowAchievement() { GooglePlayManager.ShowAchievements(); }