Esempio n. 1
0
    // Start is called before the first frame update
    void Start()
    {
        _playerManagerScript   = gameManager.GetComponent <PlayerManager>();
        _gameManagerScript     = gameManager.GetComponent <GameManager>();
        _newSoundManagerScript = NewSoundManager.instance;
        _managerAudio          = _newSoundManagerScript.GetMyAudios();

        //set la caméra sur la première face de l'arène.

        _faceStored        = _currentFace;
        transform.rotation = _faceClassScript.faceTab[_currentFace].arenaRotation.rotation;
        _currentSlowMotion = _gameManagerScript.GetSlowMotionBool();



        for (int i = 0; i < _faceClassScript.faceTab[_currentFace].wallToHideNextToFace.Length; i++)
        {
            if (_faceClassScript.faceTab[_currentFace].wallToHideNextToFace[i].GetComponent <MeshRenderer>() != null)
            {
                _faceClassScript.faceTab[_currentFace].wallToHideNextToFace[i].GetComponent <MeshRenderer>().enabled = false;
            }
            if (_faceClassScript.faceTab[_currentFace].wallToHideNextToFace[i].transform.childCount != 0)
            {
                for (int j = 0; j < _faceClassScript.faceTab[_currentFace].wallToHideNextToFace[i].transform.childCount; j++)
                {
                    _faceClassScript.faceTab[_currentFace].wallToHideNextToFace[i].transform.GetChild(j).gameObject.SetActive(false);
                }
            }
        }
    }
Esempio n. 2
0
 // Start is called before the first frame update
 void Start()
 {
     _wallManagerScript = GameObject.FindWithTag("WallController").GetComponent <WallManager>();
     _anim  = GetComponent <Animator>();
     _timer = _timerMax;
     _newSoundManagerScript = NewSoundManager.instance;
 }
Esempio n. 3
0
    // Start is called before the first frame update
    void Start()
    {
        if (GameObject.FindWithTag("MenuManager") != null)
        {
            _menuInformationScript = GameObject.FindWithTag("MenuManager").GetComponent <GetMenuInformation>();
        }


        _newSoundManagerScript = NewSoundManager.instance;
        _scoreManagerScript    = GameObject.FindWithTag("GameController").GetComponent <ScoreManager>();
        _playerManagerScript   = GameObject.FindWithTag("GameController").GetComponent <PlayerManager>();


        _myRb        = GetComponent <Rigidbody2D>();
        _playerTrail = GetComponent <TrailRenderer>();
        _animator    = GetComponent <Animator>();

        powerJauge.fillAmount = 0;
        powerJaugeParent.gameObject.SetActive(false);

        _velocityMax = (powerMax * speed) * (powerMax * speed);



        onomatopéesSprite.enabled = false;
        sweatParticles.SetActive(false);
        UltiFxStates[0].SetActive(false);
        UltiFxStates[1].SetActive(false);
        UltiFxStates[2].SetActive(false);
        wallHitSpriteTimerMax = onomatopéeTimerMax;

        string thisTag = gameObject.tag;

        switch (thisTag)
        {
        case "Player1":
            wallSpriteTransform = GameObject.FindWithTag("WallHitSprite1").transform;
            break;

        case "Player2":
            wallSpriteTransform = GameObject.FindWithTag("WallHitSprite2").transform;
            break;

        case "Player3":
            wallSpriteTransform = GameObject.FindWithTag("WallHitSprite3").transform;
            break;

        case "Player4":
            wallSpriteTransform = GameObject.FindWithTag("WallHitSprite4").transform;
            break;
        }
        wallSpriteTransform.gameObject.SetActive(false);

        playerSprite  = transform.GetChild(0).gameObject;
        originalScale = playerSprite.transform.localScale.x;
    }
Esempio n. 4
0
 private void Awake()
 {
     _playerManagerScript = GameObject.FindWithTag("GameController").GetComponent <MenuPlayerManager>();
     _animator            = GetComponent <Animator>();
     _audioSource         = GetComponent <AudioSource>();
     _trailRenderer       = GetComponent <TrailRenderer>();
     _myRb                  = GetComponent <Rigidbody2D>();
     _particuleContact      = this.transform.GetChild(1).gameObject;
     _newSoundManagerScript = NewSoundManager.instance;
 }
Esempio n. 5
0
    private void Awake()
    {
        gameObject.layer = 15;

        //récupération des scripts
        _arenaRotationScript   = arena.GetComponent <ArenaRotation>();
        _wallManagerScript     = GameObject.FindWithTag("WallController").GetComponent <WallManager>();
        _gameManagerScript     = GameObject.FindWithTag("GameController").GetComponent <GameManager>();
        _scoreManagerScript    = GameObject.FindWithTag("GameController").GetComponent <ScoreManager>();
        _faceClassScript       = GameObject.FindWithTag("GameController").GetComponent <FaceClass>();
        _wallProprieties       = GetComponent <WallProprieties>();
        _newSoundManagerScript = NewSoundManager.instance;
    }
Esempio n. 6
0
    // Start is called before the first frame update
    void Start()
    {
        _gameManagerScript     = GameObject.FindWithTag("GameController").GetComponent <GameManager>();
        _playerManagerScript   = GameObject.FindWithTag("GameController").GetComponent <PlayerManager>();
        nbrPlayers             = _gameManagerScript.playerList.Count;
        _playerScore           = new int[nbrPlayers];
        _newSoundManagerScript = NewSoundManager.instance;

        for (int i = _playerScore.Length; i-- > 0;)
        {
            _playerScore[i] = 0;
        }
        UpdateUI();
        gamePanel.SetActive(true);
    }
Esempio n. 7
0
    // Start is called before the first frame update
    void Start()
    {
        //set les paramètres de la shockwave au début pour qu'elle soit lançable
        shockWaveCooldown      = 0;
        shockWaveDuration      = shockWaveDurationMax;
        _playerManagerScript   = GameObject.FindWithTag("GameController").GetComponent <PlayerManager>();
        _playerEntityScript    = GetComponent <PlayerEntity>();
        _shockWaveHitScript    = GetComponent <ShockwaveHit>();
        _scoreManagerScript    = GameObject.FindWithTag("GameController").GetComponent <ScoreManager>();
        cameraMain             = Camera.main;
        _newSoundManagerScript = NewSoundManager.instance;
        if (GameObject.FindWithTag("MenuManager") != null)
        {
            _menuInformationScript = GameObject.FindWithTag("MenuManager").GetComponent <GetMenuInformation>();
        }



        string thisTag = gameObject.tag;

        switch (thisTag)
        {
        case "Player1":
            _playerScoreImage = GameObject.FindWithTag("PlayerOneImage").GetComponent <Image>();
            _ultiCrack        = GameObject.FindWithTag("PlayerOneCrack");
            break;

        case "Player2":
            _playerScoreImage = GameObject.FindWithTag("PlayerTwoImage").GetComponent <Image>();
            _ultiCrack        = GameObject.FindWithTag("PlayerTwoCrack");
            break;

        case "Player3":
            _playerScoreImage = GameObject.FindWithTag("PlayerThreeImage").GetComponent <Image>();
            _ultiCrack        = GameObject.FindWithTag("PlayerThreeCrack");
            break;

        case "Player4":
            _playerScoreImage = GameObject.FindWithTag("PlayerFourImage").GetComponent <Image>();
            _ultiCrack        = GameObject.FindWithTag("PlayerFourCrack");
            break;
        }
        _ultiCrack.SetActive(false);
        _playerEntityScript.PlayerScoreImageSet(_playerScoreImage);
        _crackStartingColor = _ultiCrack.GetComponent <SpriteRenderer>().color;
    }
Esempio n. 8
0
    // Start is called before the first frame update
    void Start()
    {
        suddenDeathPlayerToDisappear = new List <GameObject>();

        _newSoundMangerScript = NewSoundManager.instance;
        _managerAudios        = new AudioSource[_newSoundMangerScript.AudioLength()];
        _managerAudios        = _newSoundMangerScript.GetMyAudios();
        currentFace           = _arenaRotationScript._currentFace;

        //set la position de départ des joueurs
        for (int i = 0; i < playerList.Count; i++)
        {
            playerList[i].transform.position = _faceClassScript.faceTab[currentFace].playerStartingPosition[i].position;
            playerList[i].SetActive(true);
            playersEntityScripts[i] = playerList[i].GetComponent <PlayerEntity>();
            attackTestScripts[i]    = playerList[i].GetComponent <AttackTest>();
        }

        _currentSlowMotion = _isSlowMotion;



        _previousFaceAnimator = _faceClassScript.faceTab[currentFace].arenaWall.GetComponent <Animator>();
        _previousFaceAnimator.SetBool("isRising", true);
        hasRoundBegun = true;

        _wallManagerScript.GetRandomArena();
        for (int i = 0; i < _faceClassScript.faceTab[currentFace].arenaWall.transform.childCount; i++)
        {
            _faceClassScript.faceTab[currentFace].arenaWall.transform.GetChild(i).GetComponent <WallProprieties>().UpdateProprieties();
            _faceClassScript.faceTab[currentFace].arenaWall.transform.GetChild(i).GetComponent <WallChange>().InitiateWall();
        }
        for (int i = 0; i < _faceClassScript.faceTab[currentFace].arenaWall.transform.childCount; i++)
        {
            _faceClassScript.faceTab[currentFace].arenaWall.transform.GetChild(i).GetComponent <WallProprieties>().IAmConnectedIMustConnect();
        }
        if (_wallManagerScript.GetThisRoundLD() != null)
        {
            //currentLD = Instantiate(_faceClassScript.faceTab[currentFace].levelDesign);
            currentLD = _wallManagerScript.GetThisRoundLD();
        }
    }
Esempio n. 9
0
    private void Awake()
    {
        if (instance == null)
        {
            instance = this;
        }
        else if (instance != this)
        {
            Destroy(gameObject);
        }

        _myAudios      = GetComponents <AudioSource>();
        _playerCharges = new AudioSource[4];
        for (int i = 0; i < 4; i++)
        {
            _playerCharges[i] = _myAudios[i];
        }
        if (GameObject.FindWithTag("MenuManager") != null)
        {
            _menuInformationScript = GameObject.FindWithTag("MenuManager").GetComponent <GetMenuInformation>();
        }
    }