public void PlayPlayerSFX(PlayerSFX soundEffect, string sourceName = "Global") { if (DoesSFXSourceExist(sourceName)) { m_SFXSources[sourceName].PlayOneShot(m_PlayerSoundEffectClips[(int)soundEffect]); } }
private void Start() { rb = GetComponent <Rigidbody>(); player_animator = GetComponent <Animator>(); playerSFX = FindObjectOfType <PlayerSFX>(); gameSFX = FindObjectOfType <GameSFX>(); }
void Awake() { graphics = GetComponent <PlayerGraphics> (); cameraController = Camera.main.GetComponent <CameraController> (); comboController = GameObject.FindGameObjectWithTag("ComboText").GetComponent <ComboController>(); playerSFX = GetComponent <PlayerSFX>(); enemiesMask = LayerMask.GetMask("Enemies"); }
void Start() { musicManager = GetComponentInChildren <MusicManager>(); ambienceManager = GetComponentInChildren <AmbienceManager>(); gameSFX = GetComponentInChildren <GameSFX>(); playerSFX = GetComponentInChildren <PlayerSFX>(); musicManager.GetComponent <AudioSource>().clip = sceneDefaultMusic; }
void Awake() { rb = GetComponent <Rigidbody2D>(); anim = GetComponent <Animator>(); boxCollider = GetComponent <BoxCollider2D>(); playerState = GetComponent <PlayerStateManager>(); playerHealth = GetComponent <PlayerHealth>(); sound = GetComponent <PlayerSFX>(); }
private void Awake() { m_Health = 100; m_IsDead = false; m_PlayerInput = GetComponent <PlayerInput>(); m_PlayerMovement = GetComponent <PlayerMovement>(); m_PlayerAnimation = GetComponent <PlayerAnimation>(); m_WeaponController = GetComponent <WeaponController>(); m_PlayerSFX = GetComponent <PlayerSFX>(); }
public AudioClip GetSoundClip(PlayerSFX effect) { foreach (PlayerSFXItem item in playerSounds) { if (item.Effect == effect) { return(item.Clip); } } return(null); }
public static List <SoundSetting> GetSSOfType(this List <SoundSetting> _ss, PlayerSFX _type) { List <SoundSetting> result = new List <SoundSetting>(); foreach (SoundSetting item in _ss) { if (item.type == _type) { result.Add(item); } } return(result); }
private void Start() { playerSFX = GetComponent <PlayerSFX>(); player = GetComponent <Player>(); cc = GetComponent <ColorChange>(); checkpoint = transform.position; try { fairycc = fairy.GetComponent <ColorChange>(); } catch (Exception e) { Debug.Log("No Fairy in scene"); } }
private void Start() { charControl = GetComponent <CharacterController>(); playerInput = GetComponent <PlayerInput>(); cam = camController.GetComponentInChildren <Camera>().transform; anim = GetComponent <Animator>(); playerSFX = GetComponent <PlayerSFX>(); playerStats = GetComponent <PlayerStats>(); weaponManager = GetComponent <WeaponManager>(); stateMachine = new StateMachine <PlayerController>(this); upperStateMachine = new StateMachine <PlayerController>(this); SetUpStateMachine(); }
private void Awake() { //If there is not already an instance of PlayerSFX, set it to this if (Instance == null) { Instance = this; } //else If there is already an instance of PlayerSFX, destroy it because there can only be one highlander. else if (Instance != this) { Destroy(this.gameObject); } //Make the PlayerSFX not destroyed when scenes change or reload. DontDestroyOnLoad(this.gameObject); }
public void PlaySFX(PlayerSFX requestedSFX) { switch (requestedSFX) { case PlayerSFX.DASH: { source.pitch = 1; source.PlayOneShot(Dash); break; } case PlayerSFX.GROUND_POUND: { source.pitch = 1; source.PlayOneShot(GroundPound); break; } case PlayerSFX.IMPACT: { source.pitch = 1 + Random.Range(-0.5f, 0.5f); if (Random.Range(0, 10) < 5) { source.PlayOneShot(Impact1); } else { source.PlayOneShot(Impact2); } break; } case PlayerSFX.JUMPLAND: { source.pitch = 1 + Random.Range(-0.4f, 0.4f); source.PlayOneShot(JumpLanding); break; } default: Debug.LogWarning("Requested SFX not found"); break; } Debug.Log("SFX Sound Played!"); }
void Awake() { playerGraphicsController = GetComponent <PlayerGraphics>(); cameraController = Camera.main.GetComponent <CameraController> (); playerSFX = GetComponent <PlayerSFX>(); }
void Awake() { base.Awake(); onChargeState = onShootState = onDashState = onHurtState = onDieState = false; _anim = GetComponent<Animator>(); _sfx = GetComponent<PlayerSFX>(); _charge = transform.Find("Charge"); _weapon = transform.Find("Weapon"); _arm = transform.Find("Arm"); _radar = transform.FindChild("Radar").GetComponent<EnemiesRadar>(); }
public void Start() { controller._player = transform; _anim = GetComponent<Animator>(); _sprite = (SpriteRenderer)GetComponent<Renderer>(); _rigidbody = GetComponent<Rigidbody2D>(); _sfx = GetComponent<PlayerSFX>(); _charge = transform.Find("Charge"); collisionLevel = GetComponent<CollisionLevel>(); _life = UiController.self.Life; /*To Do: Pog*/ }
public void PlaySFXByIndex(int SFXIndex) { PlayerSFX _RequestedSFX = (PlayerSFX) SFXIndex; PlaySFX(_RequestedSFX); }
public void PlayClip(PlayerSFX clip, bool loop = false, bool randomTime = false) { PlayClip((int)clip, loop, randomTime); }