GithubHelp home page GithubHelp logo

Comments (3)

felladrin avatar felladrin commented on September 26, 2024

Hi, @phraxjams. Thank you for using unity3d-mvc!

I understand what you're trying to achieve, but it wouldn't fit, and probably won't easily work, with the current implementation of this framework.

The best solution, if you don't want to use GlobalStorage would be:

  1. create a static class to hold your data while your game is running or
  2. create a new mono behavior script that you'd attach to a game object and make that game object don't be destroyed on load scenes. What, in the end, would work like using the GlobalStorage.

That's what's explained on Unity's Writing the Game Manager tutorial.

Using the ModelContainer is not expected by the system, but if you want to do this anyway, you'll need to link the ModelContainer to the Application object from the next scene by listening to the Event SceneManager.activeSceneChanged. So when ModelContainer receives the message that the scene has changed, it would look for the new Application object on scene and reference itself on Application.model attribute. But I've never tried that, so I'm not sure if it would work.

The scene structure is a known problem of this structure, that's why I've started creating unity3d-mvc-2 (not documented yet). It'll allow us to use MVC (or a similar approach) independently from what scene we are.

from unity3d-mvc.

phraxjams avatar phraxjams commented on September 26, 2024

Hi,

Thanks for a detailed response.

Fundamentally, a model should keep the data and in our unity's mvc case we are not keeping it by default and doing workarounds like you suggested. My point is... if we still have to keep the data on an external manager then the only thing left is controller and view and then i start thinking to stop using MVC which i dont want. Yes i will go for a workaround and will see how things will go.

Secondly, Thanks for the mvc-2, it looks promising, i would request you to please spare few minutes and write its brief documentation, i would love to experiment with that, too.

Thanks again

from unity3d-mvc.

felladrin avatar felladrin commented on September 26, 2024

Sure! I'll write a brief documentation for mvc-2 as soon as possible. Thanks for your feedback!

from unity3d-mvc.

Related Issues (1)

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.