Beispiel #1
0
        //初始化
        public void Init(System.Action initedCallback)
        {
            if (gridUnitModel == null ||
                gridUnitsRoot == null ||
                battleUnitModel == null ||
                battleUnitsRoot == null)
            {
                UtilityHelper.LogError("Init battle field renderer failed!");
                return;
            }

            //初始化Helper
            manualOperationHelper = new BattleFieldManualOperationHelper(this);

            UtilityHelper.Log("Init battle field renderer.");

            //创建一定数量的格子和战斗单位渲染器,留作后面使用
            InitGridUnitRenderer(100);
            InitBattleUnitRenderer(10);

            UtilityHelper.Log("Battle field renderer inited.");

            //战场显示器初始化完成,通知回调
            if (initedCallback != null)
            {
                initedCallback();
            }
        }
        private bool touch_0_valid = false;                             //第一次触碰是否有效

        //初始化
        public void Init()
        {
            if (gridUnitsRoot == null || battleUnitsRoot == null)
            {
                UtilityHelper.LogError("Init battle field renderer failed!");
                return;
            }

            //初始化Helper
            manualOperationHelper = new BattleFieldManualOperationHelper(this);

            //创建一定数量的格子和战斗单位渲染器,留作后面使用
            InitGridUnitRenderer(100);
            InitBattleUnitRenderer(10);

            BattleManager.Instance.MgrLog("Battle field renderer inited.");

            //战场显示器初始化完成,通知回调
            EventManager.Instance.Run(EGameConstL.EVENT_BATTLE_FIELD_RENDERER_READY, null);
        }