private string scaleQuality; //This is to determine the way subscales are determined //------------------------------- //Use this for initialization //------------------------------- void Awake() { // if (instance == null) { instance = this; } else { Destroy(gameObject); return; } foreach (Sound s in sounds) { s.source = gameObject.AddComponent <AudioSource>(); s.source.clip = s.clip; s.source.volume = s.volume; s.source.pitch = s.pitch; } SetAllNotes(); SetScaleBase("D5"); SetScaleQuality("aeo"); SetSubScaleQuality("aeo"); SetSubScale(); }
// Use this for initialization void Start() { audioManager = FindObjectOfType <scr_AudioManager>(); //Sets the audioManager //For Changing Materials rend = this.GetComponent <Renderer>(); rend.enabled = true; //End of changing material stuff }
void Awake() { if (instance == null) { instance = this; } else if (instance != this) { Destroy(gameObject); } }
void Start() { m_Animator = GetComponent <Animator>(); m_Rigidbody = GetComponent <Rigidbody>(); m_Capsule = GetComponent <CapsuleCollider>(); m_CapsuleHeight = m_Capsule.height; m_CapsuleCenter = m_Capsule.center; m_Player = this.gameObject; m_Rigidbody.constraints = RigidbodyConstraints.FreezeRotationX | RigidbodyConstraints.FreezeRotationY | RigidbodyConstraints.FreezeRotationZ; m_OrigGroundCheckDistance = m_GroundCheckDistance; m_PSM = GetComponent <scr_PSM>(); m_AudioManager = Camera.main.GetComponent <scr_AudioManager>(); m_defaultSlidingSpeedMultiplier = m_MoveSpeedMultiplier; m_defaultMovingTurnSpeed = m_MovingTurnSpeed; m_TPUC = gameObject.GetComponent <scr_ThirdPersonUserControl>(); }
private void Start() { // get the transform of the main camera if (Camera.main != null) { m_Cam = Camera.main.transform; cam = Camera.main.transform; } else { Debug.LogWarning( "Warning: no main camera found. Third person character needs a Camera tagged \"MainCamera\", for camera-relative controls."); // we use self-relative controls in this case, which probably isn't what the user wants, but hey, we warned them! } // get the third person character ( this should never be null due to require component ) m_Character = GetComponent <scr_ThirdPersonCharacter>(); m_arrowSpawnpoint = GameObject.FindGameObjectWithTag("arrowSpawnPoint").transform; m_player = GameObject.FindGameObjectWithTag("Player"); m_rgd = gameObject.GetComponent <Rigidbody>(); m_audioManager = Camera.main.GetComponent <scr_AudioManager>(); m_psm = m_player.GetComponent <scr_PSM>(); }
void Start() { audioManager = FindObjectOfType <scr_AudioManager>(); }