Ejemplo n.º 1
0
    private void _autoLogin()
    {
        SolaEngine engine    = SolaEngine.getInstance();
        string     sceneName = ScenesName.MAIN;

        engine.enterScene(sceneName);
        Application.LoadLevel(sceneName);
    }
Ejemplo n.º 2
0
    private void _onStoryClicked(GameObject gameObject)
    {
        SolaEngine engine    = SolaEngine.getInstance();
        string     sceneName = ScenesName.MAP;

        engine.enterScene(sceneName);
        Application.LoadLevel(sceneName);
    }
Ejemplo n.º 3
0
    private void _onBtnClicked(GameObject gameObject)
    {
        SolaEngine engine = SolaEngine.getInstance();
        BattleMgr  bMgr   = (BattleMgr)engine.getMgr(typeof(BattleMgr));

        bMgr.setMissionModel(_model);

        string sceneName = ScenesName.BATTLE;

        engine.enterScene(sceneName);
        Application.LoadLevel(sceneName);
    }
Ejemplo n.º 4
0
    private void _onComfirmClicked(GameObject src)
    {
        SolaEngine engine = SolaEngine.getInstance();

        DialogueModel[] dialogueModels = new DialogueModel[0];
        MapModel        mapModel       = _mapModel;

        List <HeroModel> monsterModels = mapModel.getRandomMonster();
        int monsterSize = monsterModels.Count;

        BattleInfoModel[] battleInfos = new BattleInfoModel[3];

        for (int j = 0; j < battleInfos.Length; j++)
        {
            List <BattleHeroModel> rdModels = new List <BattleHeroModel> ();

            for (int i = 0; i < 3; i++)
            {
                int       monsterIndex = engine.randomInt(0, monsterSize);
                HeroModel monster      = monsterModels [monsterIndex];

                Vector3 pos = new Vector3();
                pos.x = engine.randomInt(-200, 200);
                pos.y = engine.randomInt(-300, 300);
                pos.z = 0;

                BattleHeroModel bhModel = new BattleHeroModel();
                bhModel.setModel(monster, true, pos);

                rdModels.Add(bhModel);
            }
            BattleInfoModel bInfoModel = new BattleInfoModel();
            bInfoModel.mapBattleInfo(0, 3, rdModels);

            battleInfos[j] = bInfoModel;
        }

        MissionModel missionModel = new MissionModel();

        missionModel.formatMapBattle(battleInfos, dialogueModels);

        BattleMgr bMgr = (BattleMgr)engine.getMgr(typeof(BattleMgr));

        bMgr.setMissionModel(missionModel);

        string sceneName = ScenesName.BATTLE;

        engine.enterScene(sceneName);
        Destroy(himeScroll.gameObject);
        Application.LoadLevel(sceneName);
    }
Ejemplo n.º 5
0
    private void _onBtnClicked(GameObject gameObject)
    {
        _clickCount++;
        string     roleId = roleIdEdit.text.Trim();
        SolaEngine engine = SolaEngine.getInstance();

        if (false)
        {
            TestPacket tp2 = new TestPacket();
            tp2.aa = _clickCount;
            tp2.bb = roleId;

            TestInfoPacket tp3 = new TestInfoPacket();
            tp3.cc = _clickCount + 1;
            tp3.dd = roleId + "dd";

            tp2.cc = tp3;

            string[] ss = new string[2];
            ss [0]  = "asdasd";
            ss [1]  = "1111111asdasd";
            tp3.ddd = ss;

            TestInfoPacket[] tp4  = new TestInfoPacket[2];
            TestInfoPacket   ssss = new TestInfoPacket();
            ssss.dd = "ssss";
            tp4 [0] = ssss;

            tp2.ee = tp4;

            TestInfoPacket sssss = new TestInfoPacket();
            sssss.ddd = ss;
            tp4 [1]   = sssss;

            engine.send(OpCode.TEST_OPCODE, tp2.toData());
            return;
        }

        if (roleId == "")
        {
            Debug.Log("请输入账号");
            return;
        }

        _roleMgr.sign(roleId);
        string sceneName = ScenesName.MAIN;

        engine.enterScene(sceneName);
        Application.LoadLevel(sceneName);
    }