Playmaker Forum

PlayMaker Help & Tips => PlayMaker Help => Topic started by: lists on July 05, 2016, 11:34:29 PM

Title: GameManager architecture overview question
Post by: lists on July 05, 2016, 11: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
Title: Re: GameManager architecture overview question
Post by: jeanfabre on July 06, 2016, 01:34:03 AM
Hi,

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

(http://i.imgur.com/qmphMZt.png)

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
Title: Re: GameManager architecture overview question
Post by: lists on July 19, 2016, 01:41:09 AM
thanks that looks like what I am looking for. I will give it a go.

shawn