// Start is called before the first frame update
    void Start()
    {
        player = GameObject.Find("Player");
        playa  = player.GetComponent <Player>();

        GameObject trnsfer = GameObject.Find("InputName");

        trsnfrName = trnsfer.GetComponent <TransferName>();

        GameObject theSpawner = GameObject.Find("HouseSpawner");

        houseSpwn = theSpawner.GetComponent <HouseSpawner>();

        GameObject theHome = GameObject.Find("Home");

        home = theHome.GetComponent <Home>();

        currentPlayer = playa.playerName;
        restartGUI.SetActive(false);
        winGUI.SetActive(false);
        loseGUI.SetActive(false);
        //PlayerPrefs.DeleteAll();

        highScore = PlayerPrefs.GetInt("HighScore");
        playaName = PlayerPrefs.GetString("PlayerName", "John");
    }
Beispiel #2
0
    private void Start()
    {
        DontDestroyOnLoad(this);
        DontDestroyOnLoad(MoneyManager.gameObject);
        DontDestroyOnLoad(PlacementManager.gameObject);

        ground           = GameObject.Find("Ground");
        placementManager = FindObjectOfType <PlacementManager>();
        buildings        = FindObjectOfType <Buildings>();
        worldSpaceCanvas = GameObject.Find("WorldSpaceCanvas").GetComponent <Canvas>();
        houseSpawner     = FindObjectOfType <HouseSpawner>();
        moneyMananger    = FindObjectOfType <MoneyManager>();
        alertManager     = FindObjectOfType <AlertManager>();
    }
Beispiel #3
0
    public override void OnInspectorGUI()
    {
        HouseSpawner mapGen = (HouseSpawner)target;

        if (DrawDefaultInspector())
        {
        }

        if (GUILayout.Button("Reset"))
        {
            mapGen.Kill();
        }

        if (GUILayout.Button("Generate"))
        {
            mapGen.Generate();
        }
    }
Beispiel #4
0
 private void Awake()
 {
     houseSpawner = GetComponent <HouseSpawner>();
     player       = GameObject.Find("Player");
 }