playMaker

Author Topic: GameManager architecture overview question  (Read 486 times)

lists

  • Playmaker Newbie
  • *
  • Posts: 2
    • View Profile
GameManager architecture overview question
« on: July 05, 2016, 08:34:29 PM »
I am hoping someone can explain some of the fundamentals of GameManagers.

I understand their use but have some questions on how to use them across scenes/levels and such.

One of my gaps in understanding:

if I have a core GM object with FSMs that run across all levels do I only need to attach it to the initial scene or replicate it across all scenes to be active?

I do understand that it is used to keep track of events and update global variables such that all other activities and such can take them into account. I also understand they can be triggered by other events.

I have seen them in many examples but still cant get the overall view in my head and the specific do's/don'ts I need to take in to account. I would like to replicate scenes/levels and adjust so need to understand if I need to do anything special with the GM objects.

I the non PlayMaker Unity3d world there is the concept of singleton patterns. Is this taken care of in PlayMaker?

Thanks for any assistance.

shawn

jeanfabre

  • Administrator
  • Hero Member
  • *****
  • Posts: 12342
  • Official Playmaker Support
    • View Profile
Re: GameManager architecture overview question
« Reply #1 on: July 05, 2016, 10:34:03 PM »
Hi,

 Yes, you'll be likely going down the route of singleton, you'll find two actions on the Ecosystem for management singletons.



so

1: use "Dont destroy on load" action to keep your GameManager while switchin levels
2: use "SingletonManager" action this onto your GM, give it a unique reference "GameManager"  will do :)  so that if loading a new scene had the GM, only one will survive and you don't end up with duplicated GM instances.

have a go and let me know if something is unclear.

Bye,

 Jean

lists

  • Playmaker Newbie
  • *
  • Posts: 2
    • View Profile
Re: GameManager architecture overview question
« Reply #2 on: July 18, 2016, 10:41:09 PM »
thanks that looks like what I am looking for. I will give it a go.

shawn