public void InitThis(GameObject p_PlayerEntity, string p_mapEventType, string p_result) //---------------------------------------------------- // own custome overloaded constructor // //---------------------------------------------------- { //get player info m_PlayerEntity = p_PlayerEntity; // Holds the results of parsing. m_EnumMapEvent tmpEnumMapEvent = m_EnumMapEvent.NOTHING; try { // Attempt to parse the string into the enum value. tmpEnumMapEvent = (m_EnumMapEvent)Enum.Parse(typeof(m_EnumMapEvent), p_mapEventType); } // end try statement catch (Exception) { // The parsing failed so make sure the resource is null. print("Requested MapEvent type '" + p_mapEventType + "' was not found."); } // end catch statement //set to currEvent m_currEnumMpEvent = tmpEnumMapEvent; //tell StateMachin action is running m_isActionRunning = true; m_showHideGUI = true; m_resultString = p_result; } //end InitThis()
//========================================================== //--------------------Functions----------------------------- //========================================================== // Use this for initialization void Start() { m_currEnumMpEvent = m_EnumMapEvent.NOTHING; m_GUIEnemyScript = GameObject.FindGameObjectWithTag("GUIMapEventSpriteTag").GetComponent <GSP.JAVIERGUI.GUIEnemy>(); m_GUIAllyScript = GameObject.FindGameObjectWithTag("GUIMapEventSpriteTag").GetComponent <GSP.JAVIERGUI.GUIAlly>(); m_GUIItemScript = GameObject.FindGameObjectWithTag("GUIMapEventSpriteTag").GetComponent <GSP.JAVIERGUI.GUIItem>(); m_GUIResourceScript = GameObject.FindGameObjectWithTag("GUIMapEventSpriteTag").GetComponent <GSP.JAVIERGUI.GUIResource>(); m_GUINothingScript = GameObject.FindGameObjectWithTag("GUIMapEventSpriteTag").GetComponent <GSP.JAVIERGUI.GUINothing>(); m_GameplayStateMachineScript = GameObject.FindGameObjectWithTag("GamePlayStateMachineTag").GetComponent <GSP.GameplayStateMachine>(); m_GUIBottomBarScript = GameObject.FindGameObjectWithTag("GamePlayStateMachineTag").GetComponent <GSP.JAVIERGUI.GUIBottomBar>(); }
} //end private void GUIContainer() public void MapeEventDone() { m_currEnumMpEvent = m_EnumMapEvent.DONE; m_GUIBottomBarScript.StopAnimation(); m_GameplayStateMachineScript.StopAnimation(); }