Standardize across game templates

So now that I have pulling in the .txt file variables working, I need to tell it which  .txt file to bring in.

So far I’ve done this by adding a gameobject to each scene named & tagged “SceneType”. It has a textmesh component with the rendering turned off, and the name of the .txt file in it.

This way, for any given scene, it can still have the same scripts attached to it, and it finds the correct .txt

Note – I have it done pretty redundantly right now. There are 2-liners pulling this in in the exact same way in the following scripts:

  • GameManager.InitGame()
  • WordDictAdd.SetUp()
  • WordDictAdd.CreateObjects()
  • LoadEasyMode.Propogate()
    • [which, should be noted, should also switch names etc. #todo]
  • GoMenuVowelTeams.MainMenu()
    • [#todo also should change names]

GameManager.InitGame() is my first attempt to make this so it doens’t have to be repeated.

Hmm. So this isn’t working as smoothly as I wanted it to. This might be a good instance to run it by Joao.

A thing I’d also like to know is if making an empty game object with a non-rendered textmesh that tags the scene is the way I’m supposed to do it.

Ooh – apparently there’s multi-scene editing, that sounds nice.  #todo

https://docs.unity3d.com/Manual/MultiSceneEditing.html

Some interesting food for thought around using names and stuff:

  • against:
    • https://akbiggs.silvrback.com/please-stop-using-gameobject-find
  • pro
    • https://www.reddit.com/r/gamedev/comments/3t74w4/unity_devs_should_stop_using_gameobjectfind/

#todo – I could have the same menu scene for everything, but I’m not sure that’s worth it right now. It feels like it would make it hard to make builds and my energy really isn’t going into menu stuff right now. Eventually maybe.

Add in sounds depending on easy/hard mode:

  • right now this mainly happens in GetButtonLevel, where it checks if it has an easy tag, and if so, adds sounds
    • complication: for VowelTeams, answers is always in there. (this could just be a standardized thing I have, where anything tagged answers is always there…)
  • It also happens in GameManager.Awake() so that any scene I start with will have sounds without having to go through the menu

This makes me think I want to have this information embedded into my text file, so that I don’t have to individually specify it every time.

 

Leave a Reply

Your email address will not be published. Required fields are marked *