Esempio n. 1
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;
    }
Esempio n. 2
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();
    }
Esempio n. 3
0
        public FrmMain()
        {
            CLog4net.LogInfo("System starting!");

            InitializeComponent();
            this.systemController = new SystemController();
            FrmLoading frmLoading = new FrmLoading(this.systemController);

            frmLoading.ShowDialog();

            if (frmLoading.DialogResult == DialogResult.OK)
            {
                frmLoading.Hide();
                frmLoading.Close();
            }

            this.boxsManager      = BoxsManager.GetInstance();
            this.packageManager   = PackageManager.GetInstance();
            this.voiceService     = ServicesFactory.GetInstance().GetVoicService();
            this.serverService    = ServicesFactory.GetInstance().GetServerService();
            this.cameraService    = ServicesFactory.GetInstance().GetCameraService();
            this.about            = AboutConfig.GetInstance().GetAbout();
            this.infoCenterLister = InfoCenterLister.GetInsatnce();
            this.adManager        = ADManager.GetInstance();

            this.AddUCScene(Roster.Home, new Home(this, 0));
            this.AddUCScene(Roster.P_ControlPanel, new PostmanControlPanel(this, 5));
            this.AddUCScene(Roster.P_D_Verify, new PostmanVerify(this, 60));
            this.AddUCScene(Roster.P_D_ChooseBox, new PostmanChooseBox(this, 60));
            this.AddUCScene(Roster.P_D_DeliverPG, new PostmanDeliverPG(this, 120));
            this.AddUCScene(Roster.P_D_EntryPGInfo, new PostmanEntryPGInfo(this, 60));
            this.AddUCScene(Roster.P_D_PGVerify, new PostmanPGVerify(this, 60));
            this.AddUCScene(Roster.P_D_FinishWork, new PostmanFinishWork(this, 10));
            this.AddUCScene(Roster.P_D_Cancel, new PostmanCancelTask(this, 60));
            this.AddUCScene(Roster.P_D_CancelTask, new PostmanCancelTask(this, 60));
            this.AddUCScene(Roster.P_T_EntryPGInfo, new PostmanTBEntryPGInfo(this, 60));
            this.AddUCScene(Roster.P_T_FinishWork, new PostmanTBFinishWork(this, 60));
            this.AddUCScene(Roster.P_S_PGDelivered, new PostmanSPGDelivered(this, 60));
            this.AddUCScene(Roster.P_R_PGRegister, new PostmanRegister(this, 180));

            this.AddUCScene(Roster.C_ControlPanel, new CustomerControlPanel(this, 5));
            this.AddUCScene(Roster.C_T_Verify, new CustomerTBVerify(this, 60));
            this.AddUCScene(Roster.C_T_FinishWork, new CustomerTBFinishWork(this, 60));
            this.AddUCScene(Roster.C_S_EntryPGInfo, new CustomerSEntryPGInfo(this, 60));
            this.AddUCScene(Roster.C_S_PGSearched, new CustomerPGSearched(this, 60));

            this.AddUCScene(Roster.A_Verify, new AdminVerify(this, 60));
            this.AddUCScene(Roster.A_P_EntryBoxCode, new AdminProxyEntryBoxCode(this, 60));
            this.AddUCScene(Roster.A_P_FinishWork, new AdminProxyFinishWork(this, 60));
            this.AddUCScene(Roster.A_ControlPanel, new AdministratorControlPanel(this, 360));

            this.SceneTransit(Roster.Home);
            this.timerSceneInfo.Enabled = true;
            this.timerMain.Enabled      = true;

            CLog4net.LogInfo("启动完成");
        }
Esempio n. 4
0
    public override void Show()
    {
        base.Show();
        gameObject.SetActive(true);

        playCount++;

        if (InGameManager.gameTime - lastPlayerTime > 30 && playCount > 3 && ADManager.GetInstance().isAdLoaded)
        {
            playCount      = 0;
            lastPlayerTime = InGameManager.gameTime;
            ADManager.GetInstance().PlayGameOverAD();
        }
    }
Esempio n. 5
0
        public int Load(BackgroundWorker bw)
        {
            #region 获取初始化基本信息
            bw.ReportProgress(stepNum += 1, "starting......");

            this.databaseService = ServicesFactory.GetInstance().GetDatabaseService();
            this.aboutConfig     = AboutConfig.GetInstance();
            this.elocksManager   = ELocksManager.GetInstance();
            this.boxManager      = BoxsManager.GetInstance();
            this.packageManager  = PackageManager.GetInstance();
            this.adManager       = ADManager.GetInstance();
            this.remoteOpenLogic = RemoteOpenLogic.GetInstance();

            this.SystemTimer = new Timer(new TimerCallback(this.SystemTimer_Elapsed), null, Timeout.Infinite, Timeout.Infinite);
            #endregion

            System.Threading.Thread.Sleep(delay);
            bw.ReportProgress(stepNum += 1, "aboutConfig loading......");
            this.aboutConfig.Load();
            System.Threading.Thread.Sleep(delay);
            bw.ReportProgress(stepNum += 1, "boxManager loading......");
            this.boxManager.Load();
            System.Threading.Thread.Sleep(delay);
            bw.ReportProgress(stepNum += 1, "elocksManager loading......");
            this.elocksManager.Load();
            System.Threading.Thread.Sleep(delay);
            bw.ReportProgress(stepNum += 1, "packageManager loading......");
            this.packageManager.Load();
            System.Threading.Thread.Sleep(delay);
            bw.ReportProgress(stepNum += 1, "remoteOpenLogic loading......");
            this.remoteOpenLogic.Load();
            System.Threading.Thread.Sleep(delay);
            bw.ReportProgress(stepNum += 1, "adManager loading......");
            this.adManager.Load();
            System.Threading.Thread.Sleep(delay);
            bw.ReportProgress(stepNum += 1, "packageEvent loading......");
            this.packageManager.PackageCreatedEvent += new PackageManager.PackageCreatedDelegate(packageManager_PackageCreatedEvent);
            this.packageManager.PackageTakedEvent   += new PackageManager.PackageTakedDelegate(packageManager_PackageTakedEvent);
            this.SystemTimer.Change(0, 600 * 1000);
            System.Threading.Thread.Sleep(delay);
            bw.ReportProgress(stepNum += 1, "over");

            return(stepNum);
        }
Esempio n. 6
0
    public override void Show()
    {
        base.Show();
        gameObject.SetActive(true);

        playCount++;


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

        bestLabel.text = "Best:" + bestscores;


        if (InGameManager.gameTime - lastPlayerTime > 30 && playCount > 3 && ADManager.GetInstance().isAdLoaded)
        {
            playCount      = 0;
            lastPlayerTime = InGameManager.gameTime;
            ADManager.GetInstance().PlayGameOverAD();
        }
    }
Esempio n. 7
0
 private void Start()
 {
     progress = new CodeProgress(
         LanguageManager.GetInstance().Init,
         AudioManager.GetInstance().Init,
         StoreManager.GetInstance().Init,
         IAPManager.GetInstance().Init,
         UrlManager.GetInstance().Init,
         LocalAdManager.GetInstance().Init,
         ADManager.GetInstance().Init,
         TipsManager.GetInstance().Init,
         InventoryManager.GetInstance().Init,
         PlotManager.GetInstance().Init,
         MoreGameManager.GetInstance().Init,
         FeedbackManager.GetInstance().Init,
         ShareManager.GetInstance().Init,
         DataManager.GetInstance().Init,
         DataManager.GetInstance().LoadFile
         );
     progress.onProgress += OnProgress;
     StartCoroutine(Init());
 }
Esempio n. 8
0
    private void Start()
    {
        instance   = this;
        gamecamera = Camera.main;

        int           selRole = PlayerPrefs.GetInt(GameConst.USERDATANAME_SELECT_ROLE, 0);
        MapObjectConf selConf = ConfigManager.confMapObjectManager.dic[selRole];

        stepSpriteRes = Resources.Load <Sprite>("Texture/InGameObj/" + selConf.prefabName);


        inGameCameraEffect = gamecamera.GetComponent <InGameCameraEffect>();

        rapidBlurEffectManager = gamecamera.gameObject.AddComponent <RapidBlurEffectManager>();


        Vector3 screenLeftDown = new Vector3(0, 0, 0);
        Vector3 screenRightTop = new Vector3(Screen.width, Screen.height, 0);

        Vector3 gameLeftDown = GameCommon.ScreenPositionToWorld(gamecamera, screenLeftDown);
        Vector3 gameRightTop = GameCommon.ScreenPositionToWorld(gamecamera, screenRightTop);

        gameRect = new Rect(gameLeftDown, gameRightTop - gameLeftDown);

        gameState = enGameState.ready;

        if (UserDataManager.selLevel == null)
        {
            InitGame();
        }
        else
        {
            StartCoroutine(ReadConfigFile(UserDataManager.selLevel.file_path));
        }
        //
        ADManager.GetInstance().PlayGameOverAD();
    }
Esempio n. 9
0
 void Revive(GameObject obj)
 {
     ADManager.GetInstance().PlayReviveAD(ADCB, ADCloseCB);
     showAD = true;
     //gameObject.SetActive(false);
 }
Esempio n. 10
0
 void WatchAD(GameObject go)
 {
     ADManager.GetInstance().PlayReviveAD(ADCB, ADCloseCB);
 }