Skip to content

Commit

Permalink
[Fix] UI hotfix (guilhermelhr#113)
Browse files Browse the repository at this point in the history
* Reapply sprites to ui elements, fix escape menu, change grid selector material, some other general fixes

* Fix char creation scene

* Change logic so we only load the map when the desired map is different than current, but reposition character either way

* Do not add billboard if warp
  • Loading branch information
Danil0v3s committed Oct 18, 2022
1 parent 672a294 commit a64fe25
Show file tree
Hide file tree
Showing 51 changed files with 181,041 additions and 66,762 deletions.
2,438 changes: 1 addition & 2,437 deletions UnityClient/Assets/AddressableAssetsData/AssetGroups/Effects.asset

Large diffs are not rendered by default.

218,468 changes: 165,176 additions & 53,292 deletions UnityClient/Assets/AddressableAssetsData/AssetGroups/Textures.asset

Large diffs are not rendered by default.

64 changes: 64 additions & 0 deletions UnityClient/Assets/AddressableAssetsData/link.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,64 @@
<linker>
<assembly fullname="Unity.Addressables, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null" preserve="all">
<type fullname="UnityEngine.AddressableAssets.Addressables" preserve="all" />
</assembly>
<assembly fullname="Unity.RenderPipelines.Universal.Runtime, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null">
<type fullname="UnityEngine.Rendering.Universal.UniversalAdditionalLightData" preserve="all" />
</assembly>
<assembly fullname="Unity.ResourceManager, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null" preserve="all">
<type fullname="UnityEngine.ResourceManagement.ResourceProviders.AssetBundleProvider" preserve="all" />
<type fullname="UnityEngine.ResourceManagement.ResourceProviders.BundledAssetProvider" preserve="all" />
<type fullname="UnityEngine.ResourceManagement.ResourceProviders.InstanceProvider" preserve="all" />
<type fullname="UnityEngine.ResourceManagement.ResourceProviders.LegacyResourcesProvider" preserve="all" />
<type fullname="UnityEngine.ResourceManagement.ResourceProviders.SceneProvider" preserve="all" />
</assembly>
<assembly fullname="UnityEditor.CoreModule, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null">
<type fullname="UnityEditor.Audio.AudioMixerSnapshotController" preserve="all" />
</assembly>
<assembly fullname="UnityEngine.AudioModule, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null">
<type fullname="UnityEngine.Audio.AudioMixer" preserve="all" />
<type fullname="UnityEngine.Audio.AudioMixerGroup" preserve="all" />
<type fullname="UnityEngine.AudioClip" preserve="all" />
<type fullname="UnityEngine.AudioSource" preserve="all" />
</assembly>
<assembly fullname="UnityEngine.CoreModule, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null">
<type fullname="UnityEngine.GameObject" preserve="all" />
<type fullname="UnityEngine.Light" preserve="all" />
<type fullname="UnityEngine.Material" preserve="all" />
<type fullname="UnityEngine.Mesh" preserve="all" />
<type fullname="UnityEngine.MeshFilter" preserve="all" />
<type fullname="UnityEngine.MeshRenderer" preserve="all" />
<type fullname="UnityEngine.Object" preserve="all" />
<type fullname="UnityEngine.Shader" preserve="all" />
<type fullname="UnityEngine.Sprite" preserve="all" />
<type fullname="UnityEngine.SpriteRenderer" preserve="all" />
<type fullname="UnityEngine.TextAsset" preserve="all" />
<type fullname="UnityEngine.Texture2D" preserve="all" />
<type fullname="UnityEngine.Transform" preserve="all" />
</assembly>
<assembly fullname="UnityEngine.PhysicsModule, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null">
<type fullname="UnityEngine.MeshCollider" preserve="all" />
</assembly>
<assembly fullname="UnityRO, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null">
<type fullname="Assets.Scripts.Renderer.Map.GameMap" preserve="all" />
<type fullname="Assets.Scripts.Renderer.Map.WaterRenderer" preserve="all" />
<type fullname="Assets.Scripts.Renderer.Sprite.SpriteData" preserve="all" />
<type fullname="LightContainer" preserve="all" />
<type fullname="NodeAnimation" preserve="all" />
<type fullname="NodeProperties" preserve="all" />
<type fullname="PathFinder" preserve="all" />
<type fullname="Models/AnimProperties" preserve="nothing" serialized="true" />
<type fullname="Altitude" preserve="nothing" serialized="true" />
<type fullname="PathNode" preserve="nothing" serialized="true" />
</assembly>
<assembly fullname="UnityRO.io">
<type fullname="ROIO.Models.FileTypes.ACT" preserve="nothing" serialized="true" />
<type fullname="ROIO.Models.FileTypes.ACT/Action" preserve="nothing" serialized="true" />
<type fullname="ROIO.Models.FileTypes.ACT/Frame" preserve="nothing" serialized="true" />
<type fullname="ROIO.Models.FileTypes.ACT/Layer" preserve="nothing" serialized="true" />
<type fullname="ROIO.Models.FileTypes.GAT" preserve="nothing" serialized="true" />
<type fullname="ROIO.Models.FileTypes.GAT/Cell" preserve="nothing" serialized="true" />
<type fullname="ROIO.Models.FileTypes.RSW/LightInfo" preserve="nothing" serialized="true" />
<type fullname="ROIO.Models.FileTypes.RSW/WaterInfo" preserve="nothing" serialized="true" />
</assembly>
</linker>
7 changes: 7 additions & 0 deletions UnityClient/Assets/AddressableAssetsData/link.xml.meta

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

71 changes: 64 additions & 7 deletions UnityClient/Assets/Editor/DataUtility.cs
Original file line number Diff line number Diff line change
Expand Up @@ -91,12 +91,27 @@ private static void MakeTexturesReadable() {
}

var path = texturesPaths[i];
var tImporter = AssetImporter.GetAtPath(path) as TextureImporter;
if (tImporter != null) {
tImporter.textureType = TextureImporterType.Default;
tImporter.isReadable = true;
AssetDatabase.ImportAsset(path);
var importer = AssetImporter.GetAtPath(path) as TextureImporter;
if (importer == null) {
continue;
}

if (path.IndexOf("유저인터페이스") > -1) { //make everything under the interface path be a sprite
importer.textureType = TextureImporterType.Sprite;
importer.spriteImportMode = SpriteImportMode.Single;
var textureSettings = new TextureImporterSettings();
importer.ReadTextureSettings(textureSettings);
textureSettings.spriteMeshType = SpriteMeshType.FullRect;
textureSettings.spritePixelsPerUnit = SPR.PIXELS_PER_UNIT;

importer.SetTextureSettings(textureSettings);
} else {
importer.textureType = TextureImporterType.Default;
importer.isReadable = true;
}

AssetDatabase.ImportAsset(path);
//importer.SaveAndReimport(); //perhaps this has better effect?
}

} finally {
Expand Down Expand Up @@ -268,11 +283,53 @@ static void ExtractSprites() {
}
}

[MenuItem("UnityRO/Utils/Fix interface textures")]
static void FixInterfaceTextures() {
var paths = GetFilesFromDir(Path.Combine("Assets", "_Generated", "AddressablesAssets", "data", "texture", "유저인터페이스"))
.Where(it => Path.GetExtension(it) == ".png")
.ToList();
Debug.Log(paths.Count);
AssetDatabase.StartAssetEditing();

for (var i = 0; i < paths.Count; i++) {
var progress = i * 1f / paths.Count;
if (EditorUtility.DisplayCancelableProgressBar("UnityRO", $"Post processing UI textures {i} of {paths.Count}\t\t{progress * 100}%", progress)) {
break;
}

try {
var texturePath = paths[i];

TextureImporter importer = AssetImporter.GetAtPath(texturePath) as TextureImporter;

if (importer == null) {
continue;
}

importer.textureType = TextureImporterType.Sprite;
importer.spriteImportMode = SpriteImportMode.Single;
var textureSettings = new TextureImporterSettings();
importer.ReadTextureSettings(textureSettings);
textureSettings.spriteMeshType = SpriteMeshType.FullRect;
textureSettings.spritePixelsPerUnit = SPR.PIXELS_PER_UNIT;

importer.SetTextureSettings(textureSettings);
importer.SaveAndReimport();

} catch (Exception ex) {
Debug.LogError($"Failed post processing sprite {ex}");
}
}

AssetDatabase.StopAssetEditing();
AssetDatabase.Refresh();
}

[MenuItem("UnityRO/Utils/Fix Sprites PixelsPerUnit")]
static void FixSpritePixelsPerUnit() {
var paths = GetFilesFromDir(Path.Combine("Assets", "_Generated", "AddressablesAssets", "data", "sprite"))
.Where(it => Path.GetExtension(it) == ".png")
.ToList();
.Where(it => Path.GetExtension(it) == ".png")
.ToList();

AssetDatabase.StartAssetEditing();

Expand Down
24 changes: 12 additions & 12 deletions UnityClient/Assets/Resources/Materials/GridSelectorMaterial.mat
Original file line number Diff line number Diff line change
Expand Up @@ -7,14 +7,13 @@ Material:
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_Name: GridSelectorMaterial
m_Shader: {fileID: 4800000, guid: 8d2bb70cbf9db8d4da26e15b26e74248, type: 3}
m_Parent: {fileID: 0}
m_ModifiedSerializedProperties: 0
m_Name: Cursor material
m_Shader: {fileID: 4800000, guid: 650dd9526735d5b46b79224bc6e94025, type: 3}
m_ValidKeywords:
- _SURFACE_TYPE_TRANSPARENT
m_InvalidKeywords: []
m_LightmapFlags: 4
m_InvalidKeywords:
- _EMISSION
m_LightmapFlags: 0
m_EnableInstancingVariants: 0
m_DoubleSidedGI: 0
m_CustomRenderQueue: 3000
Expand All @@ -23,7 +22,6 @@ Material:
disabledShaderPasses:
- SHADOWCASTER
- DepthOnly
m_LockedProperties:
m_SavedProperties:
serializedVersion: 3
m_TexEnvs:
Expand All @@ -32,7 +30,7 @@ Material:
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _BaseMap:
m_Texture: {fileID: 0}
m_Texture: {fileID: 2800000, guid: d0cb1f99f6b589340b4a7a8c3e73d660, type: 3}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _BumpMap:
Expand All @@ -56,7 +54,7 @@ Material:
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _MainTex:
m_Texture: {fileID: 0}
m_Texture: {fileID: 2800000, guid: d0cb1f99f6b589340b4a7a8c3e73d660, type: 3}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _MetallicGlossMap:
Expand Down Expand Up @@ -93,6 +91,7 @@ Material:
- _AlphaClip: 0
- _Blend: 0
- _BlendModePreserveSpecular: 0
- _BlendOp: 0
- _BumpScale: 1
- _Cull: 2
- _Cutoff: 0.5
Expand All @@ -101,7 +100,7 @@ Material:
- _DstBlendAlpha: 10
- _EnableExternalAlpha: 0
- _GlossMapScale: 1
- _Glossiness: 0.5
- _Glossiness: 0
- _GlossinessSource: 0
- _GlossyReflections: 1
- _Metallic: 0
Expand All @@ -110,6 +109,7 @@ Material:
- _Parallax: 0.02
- _QueueOffset: 0
- _ReceiveShadows: 1
- _SampleGI: 0
- _Shininess: 0
- _Smoothness: 0.5
- _SmoothnessSource: 1
Expand All @@ -122,8 +122,8 @@ Material:
- _UVSec: 0
- _ZWrite: 0
m_Colors:
- _BaseColor: {r: 1, g: 1, b: 1, a: 1}
- _Color: {r: 1, g: 1, b: 1, a: 1}
- _BaseColor: {r: 0.19607843, g: 0.9411765, b: 0.627451, a: 0.6}
- _Color: {r: 0.19607843, g: 0.9411765, b: 0.627451, a: 0.6}
- _EmissionColor: {r: 0, g: 0, b: 0, a: 1}
- _Flip: {r: 1, g: 1, b: 1, a: 1}
- _RendererColor: {r: 1, g: 1, b: 1, a: 1}
Expand Down
51 changes: 47 additions & 4 deletions UnityClient/Assets/Resources/Prefabs/UI/Base UI/Title Bar.prefab
Original file line number Diff line number Diff line change
Expand Up @@ -174,7 +174,7 @@ RectTransform:
m_AnchorMin: {x: 0, y: 0}
m_AnchorMax: {x: 0, y: 0}
m_AnchoredPosition: {x: 0, y: 0}
m_SizeDelta: {x: 280, y: 17}
m_SizeDelta: {x: 4, y: 4}
m_Pivot: {x: 0.5, y: 0.5}
--- !u!222 &4488207167407215328
CanvasRenderer:
Expand Down Expand Up @@ -204,7 +204,7 @@ MonoBehaviour:
m_OnCullStateChanged:
m_PersistentCalls:
m_Calls: []
m_Texture: {fileID: 0}
m_Texture: {fileID: 2800000, guid: f81cbb789c5a1944ab7f4932c4ed102b, type: 3}
m_UVRect:
serializedVersion: 2
x: 0
Expand All @@ -228,7 +228,7 @@ MonoBehaviour:
m_Name:
m_EditorClassIdentifier:
backgroundTexture:
m_AssetGUID: c4fdfcb7f27938d4db895e0e68974aaf
m_AssetGUID: f81cbb789c5a1944ab7f4932c4ed102b
m_SubObjectName:
m_SubObjectType:
m_EditorAssetChanged: 1
Expand All @@ -247,6 +247,11 @@ MonoBehaviour:
m_SubObjectName:
m_SubObjectType:
m_EditorAssetChanged: 0
selectedTexture:
m_AssetGUID:
m_SubObjectName:
m_SubObjectType:
m_EditorAssetChanged: 0
--- !u!1 &6717209028481905461
GameObject:
m_ObjectHideFlags: 0
Expand All @@ -258,6 +263,7 @@ GameObject:
- component: {fileID: 1197572939405240879}
- component: {fileID: 3065185638508268547}
- component: {fileID: 4350510912719786228}
- component: {fileID: 394475483406334634}
m_Layer: 5
m_Name: Image
m_TagString: Untagged
Expand Down Expand Up @@ -313,7 +319,7 @@ MonoBehaviour:
m_OnCullStateChanged:
m_PersistentCalls:
m_Calls: []
m_Texture: {fileID: 0}
m_Texture: {fileID: 2800000, guid: 2eabc9331481fb343919ab86fd1df510, type: 3}
m_UVRect:
serializedVersion: 2
x: 0
Expand All @@ -324,3 +330,40 @@ MonoBehaviour:
hoverImage: basic_interface/sys_base_on.bmp
pressedImage:
overrideSize: 1
--- !u!114 &394475483406334634
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 6717209028481905461}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: 9e34c3bdadc99c745ace4e0a15cb1437, type: 3}
m_Name:
m_EditorClassIdentifier:
backgroundTexture:
m_AssetGUID: 2eabc9331481fb343919ab86fd1df510
m_SubObjectName:
m_SubObjectType:
m_EditorAssetChanged: 1
hoverTexture:
m_AssetGUID: 6276e38e62846aa4fb56a2d98c491e78
m_SubObjectName:
m_SubObjectType:
m_EditorAssetChanged: 1
pressedTexture:
m_AssetGUID:
m_SubObjectName:
m_SubObjectType:
m_EditorAssetChanged: 0
disabledTexture:
m_AssetGUID:
m_SubObjectName:
m_SubObjectType:
m_EditorAssetChanged: 0
selectedTexture:
m_AssetGUID:
m_SubObjectName:
m_SubObjectType:
m_EditorAssetChanged: 0
15 changes: 10 additions & 5 deletions UnityClient/Assets/Resources/Prefabs/UI/CharacterCell.prefab
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,7 @@ RectTransform:
m_AnchorMin: {x: 0, y: 0}
m_AnchorMax: {x: 0, y: 0}
m_AnchoredPosition: {x: 0, y: 0}
m_SizeDelta: {x: 0, y: 0}
m_SizeDelta: {x: 4, y: 4}
m_Pivot: {x: 0.5, y: 0.5}
--- !u!222 &4032596202115033326
CanvasRenderer:
Expand Down Expand Up @@ -162,7 +162,7 @@ MonoBehaviour:
m_OnCullStateChanged:
m_PersistentCalls:
m_Calls: []
m_Texture: {fileID: 0}
m_Texture: {fileID: 2800000, guid: 1fd4c49c990e36f4ca87cbd7410ae038, type: 3}
m_UVRect:
serializedVersion: 2
x: 0
Expand All @@ -186,17 +186,17 @@ MonoBehaviour:
m_Name:
m_EditorClassIdentifier:
backgroundTexture:
m_AssetGUID: c61bc4efb15ee094d8dfda040e108b78
m_AssetGUID: 1fd4c49c990e36f4ca87cbd7410ae038
m_SubObjectName:
m_SubObjectType:
m_EditorAssetChanged: 1
hoverTexture:
m_AssetGUID: faf4a43a16b072a41998e684bc2b7e33
m_AssetGUID: b5b7969815c9a0e429027af2de4207d1
m_SubObjectName:
m_SubObjectType:
m_EditorAssetChanged: 1
pressedTexture:
m_AssetGUID: c0e05c7ccf032584ea3088ceafe2c1f2
m_AssetGUID: 57ec5c652ff32ed4f9439994e0811aa6
m_SubObjectName:
m_SubObjectType:
m_EditorAssetChanged: 1
Expand All @@ -205,3 +205,8 @@ MonoBehaviour:
m_SubObjectName:
m_SubObjectType:
m_EditorAssetChanged: 0
selectedTexture:
m_AssetGUID:
m_SubObjectName:
m_SubObjectType:
m_EditorAssetChanged: 0
Loading

0 comments on commit a64fe25

Please sign in to comment.