Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.
  2. We have updated the language to the Editor Terms based on feedback from our employees and community. Learn more.
    Dismiss Notice
  3. Join us on November 16th, 2023, between 1 pm and 9 pm CET for Ask the Experts Online on Discord and on Unity Discussions.
    Dismiss Notice

[uFrame] ViewModel never initialized

Discussion in 'Scripting' started by SeriousBusinessFace, Sep 17, 2015.

  1. SeriousBusinessFace

    SeriousBusinessFace

    Joined:
    May 10, 2014
    Posts:
    127
    I'm trying to learn uFrame. I watch a bunch of videos, and set up a simple project. A very simple project:
    Simple uFrame Subsystem.jpg

    Anyway, I fill out the BoxElement with a BoxView that looks useful enough for a project this tiny:
    Simple uFrame BoxElement.jpg

    Then set up a GameObject cube:
    Simple uFrame GameObject.jpg

    And start the project. The BoxView tells me this:
    Simple error.jpg

    Calling commands without that set does not work.

    I've deleted and re-compiled the entire uFrame codebase for that a few times while I was working a few bugs out; it shouldn't be a lingering bug.

    Any ideas?

    Note: I know I can't call commands from the view without having bound them. But calling commands is pointless anyway, without a ViewModel. I'll worry about calling commands again once I have a ViewModel.
     
    Last edited: Sep 17, 2015
  2. SeriousBusinessFace

    SeriousBusinessFace

    Joined:
    May 10, 2014
    Posts:
    127
    Some addition information, now that I'm more awake. First, "InitializeViewModel" is never called. I put a "Debug.Log("Test");" statement in there, and "Test" does not appear in the console. Second, I am using version 1.6.2f2.

    Latest results: Bind is not being called; ViewCreated is not being called.

    Ok, so it turned out that what I need is a Kernel, which explained why SceneManager no longer exists. I added a uFrameKernel to a GameObject; now the error I'm getting is "Please add this scene to the build settings." The thing is, this error persists even after I've added the scene to the build settings.
     
    Last edited: Sep 17, 2015
  3. SeriousBusinessFace

    SeriousBusinessFace

    Joined:
    May 10, 2014
    Posts:
    127
    Solved. "Update and Scaffold" to create a scene from uFrame, or populate it manually with the appropriate scripts (I wouldn't recommend this, as it seems rather more work than letting uFrame do it).