Example #1
0
 // Use this for initialization
 void Start()
 {
     m_GUIMapEventsScript   = GameObject.FindGameObjectWithTag("GUIMapEventSpriteTag").GetComponent <GSP.GUIMapEvents> ();
     m_MapEventScript       = GameObject.FindGameObjectWithTag("DieTag").GetComponent <GSP.MapEvent> ();
     m_BottomBarScript      = GameObject.FindGameObjectWithTag("GamePlayStateMachineTag").GetComponent <GSP.JAVIERGUI.GUIBottomBar>();
     m_GamePlayStateMachine = GameObject.FindGameObjectWithTag("GamePlayStateMachineTag").GetComponent <GSP.GameplayStateMachine>();
 }
Example #2
0
        }               //end Start()

        public void InitGUIAlly(GameObject p_PlayerEntity, int p_startX, int p_startY, int p_startWidth, int p_startHeight)
        {
            m_PlayerEntity = p_PlayerEntity;
//			m_PlayerAllyScript = m_PlayerEntity.GetComponent<GSP.Char.Ally>();	//-->			//used during testing
            //m_PlayerCharacterScript = m_PlayerEntity.GetComponent<GSP.Char.Character>();
            m_GUIMapEventsScript = GameObject.FindGameObjectWithTag("GUIMapEventSpriteTag").GetComponent <GSP.GUIMapEvents>();
            m_MapEventScript     = GameObject.FindGameObjectWithTag("DieTag").GetComponent <GSP.MapEvent>();

            m_isActionRunning = true;

            //GUIMapEvents values transferred over
            m_mainStartX = p_startX;
            m_mainStartY = p_startY;
            m_mainWidth  = p_startWidth;
            m_mainHeight = p_startHeight;
        }
Example #3
0
        }                                                                                                                                            //end Start()

        public void InitGUIItem(GameObject p_PlayerEntity, int p_startX, int p_startY, int p_startWidth, int p_startHeight, string p_resultMapEvent) //string p_itemStr, string p_resourceStr )
        {
            m_PlayerEntity       = p_PlayerEntity;
            m_GUIMapEventsScript = GameObject.FindGameObjectWithTag("GUIMapEventSpriteTag").GetComponent <GSP.GUIMapEvents>();
            m_MapEventScript     = GameObject.FindGameObjectWithTag("DieTag").GetComponent <GSP.MapEvent>();

            m_isActionRunning = true;

            //GUIMapEvents values transferred over
            m_mainStartX = p_startX;
            m_mainStartY = p_startY;
            m_mainWidth  = p_startWidth;
            m_mainHeight = p_startHeight;

            m_headerString = p_resultMapEvent;

            //Glow effect on Item Button
        }
Example #4
0
        //=================================================================================================
        //-----------------------------------Functions-----------------------------------------------------
        //=================================================================================================

        void Start()
        //------------------------------------------------------------------
        //  Start() runs when the object if first instantiated
        //		-Because this object will occur once through the game,
        //			these values are the beginning of game values
        //		-Values should be updated at EndTurn State of StateMachine()
        //-------------------------------------------------------------------
        {
            // Clear the dictionary
            TileDictionary.Clean();

            // Set the dimensions and generate/add the tiles
            TileManager.SetDimensions(64, 20, 16);
            TileManager.GenerateAndAddTiles();

            #region End Scene Initialisation stuff

            // Create the empty game object.
            m_endSceneCharData = new GameObject("EndSceneCharData");

            // Tag it as end scene char data.
            m_endSceneCharData.tag = "EndSceneCharDataTag";

            // Add the end scene char data component.
            m_endSceneCharData.AddComponent <EndSceneData>();

            // Set it to not destroy on load.
            DontDestroyOnLoad(m_endSceneCharData);

            // Defaults to true.
            m_runEndStuff = true;

            #endregion

            //#region Menu Data Initialisation Stuff

            // Get the game object with the menu data tag.
            GameObject menuData = GameObject.FindGameObjectWithTag("MenuDataTag");

            // Only proceed of the data object isn't null.
            if (menuData != null)
            {
                // Get its menu data script.
                MenuData menuDataScript = menuData.GetComponent <MenuData>();

                // Copy the value into the state machine.
                m_GUINumOfPlayers = menuDataScript.NumberPlayers;
            }

            // Finally, destroy the menu data object.
            Destroy(menuData);

            //#endregion

            //initialize empty lists
            m_playerList         = new List <GameObject>();
            m_playerScriptList   = new List <GSP.Char.Character>();
            m_PlayerResourceList = new List <GSP.Char.ResourceList>();

            //Add Players Instances
            AddPlayers(m_GUINumOfPlayers);

            //Beginning State
            m_gamePlayState = GamePlayState.BEGINTURN;

            //get scripts needed
            m_DieScript          = GameObject.FindGameObjectWithTag("DieTag").GetComponent <DieInput>();
            m_GUIMapEventsScript = GameObject.FindGameObjectWithTag("GUIMapEventSpriteTag").GetComponent <GUIMapEvents>();
            m_GUIMovementScript  = GameObject.FindGameObjectWithTag("GUIMovementTag").GetComponent <GSP.GUIMovement>();
            //m_NEWGUIMapEventScript = GameObject.FindGameObjectWithTag ("GUIMapEventSpriteTag").GetComponent<GSP.JAVIERGUI.NewGUIMapEvent>();	//used during testing
            m_MapEventScript     = GameObject.FindGameObjectWithTag("DieTag").GetComponent <GSP.MapEvent>();
            m_GUIBottomBarScript = this.GetComponent <GSP.JAVIERGUI.GUIBottomBar>();

            m_DieScript.Dice.Reseed(System.Environment.TickCount);

            //text for the action button
            m_GUIActionString = "Action\nButton";

            //no map event at start;
            m_MapEventString       = "NOTHING";
            m_MapEventResultString = null;

            //this initializes things after Start()
            m_initAfterStart = true;

            //Init audio
            audioSrc = GameObject.FindGameObjectWithTag("AudioSourceTag");
        }               //END start()
Example #5
0
 // Use this for initialization
 void Start()
 {
     m_GUIMapEventsScript = GameObject.FindGameObjectWithTag("GUIMapEventSpriteTag").GetComponent <GSP.GUIMapEvents> ();
     m_MapEventScript     = GameObject.FindGameObjectWithTag("DieTag").GetComponent <GSP.MapEvent> ();
     audioSrc             = GameObject.FindGameObjectWithTag("AudioSourceTag");
 }
		// Use this for initialization
		void Start () 
		{
			m_MapEventsScript = GameObject.FindGameObjectWithTag ("DieTag").GetComponent<GSP.MapEvent> ();
		}