Exemple #1
0
    void Update()
    {
        // ios gamecenter
                #if UNITY_IOS
        if (Social.localUser.authenticated)
        {
            if (!socialFirstGot && GameCenterManager.gameCenterIsSuccess)              //第一次打开游戏,记录第一个 gameCenterUID
            {
                socialUID        = Social.localUser.id;
                socialUNAME      = Social.localUser.userName;
                socialUIDchanged = false;
                socialFirstGot   = true;              //d
            }
            else
            {
                CheckChange();
            }
        }
        else
        {
            if (socialFirstGot)
            {
                CheckChange();
            }
        }
                #endif
//		if (gameModel != null && gameModel.time.Ticks != 0)
//		{
//			gameModel.time = gameModel.time.AddTicks ((long)(Time.deltaTime * 1000 * 10000));
//		}
        if (time <= 0)
        {
            if (Input.GetKey(KeyCode.F1))
            {
                LocalStore.Clear();
//				LocalStore.DelLocal(LocalStore.LOCAL_TYPE);
//				LocalStore.DelLocal(LocalStore.LOCAL_UID);
//				LocalStore.DelLocal(LocalStore.LOCAL_PWD);
                RELOGIN_GAME(null);
                roleModel.uids.Clear();
                time = 1;
            }
            else if (Input.GetKey(KeyCode.F4))
            {
                PlatForm.inst.HTTP = "http://192.168.1.118:8899/gateway/";
                RELOGIN_GAME(null);
                roleModel.uids.Clear();
                time = 1;
            }
            else if (Input.GetKey(KeyCode.F5))
            {
                PlatForm.inst.HTTP = "http://192.168.1.119:8899/gateway/";
                RELOGIN_GAME(null);
                roleModel.uids.Clear();
                time = 1;
            }
            else if (Input.GetKey(KeyCode.F2))
            {
                PhoneManager.inst.ScreenImage("screen_" + Tools.GetDateTimeString());
                time = 1;
            }
            else if (Input.GetKey(KeyCode.F3))
            {
                this.StartCoroutine(ScreenImage());
                time = 1;
            }
            else if (Input.GetKey(KeyCode.Home))
            {
                if (log == null)
                {
                    log = new ComLog();
                    GRoot.inst.AddChild(log.group);
                }
                else
                {
                    GRoot.inst.RemoveChild(log.group);
                    log = null;
                }
                time = 1;
            }
        }
        time -= Time.deltaTime;
        //		Log.debug ("time - " + time);
        MediatorSystem.timeStart("timerManager");
        TimerManager.inst.Update();
        MediatorSystem.getRunTime("timerManager");
    }