Example #1
0
    // Use this for initialization
    void Start()
    {
        Debuger.EnableLog = true;

        gameHeart = new GameObject("GameHeart");
        gameHeart.AddComponent <DontDestroyObj>();

        //初始化数据存储系统
        UserDataManager.instance.Start();

        //初始化事件管理器
        EventManager em = gameHeart.AddComponent <EventManager>();

        //声音管理器
        AudioManager am = gameHeart.AddComponent <AudioManager>();

        //加载联网脚本
        HttpConnection hc = gameHeart.AddComponent <HttpConnection>();

        //初始化场景管理器
        GameSceneManager gsm = gameHeart.AddComponent <GameSceneManager>();

        ConfigManager.LoadData();
        (new EventChangeScene(GameSceneManager.SceneTag.Logo)).Send();

        GameCenterManager.GetInstance();
        ADManager.GetInstance();
    }
Example #2
0
    public void ShowOverLayer()
    {
        gameState = enGameState.over;

        int selmodel   = PlayerPrefs.GetInt(GameConst.USERDATANAME_MODEL, 0);
        int basescores = PlayerPrefs.GetInt(GameConst.USERDATANAME_MODEL_MAXSCORES + selmodel);

        int thisscores = role.scores;

        if (basescores < thisscores)
        {
            PlayerPrefs.SetInt(GameConst.USERDATANAME_MODEL_MAXSCORES + selmodel, thisscores);

            GameCenterManager.GetInstance().UploadScores(GameConst.gameModels[selmodel].lbname, thisscores);
        }
        PlayerPrefs.SetInt(GameConst.USERDATANAME_MODEL_LASTSCORES + selmodel, thisscores);

        if (reviveCount <= 0 && ADManager.GetInstance().isAdLoaded)
        {
            inGameUIManager.ShowReviveLayer();
        }
        else
        {
            inGameUIManager.ShowResultLayer();
        }
        reviveCount += 1;
    }
Example #3
0
 public void success()
 {
     tip.text = "success";
     if (thisLevel < PlayerPrefs.GetInt("maxLevel"))
     {
         next.interactable = true;
     }
     if (thisLevel + 1 > PlayerPrefs.GetInt("level"))
     {
         GameCenterManager.GetInstance().ReportScore("level", thisLevel);
         PlayerPrefs.SetInt("level", thisLevel + 1);
     }
 }
Example #4
0
 Animator tipController; //提示面板的动画开关控制
 // Start is called before the first frame update
 void Start()
 {
     GameCenterManager.GetInstance().Start();
     if (GameObject.FindWithTag("audioManager") == null)
     {
         audioManager = Instantiate(audioManager);
         DontDestroyOnLoad(audioManager);
     }
     tipController = tipBoard.GetComponent <Animator>();
     startBtn.onClick.AddListener(startBtnClick);
     aboutBtn.onClick.AddListener(aboutBtnClick);
     closeTip.onClick.AddListener(closeTipClick);
 }
Example #5
0
    void Start()
    {
                #if UNITY_IOS
        GameCenterManager.GetInstance().Start();
                #endif
//		LocalStore.Clear ();
//		Debug.Log(Config.OffLineTxt ["cn_14056"]);
//		return;

        //
        ModelManager.inst.Register();
        gameModel = ModelManager.inst.gameModel;
        this.InitConfigXml();
        //非战斗直接进游戏
        if (!FightMain.fightTest)
        {
            this.initQueue.Init(new List <Action> {
                this.InitConfig,
                this.InitRigester,
                this.InitOther,
                this.InitData,
                this.InitLogin
            });
        }
        else
        {
            //直接进入战斗
            this.initQueue.Init(new List <Action> {
                //this.initConfig,
                //this.InitRigester,
                //this.initModel,
                //this.initOther,
                () =>
                {
                    ModelManager.inst.Register();
                    this.initQueue.Next();
                },
                this.InitData,
                FightMain.instance.onStart
            });
        }
    }
Example #6
0
 void ShowLB(GameObject go)
 {
     GameCenterManager.GetInstance().Showlb();
 }
Example #7
0
 public void achieveClick()
 {
     Debug.Log("achieveClick");
     GameCenterManager.GetInstance().ShowAchievements();
 }