Пример #1
0
    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);
    }
Пример #2
0
 private void Awake()
 {
     _rigid            = GetComponent <Rigidbody2D>();
     _collider         = GetComponent <Collider2D>();
     _flippable        = GetComponent <Flippable>();
     _multiSoundPlayer = GetComponent <MultiSoundPlayer>();
 }
Пример #3
0
    public void Awake()
    {
        //Get text object
        TMP = GetComponent <TextMeshProUGUI>();

        //get soundplayer
        _multiSoundPlayer = GetComponent <MultiSoundPlayer>();
    }
Пример #4
0
    private void Start()
    {
        _multiSoundPlayer = GetComponent <MultiSoundPlayer>();

        if (UnityEngine.Random.value <= 0.5f)
        {
            Destroy(gameObject);
        }
    }
Пример #5
0
    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;
    }
Пример #6
0
    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>();
    }
Пример #7
0
    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>();
    }
Пример #8
0
    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);
    }
Пример #9
0
 private void Awake()
 {
     _multiSoundPlayer = GetComponent <MultiSoundPlayer>();
 }
Пример #10
0
 private void Start()
 {
     _playerMaxSpeed   = _playerGroundController.Value.MaxSpeed;
     _multiSoundPlayer = GetComponent <MultiSoundPlayer>();
     _mainCamera       = Camera.main;
 }
Пример #11
0
 private void Awake()
 {
     _label            = GetComponent <TextMeshProUGUI>();
     _smack            = GetComponent <TextSmack>();
     _multiSoundPlayer = GetComponent <MultiSoundPlayer>();
 }
Пример #12
0
 protected override void Awake()
 {
     base.Awake();
     _exploder         = GetComponent <ParticleExplosion>();
     _multiSoundPlayer = GetComponent <MultiSoundPlayer>();
 }
Пример #13
0
 private void Awake()
 {
     _rigidbody        = GetComponent <Rigidbody2D>();
     _animator         = GetComponent <SpriteAnimator>();
     _multiSoundPlayer = GetComponent <MultiSoundPlayer>();
 }