void Awake()
 {
     gDataRef = GameObject.Find("GameManager").GetComponent<GlobalGameData>();
     graphicsDataRef = GameObject.Find("GameManager").GetComponent<GraphicAssets>(); // get graphics
     characterWindow = GameObject.Find("Character Window Panel");
     blockingPanel = GameObject.Find("Blocking Panel");
     age = characterWindow.transform.Find("Age Value").GetComponent<Text>();
     health = characterWindow.transform.Find("Health Value").GetComponent<Text>();
     wealth = characterWindow.transform.Find("Wealth Value").GetComponent<Text>();
     intelligence = characterWindow.transform.Find("Intelligence Value").GetComponent<Text>();
     influence = characterWindow.transform.Find("Influence Value").GetComponent<Text>();
     honor = characterWindow.transform.Find("Loyalty Value").GetComponent<Text>();
     intel = characterWindow.transform.Find("Intel Value").GetComponent<Text>();
     charm = characterWindow.transform.Find("Charisma Value").GetComponent<Text>();
     drive = characterWindow.transform.Find("Drive Value").GetComponent<Text>();
     piety = characterWindow.transform.Find("Piety Value").GetComponent<Text>();
     empathy = characterWindow.transform.Find("Empathy Value").GetComponent<Text>();
     passion = characterWindow.transform.Find("Will Value").GetComponent<Text>();
     history = characterWindow.transform.Find("History Text").GetComponent<Text>();
     CommText = characterWindow.transform.Find("Comm Text").GetComponent<Text>();
     trait1 = characterWindow.transform.Find("Trait 1").GetComponent<Text>();
     trait2 = characterWindow.transform.Find("Trait 2").GetComponent<Text>();
     trait3 = characterWindow.transform.Find("Trait 3").GetComponent<Text>();
     trait4 = characterWindow.transform.Find("Trait 4").GetComponent<Text>();
     characterName = characterWindow.transform.Find("Character Name").GetComponent<Text>();
     characterRank = characterWindow.transform.Find("Character Rank").GetComponent<Text>();
     characterImage = characterWindow.transform.Find("Character Image").GetComponent<Image>();
     aView = characterWindow.transform.Find("ScrollView").GetComponent<ActionScrollView>();
     rView = characterWindow.transform.Find("Relations Scrollview").GetComponent<RelationsScrollView>();
     charRankImage = characterWindow.transform.Find("Char Rank Image").GetComponent<Image>();
     rank1Image = characterWindow.transform.Find("Rank 1 Image").GetComponent<Image>();
     rank2Image = characterWindow.transform.Find("Rank 2 Image").GetComponent<Image>();
     characterWindow.SetActive(false); // sets the window as active initially
     blockingPanel.SetActive(false); // this panel blocks mouse clicks from going 'through' the screen since it is supposed to be a modal screen
 }
 public SetupState(StateManager managerRef)
 {
     manager = managerRef;
     gData = GameObject.Find("GameManager").GetComponent<GalaxyData>();
     gameData = GameObject.Find("GameManager").GetComponent<GlobalGameData>();
     Debug.Log("In SetupState");
 }
 // Use this for initialization
 void Start()
 {
     gData = GameObject.Find("GameManager").GetComponent<GalaxyData>();
     gameData = GameObject.Find("GameManager").GetComponent<GlobalGameData>();
     planetsGenerated = GameObject.Find("Planets Generated").GetComponent<Text>();
     housesGenerated = GameObject.Find("Houses Generated").GetComponent<Text>();
     charactersGenerated = GameObject.Find("Characters Generated").GetComponent<Text>();
 }
 //constructor
 public NewGameState(StateManager managerRef)
 {
     manager = managerRef;
     valuesLoaded = false; // reset
     valuesEntered = false;
     gameDataRef = GameObject.Find("GameManager").GetComponent<GlobalGameData>();
     Debug.Log("Constructing New Game Screen");
 }
    void Start()
    {
        // initialize state machine and managers
        activeState = new BeginState(this);
        galaxyDataRef = GetComponent<GalaxyData>();  // gets the galaxy data script containing the data structure
        gameDataRef = GetComponent<GlobalGameData>();  // gets global game data (screens, etc) that are used universally

        Debug.Log("This object is of type: " + activeState);
    }
 public static ModalPanel Instance()
 {
     if (!modalPanel)
     {
         gGameData = GameObject.Find("GameManager").GetComponent<GlobalGameData>();
         //modalPanel = new ModalPanel();
         modalPanel = FindObjectOfType(typeof(ModalPanel)) as ModalPanel;
         if (!modalPanel)
             Debug.LogError("There needs to be one active ModalPanel script on a GameObject in your scene.");
     }
     return modalPanel;
 }
 void Awake()
 {
     gGameDataRef = GameObject.Find("GameManager").GetComponent<GlobalGameData>(); // tie the game camera script to the data
 }
        void Awake()
        {
            // modal stuff
            modalPanel = ModalPanel.Instance();  // sets up a static instance of the window
            myYesAction = new UnityAction(TestYesFunction); // assign functions to actions
            myNoAction = new UnityAction(TestNoFunction);
            myCancelAction = new UnityAction(TestCancelFunction);

            starmapSprite = GameObject.Find("Y-Axis Grid");
            systemHeaderImage = GameObject.Find("System Header Image");
            starDataTextLine = GameObject.Find("StarDataTextInfo").GetComponent<Text>();
            secondaryDataTextLine = GameObject.Find("CameraZoomValue").GetComponent<Text>();
            secondaryZoomValueLine = GameObject.Find("CameraZoomInfo").GetComponent<Text>();
            gameDate = GameObject.Find("GameDate").GetComponent<Text>();
            backingSphere = GameObject.Find("Backing Sphere");
            empireTreasuryRevenues = GameObject.Find("EmpireTreasuryRevenues").GetComponent<Text>();
            empireTreasuryExpenses = GameObject.Find("EmpireTreasuryExpenses").GetComponent<Text>();
            emperorPoSup = GameObject.Find("Popular Support").GetComponent<Text>();
            emperorAP = GameObject.Find("Action Points").GetComponent<Text>();
            emperorBenevolentInfluence = GameObject.Find("Benevolent Influence").GetComponent<Text>();
            emperorPragmaticInfluence = GameObject.Find("Pragmatic Influence").GetComponent<Text>();
            emperorTyrannicalInfluence = GameObject.Find("Tyrannical Influence").GetComponent<Text>();
            versionNumber = GameObject.Find("Version Info").GetComponent<Text>();
            systemUICanvas = GameObject.Find("System UI Canvas");
            eventScrollView = GameObject.Find("Event ScrollView");
            selectedUnitInfoCanvas = GameObject.Find("Selected Unit Information Canvas");
            systemDisplaySystemName = GameObject.Find("System Name Text").GetComponent<Text>();
            systemDisplaySecondaryDataLine = GameObject.Find("Secondary Header Line").GetComponent<Text>();
            systemDisplayTertiaryDataLine = GameObject.Find("Tertiary Header Line").GetComponent<Text>();
            galaxyMapModeInfo = GameObject.Find("MapModeInfo").GetComponent<Text>();
            galaxyMapSubModeInfo = GameObject.Find("MapSubModeInfo").GetComponent<Text>();
            empireStatusBar = GameObject.Find("Empire Status Bar").GetComponent<Image>();
            button = GameObject.Find("War Button").GetComponent<Image>();
            galaxyUICanvas = GameObject.Find("Galaxy UI Canvas").GetComponent<Canvas>();
            galaxyPlanetInfoCanvas = GameObject.Find("Galaxy Planet Info Canvas").GetComponent<Canvas>();
            eventPanelButton = GameObject.Find("Event Panel Button");

            // data objects
            gameDataRef = GameObject.Find("GameManager").GetComponent<GlobalGameData>(); // get global game data (date, location, version, etc)
            gCameraRef = GameObject.Find("Main Camera").GetComponent<GalaxyCameraScript>(); // get global camera script

            if (!starDataTextLine)
            {
                Debug.LogError("This script requires a text object!");
                enabled = false;
                return;
            }
        }
 // Use this for initialization
 void Start()
 {
     mainC = GameObject.Find("Main Camera").GetComponent<Camera>();
     gDataRef = GameObject.Find("GameManager").GetComponent<GlobalGameData>();
     mainC.fieldOfView = maxZoomLevel;
     zoom = mainC.fieldOfView;
     galaxyHeight = gDataRef.GalaxySizeHeight;
     galaxyWidth = gDataRef.GalaxySizeWidth;
     ScrollWheelIsValid = true;
 }
    // Use this for initialization
    void Start()
    {
        galDataRef = GameObject.Find("GameManager").GetComponent<GalaxyData>();
        gDataRef = GameObject.Find("GameManager").GetComponent<GlobalGameData>();

        // run 4 times before first turn to maximize
        for (int x = 0; x < 4; x++)
        {
            foreach (Civilization civ in gDataRef.CivList)
            {
                UpdatePlanets(civ);
                CheckForMigration(civ); // check for intraplanet migration
                MigratePopsBetweenPlanets(civ); // and if there are any pops who want to leave, check for where
            }
        }
        UpdateTrades();
        UpdateEmperor();
        gDataRef.UpdateGameDate();
        gDataRef.RequestGraphicRefresh = true;
    }
 void Start()
 {
     // data structure references
     gData = GameObject.Find("GameManager").GetComponent<GalaxyData>();
     gameDataRef = GameObject.Find("GameManager").GetComponent<GlobalGameData>();
     //DataManager.PopulateObjectNameLists(); // populate the name lists once!
     galaxySizeWidth = gameDataRef.GalaxySizeWidth; // these will be selected in new game screen
     galaxySizeHeight = gameDataRef.GalaxySizeHeight;
     GenerateNebulas();
     GenerateStars();
     GeneratePlanets();
 }
    public static Civilization CreateNewCivilization()
    {
        List<String> civNameList = DataManager.civNameList;
        // populate the color list if needed
        if (civColorList.Count == 0)
            PopulateCivColorList();

        Civilization newCiv = new Civilization();
        int dieRoll = 0;
        galaxyDataRef = GameObject.Find("GameManager").GetComponent<GalaxyData>(); // access galaxy data
        gameDataRef = GameObject.Find("GameManager").GetComponent<GlobalGameData>(); // access galaxy data

        // Step 1: Generate type of civ
        dieRoll = UnityEngine.Random.Range(1, 7);
        newCiv.Type = (Civilization.eCivType)dieRoll;  // cast to enum

        // Step 2: Generate ID of civ
        newCiv.ID = "CIV" + gameDataRef.CivList.Count.ToString("N0");

        // Step 2: Generate name of civ
        string primaryName = "";
        string surName = "";

        if (civNameList.Count > 0)
        {
            var nameIndex = UnityEngine.Random.Range(0, civNameList.Count);
            primaryName = civNameList[nameIndex];
            civNameList.RemoveAt(nameIndex);
            civNameList.TrimExcess();
        }
        else
            primaryName = "GenericName";

        var surNameIndex = UnityEngine.Random.Range(0, DataManager.civSurNameList.Count);
        surName = DataManager.civSurNameList[surNameIndex];

        newCiv.Name = primaryName + " " + surName;

        // Step 3: Generate other base stats (treasury, size, etc)

        // size/range
        newCiv.Range = 40; // to start with
        int size = UnityEngine.Random.Range(0, 100);

        // adjust size/other ratings for civ type
        switch(newCiv.Type)
        {
            case Civilization.eCivType.Confederation :
                {
                    size += 55;
                    break;
                }
            case Civilization.eCivType.MinorEmpire:
                {
                    size += 40;
                    break;
                }
            case Civilization.eCivType.Satrapy:
                {
                    size += 20;
                    break;
                }
            case Civilization.eCivType.BrokenCivilization:
                {
                    size -= 30;
                    break;
                }
            case Civilization.eCivType.Pirates:
                {
                    size -= 15;
                    break;
                }
        }

        // add a empire type mod here
        if (size < 40)
            newCiv.Size = Civilization.eCivSize.SinglePlanet;
        else if (size < 70)
            newCiv.Size = Civilization.eCivSize.Local;
        else if (size < 90)
        {
            newCiv.Size = Civilization.eCivSize.Minor;
            newCiv.Range = UnityEngine.Random.Range(MultiSystemEmpireRange - 200, MultiSystemEmpireRange + 200);
        }
        else
        {
            newCiv.Size = Civilization.eCivSize.Major;
            newCiv.Range = UnityEngine.Random.Range(MultiRegionEmpireRange - 400, MultiRegionEmpireRange + 400);
        }

        // skill ratings
        newCiv.FarmingBaseRating = UnityEngine.Random.Range(70, 100) - (int)newCiv.Type * 10;
        newCiv.MiningBaseRating = UnityEngine.Random.Range(50, 90) - (int)newCiv.Type * 10;
        newCiv.ScienceBaseRating = UnityEngine.Random.Range(0, 50) + (int)newCiv.Type * 10;
        newCiv.HighTechBaseRating = UnityEngine.Random.Range(0, 40) + (int)newCiv.Type * 10;
        newCiv.ManufacturingBaseRating = UnityEngine.Random.Range(5, 50) + (int)newCiv.Type * 10;

        // tolerance
        newCiv.PlanetMinTolerance = UnityEngine.Random.Range(40, 60); // sets the base minimum habitable world a civilization is willing to tolerate

        // province size
        if (newCiv.Size == Civilization.eCivSize.Major)
        {
            newCiv.CivMaxProvinceSize = UnityEngine.Random.Range(1, 6); // sets a province size between 1 and 5 systems
            newCiv.AdminRating = UnityEngine.Random.Range(5, 21); // generates the civ's base admin rating (how efficient they are in adminstering provinces
        }
        else
        {
            newCiv.CivMaxProvinceSize = 0; // no provinces can be created; the civ is essentially one province
            newCiv.AdminRating = 1;
        }

        // admin rating

        // Step 4: Determine planet of origin
        retryPlanet: // beginning of retry loop
        PlanetData civPlanet = new PlanetData();

        dieRoll = UnityEngine.Random.Range(0, galaxyDataRef.GalaxyPlanetDataList.Count); // find the planets in the quadrant
        civPlanet = galaxyDataRef.GalaxyPlanetDataList[dieRoll];

        if (galaxyDataRef.GalaxyPlanetDataList[dieRoll].AdjustedBio < newCiv.PlanetMinTolerance) // if the bio is too low, throw it out
            goto retryPlanet;

        if (gameDataRef.CivList.Count > 0)
        {
            foreach (Civilization civ in gameDataRef.CivList)
            {
                List<StarData> populatedHomeSystems = new List<StarData>();
                populatedHomeSystems = HelperFunctions.DataRetrivalFunctions.GetCivSystemList(civ);

                if (civPlanet.ID == civ.CapitalPlanetID)  // check for capital world
                    goto retryPlanet;
                if (civ.PlanetIDList.Exists(p => p == civPlanet.ID)) // then all other worlds
                    goto retryPlanet;
                if (newCiv.ID != civ.ID)
                    if (populatedHomeSystems.Exists(p => p.ID == civPlanet.SystemID)) // check for systems that other civs have claimed
                        goto retryPlanet;
            }

            // assign a name for the civ's planet
            if (DataManager.planetNameList.Count > 0)
            {
                var nameIndex = UnityEngine.Random.Range(0, DataManager.planetNameList.Count);
                civPlanet.Name = DataManager.planetNameList[nameIndex];
                DataManager.planetNameList.RemoveAt(nameIndex);
                DataManager.planetNameList.TrimExcess();
            }
            else
                civPlanet.Name = "GenericName";

            // set as capital and send to assign pops, developments, etc.
            newCiv.CapitalPlanetID = civPlanet.ID;
            ClaimCivPlanet(civPlanet, newCiv);
            civPlanet.Rank = PlanetData.ePlanetRank.ImperialCapital;
            newCiv.PlanetIDList.Add(civPlanet.ID); // add the planet
        }

        // Step 5: Determine additional planets
        if (newCiv.Size != Civilization.eCivSize.SinglePlanet)
            ClaimPlanetsForCiv(newCiv);

        // Step 5: Generate color of civ
        retryColor: // beginning of retry loop
        Color civColor = new Color();

        civColor = new Color(UnityEngine.Random.Range(.01f, .99f), UnityEngine.Random.Range(.01f, .99f), UnityEngine.Random.Range(.01f, .99f)); // select a random color
        if (gameDataRef.CivList.Count > 0)
        {
            foreach (Civilization civ in gameDataRef.CivList)
            {
                if (civColor == civ.Color)
                    goto retryColor;
            }
            newCiv.Color = civColor;
        }

        return newCiv;
    }
    // this 'flags' planets to seed with pops in the next step
    public static void ClaimPlanetsForCiv(Civilization newCiv)
    {
        gameDataRef = GameObject.Find("GameManager").GetComponent<GlobalGameData>();
        galaxyDataRef = GameObject.Find("GameManager").GetComponent<GalaxyData>();

        float civMaxDistance = newCiv.Range;
        PlanetData homePlanet = galaxyDataRef.GalaxyPlanetDataList.Find(p => p.ID == newCiv.CapitalPlanetID);
        StarData homeStar = galaxyDataRef.GalaxyStarDataList.Find(p => p.ID == homePlanet.SystemID);

        List<StarData> eligibleSystems = new List<StarData>();
        foreach (StarData star in galaxyDataRef.GalaxyStarDataList)
        {
            float distance = HelperFunctions.Formulas.MeasureDistanceBetweenSystems(star, homeStar);
            if ( distance <= civMaxDistance) // must be within range and also include the home system
                eligibleSystems.Add(star); // add systems that are close to the home star
        }

        //
        // now check planets in those systems to see if they can be owned
        foreach (StarData potStar in eligibleSystems)
        {
            foreach(PlanetData pData in potStar.PlanetList)
            {
                if (pData.AdjustedBio >= newCiv.PlanetMinTolerance)
                {
                    bool planetEligible = true;
                    foreach (Civilization civ in gameDataRef.CivList) // check each civ to make sure they don't own the planet
                    {
                        if (civ.PlanetIDList.Exists (p => p == pData.ID))
                            planetEligible = false;
                        if (pData.ID == homePlanet.ID)
                            planetEligible = false;
                        if (pData.AdjustedMaxHabitableTiles == 0) // if after traits there are no tiles to put people on, it's not a good planet!
                            planetEligible = false;
                    }
                    if (planetEligible) // if they don't, then claim!
                        ClaimCivPlanet(pData,newCiv);
                }
            }
        }
    }
 void Awake()
 {
     tileMapPanel = GameObject.Find("Tile Map Panel");
     stellarographyPanel = GameObject.Find("Stellarography Panel");
     industryDisplayButton = GameObject.Find("Industry Display Button");
     economicDisplayButton = GameObject.Find("Economic Display Button");
     graphicsDataRef = GameObject.Find("GameManager").GetComponent<GraphicAssets>();
     intelLevelText = GameObject.Find("Intel Level Text Label").GetComponent<Text>();
     intelLevelValue = GameObject.Find("Intel Level").GetComponent<Text>();
     planetValueText = GameObject.Find("Planet Value Label").GetComponent<Text>();
     planetValue = GameObject.Find("Planet Value").GetComponent<Text>();
     starbaseText = GameObject.Find("Starbase Level Label").GetComponent<Text>();
     starbaseValue = GameObject.Find("Starbase Level").GetComponent<Text>();
     starbaseDataPanel = GameObject.Find("Starbase Data Panel").GetComponent<Image>();
     tradeHubIndicator = GameObject.Find("Trade Hub Indicator").GetComponent<Text>();
     throughputRemaining = GameObject.Find("Capacity Remaining").GetComponent<Text>();
     tileMapLight = GameObject.Find("Region UI Light").GetComponent<Light>();
     edictPanel = GameObject.Find("Edict Panel");
     wireFrameOverlay = GameObject.Find("Wireframe Planet Overlay");
     planetButtonBarBackground = GameObject.Find("Planet Button Bar Background");
     gameDataRef = GameObject.Find("GameManager").GetComponent<GlobalGameData>();
     planetCanvas = GameObject.Find("Planet UI Canvas").GetComponent<Canvas>();
     //viceroyImageTop = GameObject.Find("Character Image").GetComponent<Image>();
 }
 void Start()
 {
     gData = GameObject.Find("GameManager").GetComponent<GalaxyData>();
     gameDataRef = GameObject.Find("GameManager").GetComponent<GlobalGameData>();
     // now generate civilizations
     GenerateHumanCiv();
     GenerateAICivs();
     GenerateCommonHouses(); // generate houses
     GenerateHouseStats(); // generate the other house status
     GenerateCharacters(); // generate characters for the global pool
     GenerateCivLeaders();
     AssignHouses(); // assign houses
     GenerateRelationships(); // determine everyone's relationship to everyone else
     GenerateProvinces(); // generate provinces for each civilization
     DetermineSystemCapitals();
     GenerateStellarObjectLeaders(); // test; put back after generate primes if needed
     GenerateInfrastructure();
     SetPlanetTaxes();
     GeneratePrimes();
     GeneratePlanetIntelLevels(gameDataRef.CivList.Find(p => p.HumanCiv == true));
     gameDataRef.CivsGenerated = true; // sends flag to move to the galaxy screen
 }
 void Awake()
 {
     gameDataRef = GameObject.Find("GameManager").GetComponent<GlobalGameData>();
     graphicsDataRef = GameObject.Find("GameManager").GetComponent<GraphicAssets>();
 }
    public static void GenerateNebula()
    {
        NebulaData nData = new NebulaData();
        galaxyDataRef = GameObject.Find("GameManager").GetComponent<GalaxyData>();
        gameDataRef = GameObject.Find("GameManager").GetComponent<GlobalGameData>();

        // Step 1: Generate name
        if (DataManager.planetNameList.Count > 0)
        {
            var nameIndex = UnityEngine.Random.Range(0, DataManager.planetNameList.Count);
            nData.Name = DataManager.planetNameList[nameIndex] + " Nebula";
            DataManager.planetNameList.RemoveAt(nameIndex);
            DataManager.planetNameList.TrimExcess();
        }
        else
            nData.Name = "GenericName";

        // Step 2: Set location
        nData.WorldLocation = new Vector3(UnityEngine.Random.Range(-gameDataRef.GalaxySizeWidth,gameDataRef.GalaxySizeWidth), UnityEngine.Random.Range(-gameDataRef.GalaxySizeHeight, gameDataRef.GalaxySizeHeight), UnityEngine.Random.Range(-25,-75)); // set slightly back of X axis for parallax effect

        // Step 3: Assign sprite #
        nData.NebulaSpriteNumber = UnityEngine.Random.Range(0, SpritesPerNebulaType - 1);

        // Step 4: Generate size
        nData.NebulaSize = UnityEngine.Random.Range(.5f, 1.5f);

        // Step 5: Assign rotation
        switch (nData.NebulaSpriteNumber)
        {
            case 0:
            {
                nData.TextRotation = -55f;
                break;
            }
            case 1:
            {
                nData.TextRotation = -55f;
                break;
            }
            case 2:
            {
                nData.TextRotation = 45f;
                break;
            }
            case 3:
            {
                nData.TextRotation = -55f;
                break;
            }
            case 4:
            {
                nData.TextRotation = -60f;
                break;
            }
            default:
            {
                nData.TextRotation = 0f;
                break;
            }
        }

        // Step 6: Assign the data
        galaxyDataRef.AddStellarPhenonomaDataToList(nData);
    }
 void Awake()
 {
     uiCanvas = GameObject.Find("Character Window Canvas").GetComponent<Canvas>();
     graphicDataRef = GameObject.Find("GameManager").GetComponent<GraphicAssets>();
     gDataRef = GameObject.Find("GameManager").GetComponent<GlobalGameData>();
 }
 void Awake()
 {
     gDataRef = GameObject.Find("GameManager").GetComponent<GlobalGameData>();
     cScreen = GameObject.Find("Character Window Canvas").GetComponent<CharacterScreen>();
 }
    private static bool DoesBuildFocusChange(PlanetData pData, Character vic, GlobalGameData gDataRef)
    {
        float timeSinceChange = vic.TimeSinceBuildFocusChange;
        float changeChance = 0;

        if (vic.Traits.Exists(p => p.Name == "Erratic"))
        {
            changeChance += 20f;
        }

        changeChance -= (vic.GoalStabilityTendency / 10f);
        changeChance += timeSinceChange * 10f;

        // if there are critical shortfalls on planets, vics are much less likely to change their focus
        if (vic.BuildFocus == Character.eBuildFocus.Farms)
        {
            if (pData.FoodDifference > 0)
            {
                changeChance -= pData.FoodDifference;
            }
        }

        if (vic.BuildFocus == Character.eBuildFocus.Hightech)
        {
            if (pData.EnergyDifference > 0)
            {
                changeChance -= pData.EnergyDifference;
            }
        }

        if (changeChance > 80)
        {
            return true; // yes, the focus changes
        }

        return false;
    }
 void Awake()
 {
     gameDataRef = GameObject.Find("GameManager").GetComponent<GlobalGameData>();
 }