void Awake () { //Add all the necessary components LocationHandler locationHandler = gameObject.AddComponent<LocationHandler> (); locationHandler.Init (); //Set up displays m_displays = new Dictionary<string,DisplayHandler >(); DisplayHandler[] displayChildren = gameObject.GetComponentsInChildren<DisplayHandler>(); foreach (DisplayHandler display in displayChildren) { display.Init(); display.HideDisplay(); m_displays.Add(display.DisplayName,display); } m_dramaManager = new DramaManager (Screen.width,Screen.height); currGameState = m_dramaManager.GetRandomStartState (); //Start the display to start with if (m_displays.ContainsKey (displayToStartWith)) { m_currDisplay = displayToStartWith; m_displays[m_currDisplay].SwitchToDisplay(); } else{ Debug.LogError("GameplayManager Error: displayToStartWith did not match a Handler name"); } Instance = this; }
public DramaManager(float maxWidth, float maxHeight){ if (Instance == null) { Instance=this; } MAX_WIDTH = maxWidth; MAX_HEIGHT = maxHeight; actionManager = new ActionManager (); beginningStates = new InitializeState[]{InitializeGameState, InitializeGameState2, InitializeGameState3,InitializeGameState4,InitializeGameState5}; }
public DramaManager(float maxWidth, float maxHeight) { if (Instance == null) { Instance = this; } MAX_WIDTH = maxWidth; MAX_HEIGHT = maxHeight; actionManager = new ActionManager(); beginningStates = new InitializeState[] { InitializeGameState, InitializeGameState2, InitializeGameState3, InitializeGameState4, InitializeGameState5 }; }
public static bool CloseEnoughToPlayer(GameState state, Character instigator, Character receiver, Item item) { return(instigator != null && DramaManager.GetDist(instigator, state.Player) < DramaManager.MIN_DIST); }
public static bool CloseEnoughToReveal(GameState state, Character instigator, Character receiver, Item item) { return(instigator != null && receiver != null && DramaManager.GetDist(instigator, receiver) < DramaManager.MIN_REVEAL); }