public BaseEngine(IAssetManager assetManager, IAssetPack asset, IDataPack data) { AssetManager = assetManager; Asset = asset; Data = data; LoadBalancer = new TemporalLoadBalancer(); CellManager = assetManager.GetCellManager(asset, data, LoadBalancer); 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 = game.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", 1), Vector2.zero, CursorMode.Auto); }
public MorrowindEngine(MorrowindDataReader mwDataReader, UIManager uiManager) { Debug.Assert(instance == null); instance = this; dataReader = mwDataReader; textureManager = new TextureManager(dataReader); materialManager = new MaterialManager(textureManager); nifManager = new NIFManager(dataReader, materialManager); temporalLoadBalancer = new TemporalLoadBalancer(); cellManager = new CellManager(dataReader, textureManager, nifManager, temporalLoadBalancer); RenderSettings.ambientMode = UnityEngine.Rendering.AmbientMode.Flat; RenderSettings.ambientIntensity = TESUnity.instance.ambientIntensity; sunObj = GameObjectUtils.CreateDirectionalLight(Vector3.zero, Quaternion.Euler(new Vector3(50, 330, 0))); sunObj.GetComponent <Light>().shadows = TESUnity.instance.renderSunShadows ? LightShadows.Soft : LightShadows.None; sunObj.SetActive(false); waterObj = GameObject.Instantiate(TESUnity.instance.waterPrefab); waterObj.SetActive(false); if (!TESUnity.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(textureManager.LoadTexture("tx_cursor", true), Vector2.zero, CursorMode.Auto); _uiManager = uiManager; _uiManager.Active = true; }
public static ICellManager GetUltimaCellManager(this TemporalLoadBalancer loadBalancer, IAssetPack assetPack, IDataPack dataPack, Func <object> func = null) => new UltimaCellManager(loadBalancer, (UltimaAssetPack)assetPack, (UltimaDataPack)dataPack);
public CellManager(MorrowindDataReader dataReader, TextureManager textureManager, NIFManager nifManager, TemporalLoadBalancer temporalLoadBalancer) { this.dataReader = dataReader; this.textureManager = textureManager; this.nifManager = nifManager; this.temporalLoadBalancer = temporalLoadBalancer; }
public static ICellManager GetTesCellManager(this TemporalLoadBalancer loadBalancer, IAssetPack assetPack, IDataPack dataPack, Func <object> func = null) => new TesCellManager(loadBalancer, (TesAssetPack)assetPack, (TesDataPack)dataPack);
public UltimaCellManager(UltimaAssetPack asset, UltimaDataPack data, TemporalLoadBalancer loadBalancer) { _asset = asset; _data = data; _loadBalancer = loadBalancer; }
public TesCellManager(TesAssetPack asset, TesDataPack data, TemporalLoadBalancer loadBalancer) { _asset = asset; _data = data; _loadBalancer = loadBalancer; }
public TesCellManager(TemporalLoadBalancer loadBalancer, TesAssetPack assetPack, TesDataPack dataPack) { _loadBalancer = loadBalancer; _assetPack = assetPack; _dataPack = dataPack; }
public UltimaCellManager(TemporalLoadBalancer loadBalancer, UltimaAssetPack assetPack, UltimaDataPack dataPack) { _loadBalancer = loadBalancer; _assetPack = assetPack; _dataPack = dataPack; }
public ICellManager GetCellManager(IAssetPack asset, IDataPack data, TemporalLoadBalancer loadBalancer) { return(new UltimaCellManager((UltimaAssetPack)asset, (UltimaDataPack)data, loadBalancer)); }
public ICellManager GetCellManager(IAssetPack asset, IDataPack data, TemporalLoadBalancer temporalLoadBalancer) { throw new NotImplementedException(); }
public ICellManager GetCellManager(IAssetPack asset, IDataPack data, TemporalLoadBalancer loadBalancer) { return(new TesCellManager((TesAssetPack)asset, (TesDataPack)data, loadBalancer)); }