1 Scene INFINITE Levels by Spawning Levels from ScriptableObject Data at Runtime | Unity Tutorial

แชร์
ฝัง
  • เผยแพร่เมื่อ 22 ธ.ค. 2024

ความคิดเห็น • 13

  • @captainnoyaux
    @captainnoyaux 3 หลายเดือนก่อน +3

    I did the same for my solitaire levels and used LevelSO too, naming right 🤣.
    Super interesting usage, thanks for sharing !

    • @LlamAcademy
      @LlamAcademy  3 หลายเดือนก่อน +1

      💪 great name IMO 🤣

  • @mehmedcavas3069
    @mehmedcavas3069 3 หลายเดือนก่อน +4

    you just have to be carefully not have references to the scene. let say there are 1000 levels and every level have its own prefab and u drag them to a field on the So. and if the so is referenced in the scene, then all the prefabs will be loaded into the ram and this can cause some issues. I dont have any refence to the SOs and load them by name (index)

  • @geri4367
    @geri4367 3 หลายเดือนก่อน +1

    Great stuff :)
    It just came to mind, did you show how you solved the strange collision "glitches" where the ball collides with perfectly aligned cube colliders?

    • @LlamAcademy
      @LlamAcademy  3 หลายเดือนก่อน +1

      Coming up next 🙂

  • @MXMLLN
    @MXMLLN 27 วันที่ผ่านมา

    Did you invent this technique? I have been implementing it for my next generation Brick Breaker mobile game and haven't been able to find a single other example like this.
    What can I search for to find other examples? I would have assumed that many 2d puzzle games would use this paradigm, especially Match 3.

    • @LlamAcademy
      @LlamAcademy  26 วันที่ผ่านมา

      "Invent"... I don't think so 😅. It's basically a trimmed down version of what Unity does already with the scenes. We're only storing the relevant information that we need to rebuild the level at runtime. I don't have other resources handy for similar implementation :(

  • @MXMLLN
    @MXMLLN 27 วันที่ผ่านมา

    So all the Levels in the Holes Menu had their respective SO manually dragged into the main Level Data SO? They're not dynamically populated?

    • @LlamAcademy
      @LlamAcademy  27 วันที่ผ่านมา +1

      Yes I dragged them all. You can do a Resources.Load or do asset bundles if you’d like.

    • @MXMLLN
      @MXMLLN 26 วันที่ผ่านมา

      Thanks for the prompt reply! I've never had a famous TH-camr be so generous 🙂

    • @MXMLLN
      @MXMLLN 26 วันที่ผ่านมา

      I currently use Resources.Load, but it doesn't work in the Builds. Is it only a prototyping feature?

    • @LlamAcademy
      @LlamAcademy  24 วันที่ผ่านมา

      Resources.Load should work if you have all of your levels in a "Resources" folder. It's a little bit finnicky to make it work properly sometimes. I always have to try it with and without the file extension because I forget the way it wants it to work.

    • @LlamAcademy
      @LlamAcademy  24 วันที่ผ่านมา

      I'm sorry, I accidentally lied to you earlier. I am using Resources.LoadAll(). You can see that here: github.com/llamacademy/minigolf/blob/main/Assets/LlamAcademy/Minigolf/UI/MainMenu.cs