Giter Site home page Giter Site logo

Asset loading is a mess about owml HOT 5 CLOSED

ow-mods avatar ow-mods commented on May 24, 2024
Asset loading is a mess

from owml.

Comments (5)

misternebula avatar misternebula commented on May 24, 2024

For example, here is the image loading I used for Marshmallow :
image
Used like this
image = ImageUtilities.LoadImage(Main.helper.Manifest.ModFolderPath + "clouds_cap.png");

from owml.

misternebula avatar misternebula commented on May 24, 2024
  • Meshes : Can still use ObjImporter
  • Textures : Can be simplified (see above)
  • Audio : Unity has no built in methods for audio loading, so WWW has to be used (or something better?)

from owml.

misternebula avatar misternebula commented on May 24, 2024

Basically I want to try removing the OnLoaded stuff that you have to do, and make it just return the wanted asset. However, maybe co-routines are the best option, as they won't hang the program while loading... then again, loading images and meshes should only take a short amount of time (and mods shouldn't really be loading in massive mesh files - that's what asset bundles are for!)

from owml.

amazingalek avatar amazingalek commented on May 24, 2024

image

from owml.

amazingalek avatar amazingalek commented on May 24, 2024

Good comments 👍
Some thoughts:

  • It's important that loading assets happen in separate threads, as otherwise the game would freeze. Coroutines are one way of doing that.
  • Why return textures as part of a gameobject instead of directly? I think I did it that way so the texture would survive when changing scenes - notice the gameobject runs DontDestroyOnLoad().

I agree asset loading deserves an overhaul. We could create an entirely new asset loading project (start from scratch) and deprecate the old one. That'd give us a lot of freedom to re-think it.

from owml.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.