示例#1
0
 public void createNPC(lgGDBase npcCtrl)
 {
     createSceneObjectPair(
         npcCtrl,
         OBJECT_NAME_DEF.SCENE_NPC_CTRL,
         OBJECT_NAME_DEF.SCENE_NPC_DRAW
         );
 }
示例#2
0
 public void createMonster(lgGDBase monsterCtrl)
 {
     createSceneObjectPair(
         monsterCtrl,
         OBJECT_NAME_DEF.SCENE_MONSTER_CTRL,
         OBJECT_NAME_DEF.SCENE_MONSTER_DRAW
         );
 }
示例#3
0
 public void createHero(lgGDBase heroCtrl)
 {
     createSceneObjectPair(
         heroCtrl,
         OBJECT_NAME_DEF.SCENE_HERO_CTRL,
         OBJECT_NAME_DEF.SCENE_HERO_DRAW
         );
 }
示例#4
0
 public void createOtherPlayer(lgGDBase otherPlayerCtrl)
 {
     createSceneObjectPair(
         otherPlayerCtrl,
         OBJECT_NAME_DEF.SCENE_OTHER_PLAY_CTRL,
         OBJECT_NAME_DEF.SCENE_OTHER_PLAY_DRAW
         );
 }
示例#5
0
 public void createCamera(lgGDBase cameraCtrl)
 {
     createSceneObjectPair(
         cameraCtrl,
         OBJECT_NAME_DEF.SCENE_CAMERA_CTRL,
         OBJECT_NAME_DEF.SCENE_CAMERA_DRAW
         );
 }
示例#6
0
 //public void createAvatarObject(lgGDBase avatarCtrl)
 //{
 //    //createSceneObjectPair( mapCtrl, OBJECT_NAME_DEF.SCENE_MAP_CTRL, OBJECT_NAME_DEF.SCENE_MAP_DRAW );
 //}
 public void createMainAvatarObject(lgGDBase avatarCtrl)
 {
     createSceneObjectPair(
         avatarCtrl,
         OBJECT_NAME_DEF.SCENE_MAIN_PLAY_CTRL,
         OBJECT_NAME_DEF.SCENE_MAIN_PLAY_DRAW
         );
 }
示例#7
0
        //========


        public void createMapObject(lgGDBase mapCtrl)
        {
            createSceneObjectPair(
                mapCtrl,
                OBJECT_NAME_DEF.SCENE_MAP_CTRL,
                OBJECT_NAME_DEF.SCENE_MAP_DRAW
                );
        }
示例#8
0
        private void createSceneObjectPair(lgGDBase mapCtrl, string ctrlName, string drawName)
        {
            LGGRBaseImpls lGGRBaseImpls = base.createInst(ctrlName, false) as LGGRBaseImpls;
            GRBaseImpls   gRBaseImpls   = base.createInst(drawName, false) as GRBaseImpls;
            bool          flag          = lGGRBaseImpls == null;

            if (flag)
            {
                DebugTrace.print("GRClient create ctrlName[" + ctrlName + "] null!");
            }
            else
            {
                bool flag2 = gRBaseImpls == null;
                if (flag2)
                {
                    DebugTrace.print("GRClient create drawName[" + drawName + "] null!");
                }
                else
                {
                    mapCtrl.initGr(gRBaseImpls, lGGRBaseImpls);
                    gRBaseImpls.initLg(mapCtrl);
                    lGGRBaseImpls.init();
                    gRBaseImpls.init();
                    lGGRBaseImpls.setGameCtrl(mapCtrl);
                    lGGRBaseImpls.setDrawBase(gRBaseImpls);
                    gRBaseImpls.setSceneCtrl(lGGRBaseImpls);
                    bool flag3 = "SCENE_MAIN_PLAY_CTRL" == ctrlName;
                    if (flag3)
                    {
                        base.g_processM.addRender(lGGRBaseImpls, true);
                        base.g_processM.addRender(gRBaseImpls, true);
                    }
                    else
                    {
                        base.g_processM.addRender(lGGRBaseImpls, false);
                        base.g_processM.addRender(gRBaseImpls, false);
                    }
                }
            }
        }
示例#9
0
        private void createSceneObjectPair(lgGDBase mapCtrl, string ctrlName, string drawName)
        {
            LGGRBaseImpls sctrl = createInst(ctrlName, false) as LGGRBaseImpls;
            GRBaseImpls   dbase = createInst(drawName, false) as GRBaseImpls;

            if (sctrl == null)
            {
                DebugTrace.print("GRClient create ctrlName[" + ctrlName + "] null!");
                return;
            }
            if (dbase == null)
            {
                DebugTrace.print("GRClient create drawName[" + drawName + "] null!");
                return;
            }


            mapCtrl.initGr(dbase, sctrl);
            dbase.initLg(mapCtrl);
            sctrl.init();
            dbase.init();

            sctrl.setGameCtrl(mapCtrl);

            sctrl.setDrawBase(dbase);
            dbase.setSceneCtrl(sctrl);

            if (OBJECT_NAME_DEF.SCENE_MAIN_PLAY_CTRL == ctrlName)
            {
                this.g_processM.addRender(sctrl, true);
                this.g_processM.addRender(dbase, true);
            }
            else
            {
                this.g_processM.addRender(sctrl);
                this.g_processM.addRender(dbase);
            }
        }
示例#10
0
 public void createHero(lgGDBase heroCtrl)
 {
     this.createSceneObjectPair(heroCtrl, "SCENE_HERO_CTRL", "SCENE_HERO_DRAW");
 }
示例#11
0
 public void createOtherPlayer(lgGDBase otherPlayerCtrl)
 {
     this.createSceneObjectPair(otherPlayerCtrl, "SCENE_OTHER_PLAY_CTRL", "SCENE_OTHER_PLAY_DRAW");
 }
示例#12
0
 public void createMonster(lgGDBase monsterCtrl)
 {
     this.createSceneObjectPair(monsterCtrl, "SCENE_MONSTER_CTRL", "SCENE_MONSTER_DRAW");
 }
示例#13
0
 public void createCamera(lgGDBase cameraCtrl)
 {
     this.createSceneObjectPair(cameraCtrl, "SCENE_CAMERA_CTRL", "SCENE_CAMERA_DRAW");
 }
示例#14
0
 public void createMainAvatarObject(lgGDBase avatarCtrl)
 {
     this.createSceneObjectPair(avatarCtrl, "SCENE_MAIN_PLAY_CTRL", "SCENE_MAIN_PLAY_DRAW");
 }
示例#15
0
 public void createMapObject(lgGDBase mapCtrl)
 {
     this.createSceneObjectPair(mapCtrl, "SCENE_MAP_CTRL", "SCENE_MAP_DRAW");
 }
示例#16
0
 public virtual void initLg(lgGDBase lgbase)
 {
 }
示例#17
0
 public void createNPC(lgGDBase npcCtrl)
 {
     this.createSceneObjectPair(npcCtrl, "SCENE_NPC_CTRL", "SCENE_NPC_DRAW");
 }
示例#18
0
 public void setGameCtrl(lgGDBase gct)
 {
     m_gameCtrl = gct;
     onSetGameCtrl();
 }
示例#19
0
 public void setGameCtrl(lgGDBase gct)
 {
     this.m_gameCtrl = gct;
     this.onSetGameCtrl();
 }