void Start() { PlayerPrefs.SetInt("golRyu", 0); PlayerPrefs.SetInt("golKen", 0); apito = GetComponent <AudioSource> (); audioManager = FindObjectOfType <AudioMenager> (); }
private void Awake() { if (audioMenager != null) { Destroy(gameObject); return; } else { audioMenager = this; } DontDestroyOnLoad(gameObject); //SOUNDS foreach (Sound sound in sounds) { sound.source = gameObject.AddComponent <AudioSource>(); sound.source.clip = sound.clip; sound.source.volume = sound.volume; sound.source.pitch = sound.pitch; sound.source.loop = sound.loop; } //MUSICS foreach (Sound music in musics) { music.source = gameObject.AddComponent <AudioSource>(); music.source.clip = music.clip; music.source.volume = music.volume; music.source.pitch = music.pitch; music.source.loop = music.loop; } }
private void Awake() { if (instance == null) { instance = this; } else { Destroy(gameObject); return; } DontDestroyOnLoad(gameObject); }
// Start is called before the first frame update void Start() { audioObj = GameObject.Find("SoundController").GetComponent <AudioMenager>(); controller = GameObject.Find("Controller"); anim = GetComponent <Animator>(); rb = GetComponent <Rigidbody2D>(); playerCollider = GetComponent <BoxCollider2D>(); startCollX = playerCollider.size.x; startCollY = playerCollider.size.y; currGravityScale = rb.gravityScale; currGlideTime = glideTime; }
void Awake() { if (instance == null) { instance = this; } else { Destroy(gameObject); return; } DontDestroyOnLoad(gameObject); 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; s.source.loop = s.loop; } }
// Start is called before the first frame update void Start() { audioObj = GameObject.Find("SoundController").GetComponent <AudioMenager>(); scoreCounter = GameObject.Find("Controller").GetComponent <ScoreCounter>(); //scoreText.GetComponent<ScoreCounter>(); }
// Start is called before the first frame update void Start() { audioObj = GameObject.Find("SoundController").GetComponent <AudioMenager>(); speedX = GetComponent <Rigidbody2D>().velocity.x; }
void Start() { audioManager = FindObjectOfType <AudioMenager> (); }