mirror of
https://github.com/GTA-ASM/SanAndreasUnity
synced 2025-02-17 05:18:27 +00:00
continue if failed to load cursor texture
This commit is contained in:
parent
c6dea949cf
commit
336db81e51
1 changed files with 12 additions and 8 deletions
|
@ -402,16 +402,20 @@ namespace SanAndreasUnity.Behaviours
|
|||
{
|
||||
|
||||
// Load mouse cursor texture
|
||||
Texture2D mouse = TextureDictionary.Load("fronten_pc").GetDiffuse("mouse",
|
||||
new TextureLoadParams(){makeNoLongerReadable = false}).Texture;
|
||||
Texture2D mouseFix = new Texture2D(mouse.width, mouse.height);
|
||||
F.RunExceptionSafe(() =>
|
||||
{
|
||||
Texture2D mouse = TextureDictionary.Load("fronten_pc").GetDiffuse("mouse",
|
||||
new TextureLoadParams(){makeNoLongerReadable = false}).Texture;
|
||||
Texture2D mouseFix = new Texture2D(mouse.width, mouse.height);
|
||||
|
||||
for (int x = 0; x < mouse.width; x++)
|
||||
for (int y = 0; y < mouse.height; y++)
|
||||
mouseFix.SetPixel(x, mouse.height - y - 1, mouse.GetPixel(x, y));
|
||||
for (int x = 0; x < mouse.width; x++)
|
||||
for (int y = 0; y < mouse.height; y++)
|
||||
mouseFix.SetPixel(x, mouse.height - y - 1, mouse.GetPixel(x, y));
|
||||
|
||||
mouseFix.Apply();
|
||||
Cursor.SetCursor(mouseFix, Vector2.zero, CursorMode.Auto);
|
||||
mouseFix.Apply();
|
||||
|
||||
Cursor.SetCursor(mouseFix, Vector2.zero, CursorMode.Auto);
|
||||
});
|
||||
|
||||
// fist texture
|
||||
Weapon.FistTexture = TextureDictionary.Load("hud").GetDiffuse("fist").Texture;
|
||||
|
|
Loading…
Add table
Reference in a new issue