Example #1
0
    public void AddStory()
    {
        story++;
        Stories[story].SetActive(true);
        Roof.transform.position = Stories[story].transform.position + new Vector3(0, 2.0625f, 0);

        if (story > 0)
        {
            CommuneToControllerBridge bridgeScript = GetComponentInParent <CommuneToControllerBridge>();
            if (bridgeScript != null)
            {
                bridgeScript.SummonDialogueBubble("Everyone's hard work has made the house bigger!");
            }
            CommuneToControllerBridge.Instance.CurrentMaxPeople = CommuneToControllerBridge.Instance.MaxPeopleBuildingUpgradeStages[story];
        }
    }
    void Start()
    {
        if (CityScene == null || CommuneScene == null)
        {
            Debug.LogError("ERROR: City Scene Prefab or Commune Scene Prefab have not been set!");
        }
        else
        {
            CityBridge    = CityScene.GetComponentInChildren <CityToControllerBridge>();
            CommuneBridge = CommuneScene.GetComponentInChildren <CommuneToControllerBridge>();
            CityBridge.RegisterSceneController(this);
            CommuneBridge.RegisterSceneController(this);
            RequestStateChange(GameStates.COMMUNE, true);

            Cursor.lockState = CursorLockMode.Locked;
        }

        if (DialogueBubbleCanvas == null || DialogueBubblePrefab == null)
        {
            Debug.LogError("Dialogue bubble setup in main scene not correct. Please fix.");
        }
    }
 private void Awake()
 {
     Instance = this;
 }
 void Update()
 {
     text.text = CommuneToControllerBridge.GetCurrentCommuneNPCs() + "/" + CommuneToControllerBridge.Instance.CurrentMaxPeople;
 }
Example #5
0
    public void PlayerEnteredCity()
    {
        // Reset/respawn crowds & player pos?

        GameObject crowdManager = transform.Find("CrowdManager").gameObject;

        if (crowdManager != null)
        {
            crowdManager.GetComponent <CrowdManager>().RefreshCrowd();
        }


        //Set commune variables
        GameObject collectionHandler = transform.Find("CollectionScript").gameObject;

        if (collectionHandler != null)
        {
            collectionHandler.GetComponent <CityCollectionHandler>().ResetNumbers();
            collectionHandler.GetComponent <CityCollectionHandler>().SetCommuneVariables(CommuneToControllerBridge.GetCurrentCommuneNPCs(), CommuneToControllerBridge.Instance.CurrentMaxPeople);
        }
    }