I can see how I would be able to use this:
Code: Select all
void Start() {
UnityEngine.UI.Text scoreLabel; // Reference to your score UI element.
scoreLabel.text = DialogueLua.GetVariable("Score").AsInt;
}
My question may come from a lack of understanding, but would I need any type of save system like I've seen in tutorials to do this:
1.From my level select scene a UI button is pressed that loads that respective level which is a conversation
2.The conversation is triggered OnStart of that scene
3.The win of a conversation is a condition that is dependent on a score variable which each response has.(If that doesn't make sense here is a link to my hidden values system thread:
viewtopic.php?f=3&t=295)
4.The conversation ends with the player either winning or losing where the last player dialogue selection updates a wins variable on specific player response
5.A game object is set as active that gives the player information if they win or lose this object has a child ui button that goes back to the level select scene onClick.
6.If he/she wins the conversation a text field is updated and this would continue for every single level.
7. The level button that was pressed is now grayed out and cannot be selected again.
I may be able to use a loop in the start or update method IF what I think happens doesn't actually happen, but I'm sure you have a better idea than I do. I assume an old scene is destroyed after a new scene is loaded to conserve memory. So, if it does happen do you have any idea what I could do to update a variable so that each time a win is reached in conversation is met in a conversation.
It seems that a single database will share variables, so would a different conversation change those values? Because I'm looking to have my score reset at the start of each conversation and my wins to carry over in order to update that variable correctly.
Also, I can't thank you enough for your help. If there is anything I can do!!! I brag on your product in my game dev class, and will leave a great review in the assets store, but you guys have been saviors!!!