public void OnLoadSucc(string source, UnityObject unityObj)
        {
            SingletonManager.Get <SubProgressBlackBoard>().Step();
            var manager = new InputManager();

            if (!_inputContext.hasUserInputManager)
            {
                var helper = new UserInputHelper(manager);
                _inputContext.SetUserInputManager(manager, helper);
            }
            {
                var cfg = unityObj.As <TextAsset>();
                if (null != cfg)
                {
                    var content  = cfg.text;
                    var inputCfg = InputConfigLoader <InputConfig> .Load(content);

                    _inputContext.userInputManager.Instance.SetConfig(inputCfg);
                }
                else
                {
                    Logger.Error("Cfg is null or not text asset");
                }
            }
            _sessionState.FullfillExitCondition(typeof(InputConfigInitSystem));
        }
Beispiel #2
0
        public void OnLoadSucc(string source, UnityObject unityObj)
        {
            var assetInfo = unityObj.Address;
            var asset     = unityObj.As <TextAsset>();

            if (null == asset)
            {
                Logger.ErrorFormat("Asset {0}:{1} Load Fialed ", assetInfo.BundleName, assetInfo.AssetName);
                return;
            }

            _cfg = asset.text;
            if (null == _parser)
            {
                Logger.ErrorFormat("instance to parse config {0} is null ", typeof(T));
                return;
            }

            Logger.InfoFormat("ParseConfig {0}:{1}", assetInfo.BundleName, assetInfo.AssetName);
            if (forceMainThread == false)
            {
                ThreadPool.QueueUserWorkItem(ParseConfig, this);
            }
            else
            {
                ParseConfig();
            }

            SingletonManager.Get <SubProgressBlackBoard>().Step();
        }
Beispiel #3
0
        public void OnLoadSucc(object source, UnityObject unityObj)
        {
            var assetInfo = unityObj.Address;

            if (source is Image)
            {
                Texture2D tex    = unityObj.As <Texture2D>();
                Sprite    sprite = Sprite.Create(tex, new Rect(0, 0, tex.width, tex.height), Vector2.zero, 100, 0, SpriteMeshType.FullRect);
                ReturnGameObject(sprite, assetInfo);
            }
            else if (source is RawImage)
            {
                ReturnGameObject(unityObj.As <Texture>(), assetInfo);
            }

            SetTexture(source, cache[assetInfo.BundleName][assetInfo.AssetName].Dequeue());
        }
Beispiel #4
0
 protected override void OnLoadSuccImpl(UnityObject unityObj)
 {
     if (unityObj.AsObject != null)
     {
         var asset = unityObj.As <ShaderVariantCollection>();
         _logger.InfoFormat("ShaderVariantCollection:{0}, {1}", asset, unityObj.AsObject.GetType());
         if (null != asset)
         {
             asset.WarmUp();
         }
     }
 }
        private void OnOCDataLoaded(string source, UnityObject unityObj)
        {
            var ocData = unityObj.As <TextAsset>();

            _ocParam.OCData = ocData == null ? null : ocData.bytes;

            var ocController = OcclisionCullingControllerFactory.CreateController(_levelType, _ocParam);

            _contexts.session.clientSessionObjects.OCController = ocController;

            _sessionState.FullfillExitCondition(typeof(InitOcclusionCullingControllerSystem));
        }
 public void OnLoadSucc(string source, UnityObject unityObj)
 {
     {
         var asset = unityObj.As <Material>();
         if (null == asset)
         {
             return;
         }
         _contexts.player.flagSelfEntity.throwingLine.Go.GetComponent <MeshRenderer>().material = asset;
         _assetLoaded = true;
     }
 }
        public void OnLoadSucc(string source, UnityObject unityObj)
        {
            _logger.DebugFormat("OnLoadSucc {0} ", unityObj.Address);
            TextAsset asset = unityObj.As <TextAsset>();

            if (asset == null)
            {
                _logger.Error("Null animation config for equipment");
            }
            else
            {
                ParseAnimationConfig(asset.text);
            }
            ParseComplete();
        }
Beispiel #8
0
        protected override void OnLoadSuccImpl(UnityObject unityObj)
        {
            var asset = unityObj.As <TextAsset>();

            if (null != asset)
            {
                var config = XmlConfigParser <SpeedCurveConfig> .Load(asset.text);

                SingletonManager.Get <CharacterStateConfigManager>().AirMoveCurve = config.AirMoveCurve.toCurve();
                List <MovementCurveInfo> movementCurve = new List <MovementCurveInfo>();
                foreach (var info in config.MovementCurveInfos)
                {
                    movementCurve.Add(info.ToMovementCurveInfo());
                }
                SingletonManager.Get <CharacterStateConfigManager>().MovementCurve = movementCurve;
            }
        }
Beispiel #9
0
        public void LoadedTerrainData(Object obj, UnityObject asset)
        {
            --_loadingDataCount;

            var terrainName = asset.Address.AssetName;
            var data        = asset.As <TextAsset>();

            if (data == null)
            {
                if (_cachedTerrain.ContainsKey(terrainName))
                {
                    var terrainData = _cachedTerrain[terrainName].terrainData;
                    var heightMap   = terrainData.GetHeights(0, 0, terrainData.heightmapResolution,
                                                             terrainData.heightmapResolution);

                    if (!_detailManager.TerrainLoaded(_cachedTerrain[terrainName], _cachedDetailDist[terrainName],
                                                      _minPosMap[terrainName], heightMap))
                    {
                        logger.ErrorFormat("{0} will not have grass", terrainName);
                    }

//                    if (!_treeManager.TerrainLoaded(_cachedTerrain[terrainName], _cachedTreeDist[terrainName],
//                        _minPosMap[terrainName], heightMap))
//                        logger.ErrorFormat("{0} will not have tree", terrainName);
                }
                else
                {
                    logger.ErrorFormat("wrong loaded terraindata name: {0}", terrainName);
                }
            }
            else
            {
                if (_cachedTerrain.ContainsKey(terrainName))
                {
                    if (!_detailManager.TerrainLoaded(data, _cachedTerrain[terrainName], _cachedDetailDist[terrainName],
                                                      _minPosMap[terrainName]))
                    {
                        logger.ErrorFormat("{0} will not have grass", terrainName);
                    }

//                    if (!_treeManager.TerrainLoaded(data, _cachedTerrain[terrainName], _cachedTreeDist[terrainName],
//                        _minPosMap[terrainName]))
//                        logger.ErrorFormat("{0} will not have tree", terrainName);
                }
            }
        }
Beispiel #10
0
        public void OnLoadSucc(string source, UnityObject unityObj)
        {
            var assetInfo = unityObj.Address;
            var obj       = unityObj.As <TextAsset>();

            foreach (var cfg in _configs)
            {
                if (assetInfo.AssetName.Equals(cfg.Asset))
                {
                    if (null != cfg.OnReload)
                    {
                        cfg.OnReload(obj as TextAsset);
                    }
                    else
                    {
                        CommonReload(obj as TextAsset, cfg.Parser);
                    }
                }
            }
        }
Beispiel #11
0
        public void LoadedTerrainData(Object obj, UnityObject asset)
        {
            --_loadingDataCount;

            var terrainName = asset.Address.AssetName;
            var data        = asset.As <TextAsset>();

            if (data == null)
            {
                if (_cachedTerrain.ContainsKey(terrainName))
                {
                    try
                    {
                        if (!_detailManager.TerrainLoaded(_cachedTerrain[terrainName], _cachedDetailDist[terrainName]))
                        {
                            logger.ErrorFormat("unmatch parameter in {0}", terrainName);
                        }
                    }
                    catch (Exception e)
                    {
                        logger.Error(terrainName + "\n" + e.Message + "\n" + e.StackTrace);
                        throw e;
                    }
                }
                else
                {
                    logger.ErrorFormat("wrong loaded terraindata name: {0}", terrainName);
                }
            }
            else
            {
                if (_cachedTerrain.ContainsKey(terrainName))
                {
                    if (!_detailManager.TerrainLoaded(data, _cachedTerrain[terrainName], _cachedDetailDist[terrainName]))
                    {
                        logger.ErrorFormat("unmatch parameter in {0}", terrainName);
                    }
                }
            }
        }
 public void OnLoadSucc(string source, UnityObject unityObj)
 {
     SingletonManager.Get <SubProgressBlackBoard>().Step();
     if (!Luminosity.IO.InputManager.Exists)
     {
         Logger.ErrorFormat("No Luminosity.IO.InputManager exist");
     }
     else
     {
         var cfg = unityObj.As <TextAsset>();
         if (null != cfg)
         {
             var content = cfg.bytes;
             Luminosity.IO.InputManager.Load(content);
         }
         else
         {
             Logger.Error("Cfg is null or not text asset");
         }
     }
     _sessionState.FullfillExitCondition(typeof(InputManagerConfigInitSystem));
 }