void Start() { _multiSoundPlayer = GetComponent <MultiSoundPlayer>(); //Add all contactswitch blocks to list foreach (Transform child in transform) { if (child.name == "Blocks") { foreach (Transform childchild in child) { _blocks.Add(childchild.GetComponent <ContactSwitch>()); } } if (child.name == "Prize") { _prize = child.gameObject; } } //Disable prize _prize.SetActive(false); //Count the amount of inactive blocks _lastNumberOfUnactivatedBlocks = _blocks.Count(x => !x.On); }
private void Awake() { _rigid = GetComponent <Rigidbody2D>(); _collider = GetComponent <Collider2D>(); _flippable = GetComponent <Flippable>(); _multiSoundPlayer = GetComponent <MultiSoundPlayer>(); }
public void Awake() { //Get text object TMP = GetComponent <TextMeshProUGUI>(); //get soundplayer _multiSoundPlayer = GetComponent <MultiSoundPlayer>(); }
private void Start() { _multiSoundPlayer = GetComponent <MultiSoundPlayer>(); if (UnityEngine.Random.value <= 0.5f) { Destroy(gameObject); } }
private void Awake() { _rigid = GetComponent <Rigidbody2D>(); _flippable = GetComponent <Flippable>(); _multiSoundPlayer = GetComponent <MultiSoundPlayer>(); //Sets up the default ground mask for OnGround2D() CommonExtensions.DefaultGroundMask = Commons.Masks.GroundOnly; }
protected override void Awake() { base.Awake(); _health = GetComponentInParent <HealthController>(); _multiSoundPlayer = GetComponent <MultiSoundPlayer>(); _spotPlayer = transform.parent.transform.Cast <Transform>().FirstOrDefault(x => x.name.Equals("Body")) ?.gameObject .GetComponent <SpotPlayer>(); }
private void Start() { //Get audio source. This is only in use when "UseGUI is false" _multiSoundPlayer = GetComponent <MultiSoundPlayer>(); //Get textmeshpro component TMP_GUI = GetComponent <TextMeshProUGUI>(); if (TMP_GUI) { UseGUI = true; return; } TMP = GetComponent <TextMeshPro>(); }
void Start() { _multiSoundPlayer = GetComponent <MultiSoundPlayer>(); //Find button up and button down children foreach (Transform child in transform) { if (child.name.Equals("ButtonUp")) { _buttonUp = child.gameObject; } else if (child.name.Equals("ButtonDown")) { _buttonDown = child.gameObject; } } //start the button as unpressed Pressed = false; _buttonUp.SetActive(true); _buttonDown.SetActive(false); }
private void Awake() { _multiSoundPlayer = GetComponent <MultiSoundPlayer>(); }
private void Start() { _playerMaxSpeed = _playerGroundController.Value.MaxSpeed; _multiSoundPlayer = GetComponent <MultiSoundPlayer>(); _mainCamera = Camera.main; }
private void Awake() { _label = GetComponent <TextMeshProUGUI>(); _smack = GetComponent <TextSmack>(); _multiSoundPlayer = GetComponent <MultiSoundPlayer>(); }
protected override void Awake() { base.Awake(); _exploder = GetComponent <ParticleExplosion>(); _multiSoundPlayer = GetComponent <MultiSoundPlayer>(); }
private void Awake() { _rigidbody = GetComponent <Rigidbody2D>(); _animator = GetComponent <SpriteAnimator>(); _multiSoundPlayer = GetComponent <MultiSoundPlayer>(); }