question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Replace Texture2D 2020.2.2f1 failed.

See original GitHub issue

The code, repalce one image:

import os
import UnityPy
from PIL import Image

if __name__ == '__main__':
  path = r'./data.unity3d'    
  env = UnityPy.load(path);
  for obj in env.objects:
      if obj.type == "Texture2D":
        data = obj.read();
        target = 'sactx-4-2048x2048-Crunch-Opening-f2cb946e';
        if data.name == target:
            print('save');
            data.image = Image.open(r''+target+'.png')
            data.save();
  open(path + '_2', 'wb').write(env.file.save());
  print('done');

The log:

E/Unity: Could not open file /data/app/r****.t2-hvUp7W4EeakH85PlEo-8Xg==/base.apk/assets/bin/Data/archive:/CAB-UnityPy_Mod.resS for read

 E/Unity: async texture load: failed to load sactx-4-2048x2048-Crunch-Opening-f2cb946e from /data/app/r*****.t2-hvUp7W4EeakH85PlEo-8Xg==/base.apk/assets/bin/Data/archive:/CAB-UnityPy_Mod.resS

UnityPy version : 1.7.6

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Comments:7 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
andrewpediacommented, Jun 17, 2021

same issue

0reactions
keelcommented, Oct 21, 2021

Thanks.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Unity 2020.2.2
Known Issues in 2020.2.2f1. Packman: Unable to filter on downloaded assets (1307862). Input: [Input System] MultiplayerEventSystem throws a ...
Read more >
HDRP Template - Graphics.CopyTexture causes errors when ...
This problem is not an upgrade issue. The 2020.2 branch on the provided repo is actually using "Half Res" quality texture (in Quality...
Read more >
Constant NullReferenceException in GitHub.Unity.Window ...
I'm on 2020.2.2f1 having this same issue. Cannot switch branches and does not give any info as why, so I can only assume...
Read more >
User Guide - ProPixelizer - Google Sites
[Worker0] Texture creation failed. ... 2020.2.1f1 + URP 10.2.22 ... projections the size of an object does not change as it moves within...
Read more >
Installation Failed something went wrong installing unity
Fix Installation Failed something went wrong installing unity .Support me by Thanks Button Under Videofacebook page ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found