public override void Show(string assetName) { base.Show(assetName); EngineRef.SetViewsControlsEnabled(false, false, false, false, false); EngineRef.CameraEntity.GetComponent <Transform>().SetTransformations(new Vector3(0f, 0, -2f), Quaternion.RotationYawPitchRoll(MathUtil.Pi, 0, 0)); PreviewEntity.SetActive(true); EngineRef.ECSWorld.Refresh(); Texture2DAsset asset = AssetsManagerInstance.GetManager().LoadAsset <Texture2DAsset>(assetName); ratio = (float)asset.Data.Width / asset.Data.Height; Vector3 scale; if (ratio >= 1) { scale = (Vector3.Right + Vector3.Up / ratio) * 3.85f; } else { scale = (Vector3.Right + Vector3.Up * ratio) * 3.85f; } scale += Vector3.ForwardLH * 0.1f; PreviewEntity.GetComponent <Transform>().Scale = scale; TestMaterial.AlbedoMapAsset = assetName; }
public override void Show(string assetName) { base.Show(assetName); EngineRef.SetViewsControlsEnabled(true, true, true, false, true); EngineRef.CameraEntity.GetComponent <Transform>().SetTransformations(new Vector3(0f, 0, -1.5f), Quaternion.RotationYawPitchRoll(MathUtil.Pi, 0, 0)); RendererComponent.SetMaterial(AssetsLoader.LoadMaterialInfo(assetName)); PreviewEntity.SetActive(true); EngineRef.ECSWorld.Refresh(); }