Exemple #1
0
    private void Die()
    {
        RpcPlayDeathEffect();

        IsDead = true;
        for (int i = 0; i < disableOnDeath.Length; i++)
        {
            disableOnDeath[i].enabled = false;
        }
        for (int i = 0; i < disableGameObjectOnDeath.Length; i++)
        {
            disableGameObjectOnDeath[i].SetActive(false);
        }

        rigidbody.isKinematic = true;

        foreach (var col in colliders)
        {
            col.enabled = false;
        }

        GameObject _deathEffect = Instantiate(deathEffect, transform.position, Quaternion.identity);

        Destroy(_deathEffect, 3f);

        if (isLocalPlayer)
        {
            audioManager = GetComponent <PlayerAudioManager>();
            GameManager.insantce.SetSceneCamraActive(true);
            playerUIInstance.SetActive(false);
        }

        Debug.Log(transform.name + " is DEAD!");
        StartCoroutine(Respawn());
    }
Exemple #2
0
 void Start()
 {
     weaponManager    = GetComponent <WeaponManager>();
     audioManager     = GetComponent <PlayerAudioManager>();
     playerUIInstance = GetComponent <PlayerSetup>().playerUIInstance;
     motor            = GetComponent <PlayerMotor>();
     CancelInvoke("Shoot");
 }
 void Awake()
 {
     m_CapsuleCollider2D   = GetComponent <CapsuleCollider2D>();
     m_PlayerAudioManager  = GetComponentInChildren <PlayerAudioManager>();
     m_Rigidbody2D         = GetComponent <Rigidbody2D>();
     m_PlayerAnimator      = GetComponentInChildren <Animator>();
     m_SpriteRenderer      = GetComponentInChildren <SpriteRenderer>();
     landingParticleSystem = GetComponentInChildren <ParticleSystem>();
 }
Exemple #4
0
 // Use this for initialization
 void Start()
 {
     thisRigidbody    = GetComponent <Rigidbody2D>();
     levelManager     = GameObject.Find("Manager").GetComponent <LevelManager>();
     damageLowerBound = (int)(damageLowerBound * (levelManager.floorNumber));
     damageUpperBound = (int)(damageUpperBound * (levelManager.floorNumber));
     audioManager     = GameObject.Find("Player").GetComponent <PlayerAudioManager>();
     audioManager.arrowLooseAudio();
 }
Exemple #5
0
 // Start is called before the first frame update
 void Start()
 {
     if (!Instance)
     {
         Instance = this;
     }
     characterController = GetComponent <CharacterController>();
     audioManager        = GetComponent <PlayerAudioManager>();
 }
Exemple #6
0
    private Colors _fallbackColor;  //BLIND_FIX fallback in case player gets stuck as black

    public void Init()
    {
        PlayerUI    = GetComponentInChildren <PlayerUI>();
        playerAudio = GetComponent <PlayerAudioManager>();
        playerAudio.Init();
        if (controlWithKeyboard)
        {
            playerNumber = 5;
        }
    }
Exemple #7
0
 private void GatherPlayerComponents()
 {
     entity                      = GetComponentInChildren <Entity>();
     playerController            = GetComponentInChildren <PlayerController>();
     weaponSlot                  = GetComponentInChildren <WeaponSlot>();
     playerAnimController        = GetComponentInChildren <PlayerAnimationController>();
     playerPickupManager         = GetComponentInChildren <PlayerPickUpManager>();
     playerInteractionController = GetComponentInChildren <PlayerInteractionController>();
     playerAudioManager          = GetComponentInChildren <PlayerAudioManager>();
     playerSkinSync              = GetComponentInChildren <SyncPlayerSkin>();
 }
    // Use this for initialization
    void Start()
    {
        playerCtrl    = GameObject.Find("Player").GetComponent <PlayerController>();
        thisRigidbody = GetComponent <Rigidbody2D>();
        travelingLeft = playerCtrl.facingLeft;
        stats         = gameObject.GetComponent <AbilityStats>();
        audioManager  = GameObject.Find("Player").GetComponent <PlayerAudioManager>();

        damageLowerBound = stats.damageLowerBound;
        damageUpperBound = stats.damageUpperBound;
    }
 // Start is called before the first frame update
 void Start()
 {
     if (!Instance)
     {
         Instance = this;
     }
     ConfigurePauseMusicAudioSource();
     ConfigureAmbientMusicAudioSource();
     ConfigureHoverAudioSource();
     ConfigureShootAudioSource();
     ConfigureCollectAudioSource();
 }
Exemple #10
0
    // Use this for initialization
    void Start()
    {
        levelManager     = GameObject.Find("Manager").GetComponent <LevelManager>();
        damageLowerBound = (int)(damageLowerBound * (levelManager.floorNumber));
        damageUpperBound = (int)(damageUpperBound * (levelManager.floorNumber));

        playerCtrl    = GameObject.Find("Player").GetComponent <PlayerController>();
        thisRigidbody = GetComponent <Rigidbody2D>();
        travelingLeft = playerCtrl.facingLeft;
        stats         = gameObject.GetComponent <AbilityStats>();
        spellTimer    = spellDuration;
        audioManager  = GameObject.Find("Player").GetComponent <PlayerAudioManager>();
    }
Exemple #11
0
    // Use this for initialization
    void Start()
    {
        player         = GameObject.Find("Player");
        health         = player.GetComponent <PlayerHealth>();
        controller     = player.GetComponent <PlayerController>();
        canvasRenderer = GetComponentInChildren <CanvasRenderer>();
        pickupManager  = GameObject.Find("Manager").GetComponent <ItemPickupManager>();
        audioManager   = player.GetComponent <PlayerAudioManager>();

        levelManager = GameObject.Find("Manager").GetComponent <LevelManager>();

        amount = (int)(amount * levelManager.floorNumber);
    }
Exemple #12
0
    private void Awake()
    {
        PlayerAnimationManager = GetComponentInChildren <PlayerAnimationManager>();
        PlayerAnimationManager.SetManager(this);

        PlayerAttributes = GetComponent <PlayerAttributes>();
        PlayerAttributes.SetManager(this);

        PlayerMovement = GetComponent <PlayerMovement>();
        PlayerMovement.SetManager(this);

        PlayerAudioManager = GetComponentInChildren <PlayerAudioManager>();
        PlayerAudioManager.SetManager(this);
    }
Exemple #13
0
    // Use this for initialization
    void Awake()
    {
        //Set the reset timers
        animationReset = animationTime;
        recoverReset   = recoverTime;
        animator       = GetComponent <Animator>();

        cameraObj         = transform.Find("Camera").gameObject;
        cameraDefLocalPos = cameraObj.transform.localPosition;

        renderers     = GetComponentsInChildren <Renderer>();
        deathParticle = GetComponentInChildren <DeathParticleManager>();
        blockParticle = GetComponentInChildren <BlockParticleManager>();
        PAM           = this.gameObject.GetComponent <PlayerAudioManager>();
    }
 void AvoidNULLProblem()
 {
     if (_PlayerStatementSystem == null)
     {
         _PlayerStatementSystem = GetComponentInParent <PlayerStatementSystem>();
     }
     if (_PlayerAudioManager == null)
     {
         _PlayerAudioManager = GetComponentInParent <PlayerAudioManager>();
     }
     if (_PlayerCtrl == null)
     {
         _PlayerCtrl = GetComponentInParent <PlayerCtrl>();
     }
 }
Exemple #15
0
    // Use this for initialization
    void Start()
    {
        stateManager = GameObject.FindGameObjectWithTag("StateManager").GetComponent <GameStateManager>();
        stateManager.GetComponent <GameStateManager>().currentState       = GameStateManager.GameState.restart;
        stateManager.GetComponent <GameStateManager>().restartScreenTimer = 7;

        gameOver = true;

        CreatePlayers();
        RespawnPlayers();

        if (restartScreen)
        {
            restartScreen.SetActive(true);
        }

        PAM = players[0].GetComponent <PlayerAudioManager>();
    }
Exemple #16
0
    private void Start()
    {
        localPlayer    = PlayerManager.localPlayer;
        pcontroller    = localPlayer.GetComponentInChildren <PlayerAnimationController>();
        paudio         = localPlayer.GetComponent <PlayerAudioManager>();
        nameText.color = GameManager.personalColor;

        terminalAudioSource = GetComponent <AudioSource>();

        SetVictoryEmote(0);
        SetVictoryMusic(0);
        SetEmote(0);

        terminalAudioSource.clip = paudio.WinMusic;
        audioVisualizer.SetActive(false);

        skinSyncer = localPlayer.GetComponent <SyncPlayerSkin>();

        GameManager.OnGameStateChanged += DisableEnableOnStateChange;
    }
Exemple #17
0
    // Use this for initialization
    void Start()
    {
        itemToBePickedUpStats = ability.GetComponent <AbilityStats>();

        if (gameObject.name == "LMBAbilityButton")
        {
            abilitySlot  = GameObject.FindGameObjectWithTag("LMBAbilitySlot").GetComponent <UseAbility>();
            stats        = item.GetComponent <AbilityStats>();
            abilityPanel = GameObject.FindGameObjectWithTag("LMBSprite").GetComponent <Image>();
        }
        else if (gameObject.name == "RMBAbilityButton")
        {
            abilitySlot  = GameObject.FindGameObjectWithTag("RMBAbilitySlot").GetComponent <UseAbility>();
            stats        = item.GetComponent <AbilityStats>();
            abilityPanel = GameObject.FindGameObjectWithTag("RMBSprite").GetComponent <Image>();
        }

        player       = GameObject.Find("Player");
        audioManager = player.GetComponent <PlayerAudioManager>();
    }
    // Use this for initialization
    void Start()
    {
        playerCtrl    = GameObject.Find("Player").GetComponent <PlayerController>();
        thisRigidbody = GetComponent <Rigidbody2D>();
        travelingLeft = playerCtrl.facingLeft;
        stats         = gameObject.GetComponent <AbilityStats>();

        if (travelingLeft)
        {
            thisRigidbody.AddForce(new Vector2(-speed, speed / 2));
        }
        else
        {
            thisRigidbody.AddForce(new Vector2(speed, speed / 2));
        }


        damageLowerBound = stats.damageLowerBound;
        damageUpperBound = stats.damageUpperBound;
        audioManager     = GameObject.Find("Player").GetComponent <PlayerAudioManager>();
    }
Exemple #19
0
    //Function : AvoidNullProblem
    // Method : This Function is Mainly used For GetThe Component which is NULL
    void AvoidNullProblem()
    {
        if (_instance == null)
        {
            _instance = this;
        }

        if (_pi == null)
        {
            _pi = GetComponent <PlayerInput>();
        }
        if (_PlayerAudioManager == null)
        {
            _PlayerAudioManager = GetComponent <PlayerAudioManager>();
        }
        if (_anim == null)
        {
            _anim = GetComponentInChildren <Animator>();
        }
        if (_rgbd == null)
        {
            _rgbd = GetComponent <Rigidbody>();
        }
        if (_PlayerStatementSys == null)
        {
            _PlayerStatementSys = GetComponent <PlayerStatementSystem>();
        }
        if (_cap == null)
        {
            _cap = GetComponent <CapsuleCollider>();
        }
        if (HitTrigger == null)
        {
            Debug.Log("Please Add The Object To The Inspector");
        }
    }
Exemple #20
0
 public override void Awake()
 {
     base.Awake();
     this.audioManager = GetComponent <PlayerAudioManager>();
     UpdateHealthUI();
 }
Exemple #21
0
 private void Start()
 {
     audioManager = FindObjectOfType <PlayerAudioManager>();
 }
Exemple #22
0
 private void Start()
 {
     playerUIInstance = GetComponent <PlayerSetup>().playerUIInstance;
     audioManager     = GetComponent <PlayerAudioManager>();
 }