void Update() { //Adjust pitch based on WASD movement. // thisAudio.pitch = remapRange(rb.velocity.magnitude, 0, 10, 0f, 1.5f); thisAudio.pitch = AudioDirector.remapRange(rb.velocity.magnitude, 0, 10, 0f, 1.5f); thisAudio.pitch = Mathf.Clamp(thisAudio.pitch, 0.45f, 1.45f); }
void Awake() { m_collidersArray = GetComponentsInChildren<BoxCollider>(); m_hingeJoint = GetComponentInChildren<HingeJoint>(); m_playerBall = GetComponentInChildren<PlayerBall>().gameObject; m_audioSource = GetComponentInChildren<AudioSource>(); m_audioDirector = FindObjectOfType<AudioDirector>(); }
// Update is called once per frame void Update() { BasicAttack(); if (!aimLockOn) { basicAttack.panStereo = AudioDirector.remapRange(MouseLook.instance.mouseLookX, -90f, 90f, -1f, 1f); } else // only happens for one frame. { basicAttack.panStereo = attackPan; } attackVolume = basicAttack.volume; LockAim(); }
// Start is called before the first frame update void Start() { if (_instance == null) { _instance = this; } else { Destroy(this.gameObject); } mainCamera = Camera.main; source = this.GetComponent <AudioSource>(); // New gameObject to store audio clips. oneShotClips = new GameObject("OneShotAudio"); oneShotClips.transform.parent = this.transform; }
private void Awake() { if (Instance == null) { Instance = this; } else if (Instance != this) { Destroy(gameObject); } DontDestroyOnLoad(gameObject); //Set the appropriate clips and volume on music and danger loop, then play musicSource.clip = backgroundMusic; musicSource.volume = musicVolume; musicSource.Play(); dangerSource.clip = dangerLoop; dangerSource.volume = 0f; dangerSource.Play(); }
private void Awake() { if (Instance == null) { Instance = this; } else if (Instance != this) { Destroy(gameObject); } DontDestroyOnLoad(gameObject); //Set the appropriate clips and volume on music and danger loop //Play scheduled so they start at the same time musicSource.clip = backgroundMusic; musicSource.volume = musicVolume; musicSource.PlayScheduled(Beat.Clock.Instance.AtNextMeasure()); dangerSource.clip = dangerLoop; dangerSource.volume = 0f; dangerSource.PlayScheduled(Beat.Clock.Instance.AtNextMeasure()); }
private static GameDirector gameDirector; //シングルトン void Start() { if (ui_Director == null) { Debug.Log("ui_Directorがnull"); } if (playerDirector == null) { Debug.Log("player_Directorがnull"); } if (bossDirector == null) { Debug.Log("boss_Directorがnull"); } if (animDirector == null) { Debug.Log("anim_Directorがnull"); } enemyDirectors = new List <EnemyDirector>(); otherDirectors = new List <OtherDirector>(); cameraDirector = Camera.main.GetComponent <CameraDirector>(); charaFreeze = GetComponent <CharacterFreeze>(); cameraFreeze = GetComponent <CameraFreeze>(); otherFreeze = GetComponent <OtherFreeze>(); audioDirector = Camera.main.GetComponent <AudioDirector>(); gameDirector = this; canDoDirector = true; isWeaponFreezed = false; weaponStateMachine = playerDirector.GetComponentInChildren <WeaponStateMachine>(); freezeCount = 0; freezeList = new List <GameObject>(); isPaused = false; Application.targetFrameRate = 60; }
// Use this for initialization void Start() { audioDirector = (AudioDirector)GameObject.Find("AudioDirector").GetComponent("AudioDirector"); }
// Use this for initialization void Start() { audioDirector = (AudioDirector) GameObject.Find("AudioDirector").GetComponent("AudioDirector"); }
void Start() { m_playersManager = FindObjectOfType<PlayersManager>(); m_audioSource = GetComponent<AudioSource>(); m_audioDirector = FindObjectOfType<AudioDirector>(); }