void Start() { if (buildingCanvas == null) { Debug.Log("CLICK HANDLER: Building Canvas not set!"); } if (buildingPanel == null) { Debug.Log("CLICK HANDLER: Building Panel not set!"); } if (buildingStatus == null) { Debug.Log("CLICK HANDLER: Building Status Image not set!"); } if (buildingCanvas != null) { buildingCanvas.worldCamera = Camera.main; } // IF THIS BUILDING is spawned by the UI Handler, it won't need to make this search if (buildingUIhandler == null) { buildingUIhandler = GameObject.FindGameObjectWithTag("UI").GetComponent <Building_UIHandler> (); } myCollider = GetComponent <BoxCollider2D> (); vertExtents = myCollider.bounds.extents.y; }
void Start() { // INIT rocksdetected array // This assumes that we are only checking tiles ONE TILE OVER in all directions rocksDetected = new Vector2[8]; // if (SearchForRock ()) { // CycleRocksArray(); // } if (resourceGrid == null) { resourceGrid = GameObject.FindGameObjectWithTag("Map").GetComponent <ResourceGrid>(); } if (buildingUI == null) { buildingUI = GameObject.FindGameObjectWithTag("UI").GetComponent <Building_UIHandler> (); } sr = GetComponent <SpriteRenderer> (); lineR.sortingLayerName = sr.sortingLayerName; lineR.sortingOrder = sr.sortingOrder - 1; lineR.SetPosition(0, transform.position); selecting = true; }
void Start() { buildingUI = GetComponentInChildren <Building_UIHandler> (); feeding = true; if (objPool == null) { objPool = GameObject.FindGameObjectWithTag("Pool").GetComponent <ObjectPool> (); } if (chosenHero != null) { // get the spawn position spawnPosition = new Vector3(resourceGrid.capitalSpawnX, resourceGrid.capitalSpawnY - 1.2f, 0.0f); _spwnCoRoutine = WaitToSpawn(timeToSpawn); StartCoroutine(_spwnCoRoutine); } InitStartingResources(); }
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; }
void Start() { nano_builder = resourceGrid.Hero.GetComponent<NanoBuilding_Handler> (); if (buildingCanvas == null) { Debug.Log("CLICK HANDLER: Building Canvas not set!"); } if (buildingPanel == null) { Debug.Log("CLICK HANDLER: Building Panel not set!"); } if (buildingStatusIndicator == null) { Debug.Log("CLICK HANDLER: Building Status Indicator not set!"); } if (buildingCanvas != null) { buildingCanvas.worldCamera = Camera.main; } // IF THIS BUILDING is spawned by the UI Handler, it won't need to make this search if (buildingUIhandler == null) { buildingUIhandler = GameObject.FindGameObjectWithTag ("UI").GetComponent<Building_UIHandler> (); } myCollider = GetComponent<BoxCollider2D> (); vertExtents = myCollider.bounds.extents.y; // get my tiletype myTileType = CheckTileType ((int)transform.position.x,(int) transform.position.y); }
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; }
void Start() { // Initialize credit booster at 0 booster = 0; // Get Building UI from child buildingUI = GetComponentInChildren<Building_UIHandler> (); feeding = true; // If Object Pool is null // if (objPool == null) // objPool = GameObject.FindGameObjectWithTag ("Pool").GetComponent<ObjectPool> (); // TODO: Create a method that takes care of loading resources gathered from previous levels //Initialize the Starting Resources for this level InitStartingResources (startFood, startCredits, startOre); }
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> (); }
void Awake() { BuildingHandler = this; canvasRectTransform = canvas.transform as RectTransform; game_master = GameObject.FindGameObjectWithTag ("GM").GetComponent<GameMaster> (); }
void Start() { // Initialize credit booster at 0 booster = 0; // Get Building UI from child buildingUI = GetComponentInChildren<Building_UIHandler> (); feeding = true; // If Object Pool is null if (objPool == null) objPool = GameObject.FindGameObjectWithTag ("Pool").GetComponent<ObjectPool> (); // NOTE: Need to change this Chosen Hero logic to the current one Hero mechanic // if (chosenHero != null) { // // // get the spawn position // spawnPosition = new Vector3(resourceGrid.capitalSpawnX, resourceGrid.capitalSpawnY - 1.2f, 0.0f); // // _spwnCoRoutine = WaitToSpawn(timeToSpawn); // StartCoroutine(_spwnCoRoutine); // } // TODO: Create a method that takes care of loading resources gathered from previous levels //Initialize the Starting Resources for this level InitStartingResources (startFood, startCredits, startOre); }
void Start() { // INIT rocksdetected array // This assumes that we are only checking tiles ONE TILE OVER in all directions rocksDetected = new Vector2[8]; // 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> (); } // 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); // Set selecting is true so Line follows Mouse from Start // selecting = true; // set Extract Countdown to extraction rate extractCountDown = extractRate; }