예제 #1
0
 void Start()
 {
     if (resourceManager == null)
     {
         resourceManager = GetComponent <Player_ResourceManager>();
     }
     GetResourcesText();
     foodCostText.color = Color.red;
 }
    void Start()
    {
        resourceManager = GameObject.FindGameObjectWithTag("Capital").GetComponent <Player_ResourceManager> ();
        farming         = true;

        // MAKE SURE THE PLAYER HAS ENOUGH WATER BEFORE ADDING THIS FARM'S PRODUCTION TO THE STATS
        if (resourceManager.water >= waterConsumed)
        {
            // Tell the Resource Manager how much I produce per cycle
            resourceManager.CalculateFoodProduction(foodProduced, productionRate, waterConsumed, false);
            foodStatsInitialized = true;
        }
    }
예제 #3
0
    // Use this for initialization
    void Start()
    {
        waterCapacityLeft = waterCapacity;
        oreCapacityLeft   = oreCapacity;

        if (playerResources == null)
        {
            playerResources = GameObject.FindGameObjectWithTag("Capital").GetComponent <Player_ResourceManager>();
        }

        if (playerResources != null)
        {
            Debug.Log("STORAGE: Added to list of storage!");
            playerResources.storageBuildings.Add(this);
        }

        if (playerUI == null)
        {
            playerUI = GameObject.FindGameObjectWithTag("Capital").GetComponent <Player_UIHandler>();
        }
    }
예제 #4
0
    void Start()
    {
        if (resourceGrid == null)
        {
            resourceGrid = GameObject.FindGameObjectWithTag("Map").GetComponent <ResourceGrid>();
        }
        if (buildingUI == null)
        {
            buildingUI = GameObject.FindGameObjectWithTag("UI").GetComponent <Building_UIHandler> ();
        }

        if (playerResources == null)
        {
            playerResources = GameObject.FindGameObjectWithTag("Capital").GetComponent <Player_ResourceManager>();
        }

        sr = GetComponent <SpriteRenderer> ();
        lineR.sortingLayerName = sr.sortingLayerName;
        lineR.sortingOrder     = sr.sortingOrder - 1;
        lineR.SetPosition(0, transform.position);
        selecting = true;
    }
예제 #5
0
    void Start()
    {
        if (resourceManager == null) {
            resourceManager = GetComponent<Player_ResourceManager>();
        }
        GetResourcesText ();
        foodCostText.color = Color.red;

        // Get the player hero component
        if (!playerhero) {
            playerhero = GameObject.FindGameObjectWithTag("Player").GetComponent<Player_HeroAttackHandler>();
        }
    }
예제 #6
0
    // Use this for initialization
    void Start()
    {
        waterCapacityLeft = waterCapacity;
        oreCapacityLeft = oreCapacity;

        if (playerResources == null) {
            playerResources = GameObject.FindGameObjectWithTag("Capital").GetComponent<Player_ResourceManager>();
        }

        if (playerResources != null) {
            Debug.Log ("STORAGE: Added to list of storage!");
            playerResources.storageBuildings.Add(this);
        }

        if (playerUI == null) {
            playerUI = GameObject.FindGameObjectWithTag("Capital").GetComponent<Player_UIHandler>();
        }
    }
예제 #7
0
    void Start()
    {
        // Get Resource managaer from Capital gameObject
        resourceManager = GameObject.FindGameObjectWithTag ("Capital").GetComponent<Player_ResourceManager> ();

        // MAKE SURE THE PLAYER HAS ENOUGH WATER BEFORE ADDING THIS FARM'S PRODUCTION TO THE STATS
        if (resourceManager.water >=  waterConsumed) {

            // Tell the Resource Manager how much I produce per cycle
            resourceManager.CalculateFoodProduction (foodProduced, productionRate, waterConsumed, false);
            foodStatsInitialized = true;

        }

        // Set harvest countdown to the starting production rate
        harvestCountDown = productionRate;
    }
예제 #8
0
    void Start()
    {
        // In case Player Resource Manager is null
        if (playerResources == null)
            playerResources = GameObject.FindGameObjectWithTag ("Capital").GetComponent<Player_ResourceManager> ();

        //		InitCapitalAndMinerals ();

        // Initialize Tile Data array with this map size
        //		tiles = new TileData[mapSizeX, mapSizeY];

        // Initialize spawned Tiles array, all values will be set to null until tiles are spawned
        //		spawnedTiles = new GameObject[mapSizeX, mapSizeY];

        // Initialize the Grid, filling tiles positions with Capital, Rocks, and Water
        //		InitGrid ();

        // This creates the Initial Pathfinding graph taking into account unwakable tiles already spawned (ex. Rock, Water, Capital)
        InitPathFindingGraph ();
    }
예제 #9
0
    void Start()
    {
        // In case Grid is Null
        if (resourceGrid == null) {
            resourceGrid = GameObject.FindGameObjectWithTag("Map").GetComponent<ResourceGrid>();
        }

        // In case Building UI is null
        if (buildingUI == null) {
            buildingUI = GameObject.FindGameObjectWithTag ("UI").GetComponent<Building_UIHandler> ();
        }

        // In case Player Resources is null
        if (playerResources == null) {
            playerResources = GameObject.FindGameObjectWithTag("Capital").GetComponent<Player_ResourceManager>();
        }

        // Store the Sprite Renderer for layer management
        sr = GetComponent<SpriteRenderer> ();

        // Line Renderer's layer is set to be UNDER my sprite
        lineR.sortingLayerName = sr.sortingLayerName;
        lineR.sortingOrder = sr.sortingOrder - 1;
        lineR.SetPosition (0, transform.position);

        //		selecting = true;

        // set Pump Countdown to pump rate
        pumpCountdown = pumpRate;
    }
예제 #10
0
    void Start()
    {
        // In case Player Resource Manager is null
        if (playerResources == null)
            playerResources = GameObject.FindGameObjectWithTag ("Capital").GetComponent<Player_ResourceManager> ();

        // tiles and spawnedTiles are initialized by MapGenerator

        InitPathFindingGrid();

        worldGridInitialized = true;

        StartCoroutine("WaitForLandingSiteSelection");

        // Give the waterTilePositions to Enemy_Spawner
        //Enemy_Spawner.instance.InitSpawnPositions(waterTilesArray);
        InitializeRockandMinerals();
    }
예제 #11
0
    void Start()
    {
        if (buildingStatusIndicator == null)
            buildingStatusIndicator = GetComponent<Building_Handler> ().buildingStatusIndicator;

        // In case Building UI is null
        if (buildingUI == null) {
            buildingUI = GameObject.FindGameObjectWithTag ("UI").GetComponent<Building_UIHandler> ();
        }

        // In case Player Resources is null
        if (playerResources == null) {
            playerResources = GameObject.FindGameObjectWithTag("Capital").GetComponent<Player_ResourceManager>();
        }

        // Store the Sprite Renderer for layer management
        sr = GetComponent<SpriteRenderer> ();
    }
예제 #12
0
 void Start()
 {
     playerResources = GameObject.FindGameObjectWithTag ("Capital").GetComponent<Player_ResourceManager> ();
 }
예제 #13
0
    void Start()
    {
        // Ask Ship Inventory to init ui
        Ship_Inventory.Instance.InitUI();

        if (resourceManager == null) {
            resourceManager = GetComponent<Player_ResourceManager>();
        }

        // NOTE: Turning off the Panels for now
        //		GetResourcesText ();

        //foodCostText.color = Color.red;

        // Get the player hero component
        /*if (!playerhero) {
            playerhero = GameObject.FindGameObjectWithTag("Player").GetComponent<Player_HeroAttackHandler>();
        }
        */
    }