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()); }
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>(); }
// 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(); }
// Start is called before the first frame update void Start() { if (!Instance) { Instance = this; } characterController = GetComponent <CharacterController>(); audioManager = GetComponent <PlayerAudioManager>(); }
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; } }
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(); }
// 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>(); }
// 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); }
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); }
// 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>(); } }
// 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>(); }
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; }
// 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>(); }
//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"); } }
public override void Awake() { base.Awake(); this.audioManager = GetComponent <PlayerAudioManager>(); UpdateHealthUI(); }
private void Start() { audioManager = FindObjectOfType <PlayerAudioManager>(); }
private void Start() { playerUIInstance = GetComponent <PlayerSetup>().playerUIInstance; audioManager = GetComponent <PlayerAudioManager>(); }