-
Notifications
You must be signed in to change notification settings - Fork 0
/
MainSceneManager.cs
92 lines (67 loc) · 2.01 KB
/
MainSceneManager.cs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
using UnityEngine;
using System.Collections;
using System.Collections.Generic;
using UnityEngine.UI;
using UnityEngine.Analytics;
//using MadLevelManager;
namespace Soomla.Store {
public class MainSceneManager : MonoBehaviour {
private static bool gcIsInitialized = false;
private static bool soomlaStoreInitialized = false;
public Button scoreButton;
// Use this for initialization
void Start () {
if (!soomlaStoreInitialized)
{
//SoomlaStore.Initialize(new WordJumperAssets());
}
// if (!gcIsInitialized)
// {
// GameCenterManager.OnAuthFinished += OnAuthFinished;
// GameCenterManager.Init();
// gcIsInitialized = true;
// }
Screen.autorotateToLandscapeLeft = true;
Screen.autorotateToLandscapeRight = true;
Screen.orientation = ScreenOrientation.AutoRotation;
if (PlayerPrefs.GetInt("MusicOn") == 0)
SoundManager.StopMusic();
GameObject.Find("GCScores").GetComponent<Button>().interactable = GameCenterManager.IsPlayerAuthenticated;
LogAnalytics("Scene Main");
#if UNITY_ANDROID || UNITY_WEBPLAYER || UNITY_STANDALONE_WIN || UNITY_STANDALONE_OSX
scoreButton.gameObject.SetActive(false);
#endif
// if this is first time, start with music on
if (!PlayerPrefs.HasKey("MusicOn"))
{
PlayerPrefs.SetInt("MusicOn", 1);
PlayerPrefs.Save();
}
}
void LogAnalytics(string name, string evtName="", object evtData=null)
{
Analytics.CustomEvent(name, new Dictionary<string, object> {{ evtName, evtData }});
}
// void OnAuthFinished (ISN_Result res) {
// if (res.IsSucceeded) {
// IOSNativePopUpManager.showMessage("Player Authored ", "ID: " + GameCenterManager.Player.Id + "\n" + "Alias: " + GameCenterManager.Player.Alias);
// } else {
// IOSNativePopUpManager.showMessage("Game Center ", "Player auth failed");
// }
// }
// Update is called once per frame
void Update () {
}
public void GoToOptions()
{
}
public void GoToAbout()
{
}
public void GoToPlay()
{
Application.LoadLevel("Play");
//MadLevel.LoadLevelByName("Chooser");
}
}
}