Unity Cloud Build: Corrupted reffernces. Reimport All Assets possible?

When refferences in scenes or prefabs are missing usually a reimport all fixes all issues, but when those problems occur in a cloud build, that get’s it’s data from a git repository the solution seems much harder. The AssetDatabase API allows for a reimport in a prebuild script:

using UnityEditor; using UnityEditor.Build; using UnityEditor.Build.Reporting;  class Reimporter : IPreprocessBuildWithReport {      public int callbackOrder { get { return 0; } }     public void OnPreprocessBuild(BuildReport report) {         AssetDatabase.ImportAsset("Assets", ImportAssetOptions.ImportRecursive);     } } 

But the UnityEditor libary isn’t accessible in a cloud build. Is there a way to fix missing refferences in a cloud build or trigger a reimport via a pre build script or something similiar?

PS: Local builds after a fresh checkout of the github project do not have this issue, and only Cloud builds suffer from these missing refferences. Maybe someone knows the root of the issue and how to overcome it, so that none of these hacky solutions would be required.

Reading from Streaming Assets in WebGL

I’m trying to set up my Unity game for WebGL, but I quickly found out that you can’t access your streaming assets as you would in a standalone build. For example, I have a code snippet below of how I load in all of my game’s text for localization (i.e. get english translations of all text in my UI).

public void LoadLocalizedText(string fileName) {         localizedText = new Dictionary<string, string>();         // StreamingAssetsPath will always be known to unity, regardless of hardware         string filePath = Path.Combine(Application.streamingAssetsPath, fileName);           if (File.Exists(filePath)) {             string dataAsJson = File.ReadAllText(filePath);              // deserialize text from text to a LocalizationData object             LocalizationData loadedData = JsonUtility.FromJson<LocalizationData>(dataAsJson);              for(int i = 0; i < loadedData.texts.Length; i++) {                 localizedText.Add(loadedData.texts[i].key, loadedData.texts[i].value);             }         }         else {             // ideally would handle this more gracefully, than just throwing an error (e.g. a pop up)             Debug.LogError("Cannot find file");         }                  isReady = true;     } 

I’ve been looking at online examples, and there’s a lot of obsolete examples regarding the use of unity’s WWW class and php. From what I understand the UnityWebRequest is now the way to go, but I’m confused how to use it with regards to the example above. I’m also trying to figure out how to connect to my SQLite database which is also stored in streamingAssets.

        public SqliteHelper(string databaseFileName) {         if (Application.platform == RuntimePlatform.WebGLPlayer) {             // ????????         }         else {             tag = databaseFileName + ":\t";              string dbPath = Path.Combine(Application.streamingAssetsPath, databaseFileName);               if (System.IO.File.Exists(dbPath)) {                 dbConnectionString = "URI=file:" + dbPath;             }             else {                 Debug.Log ("ERROR: the file DB named " + databaseFileName + " doesn't exist anywhere");             }         }     } 

Now that I can’t just open an SqliteConnection, I have no idea if there’s a c# only solution, or if I have to learn php as suggested from tutorials such as this one. If someone could walk me through how to solve either of these problems I would greatly appreciate it.

Random URLs to hide assets [duplicate]

Say I own a domain name www.example.com and I’d like to host some resources on it, but being reasonably hidden from the public.

Since a 256 bits has a sufficiently large entropy to prevent an exhaustive traversal, is it correct to consider any URL from my website that contains a hash, as hidden and secured ?

For example if I want to temporarily host a secret item on the domain, I could simply put it at

  • Crawlers won’t be able to find it
  • Malicious users won’t be able to find it
  • The URL won’t be published anywhere, so search engines won’t index it (kinda linked to point 1)
  • It won’t be in the sitemap

I’m just wondering if there are any practical applications of that kind of scheme in the real world ?

Why are browsers makeing PUT requests for static assets on my site?

Our site hosts static assets at /assets/…. In debugging a font-related issue, I looked through our logs for unusual activity. I found a bunch of requests like these

method path                         referer PUT     /assets/js/40-8b8c.chunk.js https://mysite.com PUT     /assets/fonts/antique.woff2 https://mysite.com/assets/css/mobile-ef45.chunk.css 

The requests come from lots of different IP addresses all over the world. I don’t see any pattern in the User-Agents. The only HTTP methods are HEAD (odd, but fine), GET (expected), and PUT (very suspicious).

I haven’t been able to identify any code in our system that would cause a browser to make PUT requests to these paths.

I have no evidence that this activity is malicious. It could certainly be a broken browser plugin.

Has anyone seen this sort of behavior?

Open sourcing a Unity game with assets

So, I have a goal to make and publish one (small, stupid, simple) game every ~Saturday. (I’ve made two, so far, thanks for asking.) I’ve started in Unity, because it’s convenient. My plan for each game was to have a free version with ads, a paid version without, but also have it open sourced (and if they’re willing to go to the trouble of removing the ads themselves, so be it).

Now, concurrently, I keep wandering into e.g. Humble Bundle, or Unity Asset Store sales, and picking up things I probably don’t need but maybe might use.

It has just occurred to me, though, that if I’m open sourcing these games – I kinda suspect the owners of these assets aren’t going to be happy with me just posting all their files on the internet. Pretty sure I can’t open source assets I’ve purchased.

Now, I could probably just use free assets and make note of where they came from, and everyone would PROBABLY be ok with that. But that significantly restricts the things I can use. (And it would be kindof a waste – you don’t want to know how many ancient untouched game-dev Humble Bundles I’m sitting on, haha.)

Is there some kind of workaround? Like, if I posted the whole project, but included a license stating that only my code was open sourced, and the rest could not be used in anything else, for instance? Anybody know any nice solutions?

Two questions regarding Audio and Assets management in UE

I’ve got an UE project, and I need to play audio coming from a third-party API.

  1. Audio is in LPCM format, each frame is two bytes signed integer with little-endian byte order. How I can play audio chunks in this format inside Unreal Application?
  2. Is it possible to import newly-generated audio during runtime without re-packaging the final project?

How do i protect my game assets as an individual? [duplicate]

This question already has an answer here:

  • Questions on the legal protection of games and their parts (assets, sounds, title) 2 answers
  • How do I protect my game's IP? 2 answers

For my first games, they will be well made, complete, but extremely simple, while i father enough funds to actually fund a game company.

But because I plan on releasing quality content under {insert my name here} Studio (trademark)(c)

and of course all of my games will be superseded by a (c), despite the fact I haven’t even registered anything.

But the real question is, what steps do I need to take to make sure my content does not get stolen while im financially stable enough to file all the paperwork needed to maintain proper copyrights?

I’d also like to release a major title, but I’m scared to, because I know someone is going to try and steal it.

Assets bundles have higher size than uncompressed sprites

I’ve created a script that generates assets bundles by compressing sprites using LZ4 compression. I need this in order to generate smaller files that I’ll download from a server at runtime but after taking a look at those bundles. I’ve found out that they actually have a higher size than the uncompressed sprites. For example, I’ve generated a bundle from three sprites that have a size of 201KB together, but if I take a look at its generated bundle, its size is 300KB. This is only one example, there are other bundles that are 6MB but their original files are only 500KB and that doesn’t make any sense to me. Can someone point me in the right direction?

Exporting assets from iOS and Android

I design both iOS and android apps and use a tool Sympli for developer handoff which is a similar tool like zeplin. I need to know what format should I download assets so that they can be used for both iOS and Android. The core issue I’m trying to figure out is if we can use our same iOS artboard dimensions (375 width, 1x) to generate consumable assets for both iOS AND Android and have those assets match the design specs?