Ejemplo n.º 1
0
        public TesEngine(TesAssetPack asset, TesDataPack data, TesUIManager uiManager)
        {
            _asset                = asset;
            _data                 = data;
            _uiManager            = uiManager;
            _uiManager.Active     = true;
            _temporalLoadBalancer = new TemporalLoadBalancer();
            _cellManager          = new CellManager(asset, data, _temporalLoadBalancer);
            var game = BaseSettings.Game;

            // ambient
            RenderSettings.ambientMode      = UnityEngine.Rendering.AmbientMode.Flat;
            RenderSettings.ambientIntensity = game.AmbientIntensity;

            // sun
            _sunObj = GameObjectUtils.CreateDirectionalLight(Vector3.zero, Quaternion.Euler(new Vector3(50, 330, 0)));
            _sunObj.GetComponent <Light>().shadows = game.RenderSunShadows ? LightShadows.Soft : LightShadows.None;
            _sunObj.SetActive(false);
            if (game.DayNightCycle)
            {
                _sunObj.AddComponent <DayNightCycle>();
            }

            //// water
            //_waterObj = GameObject.Instantiate(TesGame.instance.WaterPrefab);
            //_waterObj.SetActive(false);
            //var water = _waterObj.GetComponent<Water>();
            //water.waterMode = TesGame.instance.WaterQuality;
            //if (!TesGame.instance.WaterBackSideTransparent)
            //{
            //    var side = _waterObj.transform.GetChild(0);
            //    var sideMaterial = side.GetComponent<Renderer>().sharedMaterial;
            //    sideMaterial.SetInt("_SrcBlend", (int)UnityEngine.Rendering.BlendMode.One);
            //    sideMaterial.SetInt("_DstBlend", (int)UnityEngine.Rendering.BlendMode.Zero);
            //    sideMaterial.SetInt("_ZWrite", 1);
            //    sideMaterial.DisableKeyword("_ALPHATEST_ON");
            //    sideMaterial.DisableKeyword("_ALPHABLEND_ON");
            //    sideMaterial.DisableKeyword("_ALPHAPREMULTIPLY_ON");
            //    sideMaterial.renderQueue = -1;
            //}

            Cursor.SetCursor(_asset.LoadTexture("tx_cursor", true), Vector2.zero, CursorMode.Auto);
        }
Ejemplo n.º 2
0
 public TesEngine(IAssetManager assetManager, IAssetPack asset, IDataPack data, TesUIManager uiManager)
     : base(assetManager, asset, data)
 {
     UIManager        = uiManager;
     UIManager.Active = true;
 }
Ejemplo n.º 3
0
 public TesEngine(IAssetManager assetManager, Uri asset, Uri data, TesUIManager uiManager)
     : this(assetManager, assetManager.GetAssetPack(asset).Result, assetManager.GetDataPack(data).Result, uiManager)
 {
 }