// Use this for initialization void Start() { hudElementName = "powerup"; hudColorController = GameObject.FindGameObjectWithTag("GameController").GetComponent<HUDColorController>(); powerupSprites = new Sprite[] { Resources.Load<Sprite>("UI Sprites/EmptyPowerup"), Resources.Load<Sprite>("UI Sprites/EMPPlaceHolder"), Resources.Load<Sprite>("UI Sprites/ShockwavePlaceHolder"), Resources.Load<Sprite>("UI Sprites/TimeSlowPlaceholder")}; GameObject[] temp = GameObject.FindGameObjectsWithTag("Powerup Gauge"); powerupGauges = new Image[temp.Length]; for (int i = 0; i < powerupGauges.Length; ++i) { powerupGauges[i] = temp[i].GetComponent<Image>(); powerupGauges[i].color = hudColorController.getColorByString(hudElementName); } temp = GameObject.FindGameObjectsWithTag("Powerup Background"); powerupBackground = new Image[temp.Length]; for(int i = 0; i < powerupBackground.Length; ++i) { powerupBackground[i] = temp[i].GetComponent<Image>(); powerupBackground[i].color = hudColorController.getColorByString(hudElementName); } player = GameObject.FindGameObjectWithTag("Player").GetComponent<PlayerController>(); }
// Update is called once per frame void Update() { if(colorController == null) { colorController = GameObject.FindGameObjectWithTag("GameController").GetComponent<HUDColorController>(); } }
// Use this for initialization void Start() { colorChannel = GetComponent<Slider>(); //hudElement = ""; colorController = GameObject.FindGameObjectWithTag("GameController").GetComponent<HUDColorController>(); colorChannel.onValueChanged.AddListener(delegate { ValueChangeCheck(); }); }
// Use this for initialization void Start() { coreHPCanvas = GetComponentInChildren<Canvas>(); coreHPDisplay = GetComponentInChildren<Image>(); player = GameObject.FindGameObjectWithTag("Player"); coreHPCanvas.enabled = false; colorController = GameObject.FindGameObjectWithTag("GameController").GetComponent<HUDColorController>(); coreHPDisplay.color = colorController.getColorByString("bomb"); }
// Use this for initialization void Start() { hudElementName = "bomb"; hudColorController = GameObject.FindGameObjectWithTag("GameController").GetComponent<HUDColorController>(); detachScript = bomb.GetComponent<BombDetach>(); timerTextCanavas = GetComponent<Canvas>(); timerText = GetComponentInChildren<Text>(); timerText.color = hudColorController.getColorByString(hudElementName); timerTextCanavas.enabled = false; }
// Use this for initialization void Start() { hudElementName = ""; colorController = GameObject.FindGameObjectWithTag("GameController").GetComponent<HUDColorController>(); // gets button information to disable when no HUD element is selected thisButton = GetComponent<Button>(); thisButtonImage = GetComponent<Image>(); thisButtonText = GetComponentInChildren<Text>(); settingsScreen = GetComponentInParent<Canvas>(); }
// Use this for initialization void Start() { thisButton = gameObject.GetComponent<Button>(); colorController = GameObject.FindGameObjectWithTag("GameController").GetComponent<HUDColorController>(); GameObject[] temp = GameObject.FindGameObjectsWithTag("Color Selector Button"); colorSelectorButtons = new Button[temp.Length]; for(int i = 0; i < colorSelectorButtons.Length; ++i) { colorSelectorButtons[i] = temp[i].GetComponent<Button>(); } hudElementColor = colorController.getColorByString(hudElement); for(int i = 0; i < hudElementSample.Length; ++i) { hudElementSample[i].color = hudElementColor; } }
// Use this for initialization void Start() { baseSoundSource = GetComponents<AudioSource>()[0]; effectSoundSource = GetComponents<AudioSource>()[1]; // shield initializations shieldEnabled = true; //Disables Shield Recharge for Tutorial shieldActive = false; maxShieldCharge = currShieldCharge = 100f; shieldChargeDelay = 2.0f; shieldChargeDelayTimer = 0.0f; shieldDepleteAmount = -20; shieldRechargeAmount = 10; flashTimer = 0; hudElementName = "shield"; hudColorController = GameObject.FindGameObjectWithTag("GameController").GetComponent<HUDColorController>(); shieldOutline.color = hudColorController.getColorByString(hudElementName); shieldParticles = transform.FindChild("Shield Field").gameObject.GetComponent<ParticleSystem>(); shieldCollider = GetComponent<Collider>(); bomb = GameObject.FindGameObjectWithTag("Bomb"); bombBehavior = bomb.GetComponent<BombController>(); GameObject[] temp = GameObject.FindGameObjectsWithTag("Shield Gauge"); shieldGauge = new Image[temp.Length]; for (int i = 0; i < shieldGauge.Length; ++i) { shieldGauge[i] = temp[i].GetComponent<Image>(); shieldGauge[i].color = hudColorController.getColorByString(hudElementName); } particleSystems = new List<GameObject>(); SetParticleColors(); }
// Use this for initialization void Start() { hudElementName = "armor"; hudColorController = GameObject.FindGameObjectWithTag("GameController").GetComponent<HUDColorController>(); maxChunks = GameObject.FindGameObjectWithTag("Player").GetComponent<PlayerController>().getMaxHullIntegrity(); currChunks = GameObject.FindGameObjectWithTag("Player").GetComponent<PlayerController>().getCurrHullIntegrity(); arrayMidpoint = maxChunks / 2; armorChunkTracker = new Image[maxChunks]; for (int i = 0; i < maxChunks; ++i) { GameObject temp = (GameObject)Instantiate(armorChunk, gameObject.transform.position, gameObject.transform.rotation); temp.transform.SetParent(gameObject.transform); armorChunkTracker[i] = temp.GetComponent<Image>(); armorChunkTracker[i].color = hudColorController.getColorByString(hudElementName); chunkOn = armorChunkTracker[i].color; chunkOff = new Color(chunkOn.r, chunkOn.g, chunkOn.b, 0.0f); if(i % 2 != 0) { armorChunkTracker[i].gameObject.transform.Rotate(new Vector3(180, 0, 0)); } } updateChunks(currChunks); }
// Use this for initialization void Start() { hudElementName = "bomb"; hudColorController = GameObject.FindGameObjectWithTag("GameController").GetComponent<HUDColorController>(); isArmed = false; hasRigidbody = false; currBombCharge = 0; maxBombCharge = 100; currUseCharge = 0f; //transform.parent = player.transform; GameObject[] temp = GameObject.FindGameObjectsWithTag("Bomb Gauge"); bombGauge = new Image[temp.Length]; useGaugeObject = GameObject.FindGameObjectWithTag ("Bomb Use Gauge"); Color newColor = hudColorController.getColorByString(hudElementName); for(int i = 0; i < bombGauge.Length; ++i) { bombGauge[i] = temp[i].GetComponent<Image>(); bombHUDColor = bombGauge [i].color = newColor; } bombGaugeBackground.color = newColor; useGauge = useGaugeObject.GetComponent<Image>(); useGauge.color = new Color (newColor.r / 2, newColor.g / 2, newColor.b / 2, newColor.a); for (int i = 0; i < bombGauge.Length; ++i) { bombGauge[i].fillAmount = (float)currBombCharge / (float)maxBombCharge; } temp = GameObject.FindGameObjectsWithTag("Door HP Indicator"); doorHPIndicators = new DoorHPDisplayController[temp.Length]; for(int i = 0; i < doorHPIndicators.Length; ++i) { doorHPIndicators[i] = temp[i].GetComponent<DoorHPDisplayController>(); } if(GameObject.FindGameObjectWithTag("Reactor Display") != null) { reactorHPIndicator = GameObject.FindGameObjectWithTag("Reactor Display").GetComponent<ReactorCoreUIController>(); } }