private void Start() { // Setting up shooter animation anim = this.GetComponent <Animator>(); anim.SetBool("isShooter", true); soundEffectPlayer = GameObject.Find("SoundEffectController").GetComponent <SoundEffectsController>(); }
SoundEffectsController() { //save time instead of searching for the game controller //check if the instance is not null, we are creating more than one instance, warn us if (instance != null) { Debug.LogError("There's an instance already created, click on the next error to check it", gameObject); Debug.LogError("Original SoundEffectsController instance is", instance.gameObject); return; } instance = this; }
// Start is called before the first frame update void Start() { fireLocation = transform.Find("BulletSpawn"); cameraShake = GameObject.Find("Main Camera"); playerLaser = laserSounds.GetComponent <SoundEffectsController>(); playerEffects = GetComponent <SoundEffectsController>(); fireRange = GetComponentInChildren <FireBullet>(); for (int i = 9; i >= 0; i--) { damageWedges[i].SetActive(false); } damageOrb.SetActive(false); }
// Start is called before the first frame update void Start() { player = GameObject.Find("Player"); ship1 = GameObject.Find("ATLAS"); ship2 = GameObject.Find("GOLIATH"); ship3 = GameObject.Find("JUNO"); ship4 = GameObject.Find("ORION"); pointsSpawn = GameObject.Find("UIPoints").GetComponent <Transform>(); cameraShake = GameObject.Find("Main Camera"); target = Random.Range(0, 3); ship = GameManager.singleton.randShipNumber; nearColonyShip = false; animController = GetComponent <Animator>(); swarmController = GetComponent <SoundEffectsController>(); }
// Initialize the singleton instance. private void Awake() { // If there is not already an instance, set it to this. if (Instance == null) { Instance = this; } //If an instance already exists, destroy whatever this object is to enforce the singleton. else if (Instance != this) { Destroy(gameObject); } //Set the GameObject to DontDestroyOnLoad so that it won't be destroyed when reloading our scene. DontDestroyOnLoad(gameObject); }
// Start is called before the first frame update void Start() { scoreTextObject = GameObject.Find("Score"); scoreText = scoreTextObject.GetComponent <Text>(); Player = GameObject.Find("Player"); swarmSpawn = SwarmParent.transform; meteorSpawn = MeteorParent.transform; randomTime = UnityEngine.Random.Range(0, 2); if (randomTime == 0) { randShipDuration = 15f; } else { randShipDuration = 30f; } randShipNumber = UnityEngine.Random.Range(0, 4); managerController = GetComponent <SoundEffectsController>(); LoadScores(); }
void Start() { if (slotReels == null || slotReels.Length == 0) { slotReels = GetComponentsInChildren <SlotReel>(); } if (slotReels.Length == 0) { Debug.LogError(String.Format("No SlotReel components found in children of {0}", gameObject.name)); } if (!scoreTextDisplay) { scoreTextDisplay = FindObjectOfType <ScoreTextDisplay>(); } if (!scoreTextDisplay) { Debug.LogError(String.Format("No ScoreTextDisplay component assigned or found in scene for {0}", gameObject.name)); } if (!sfxController) { sfxController = FindObjectOfType <SoundEffectsController>(); } if (!sfxController) { Debug.LogError(String.Format("No SoundEffectsController component assigned or found in scene for {0}", gameObject.name)); } if (!winParticleSystem) { Debug.LogError(String.Format("No particleSystem component assigned for {0}", gameObject.name)); } }
// Use this for initialization void Start() { sec = GetComponent <SoundEffectsController> (); gcs = GameObject.FindGameObjectWithTag("GameController").GetComponent <GameControllerScript> (); Restart(); }
// Use this for initialization void Awake() { sec = GetComponent <SoundEffectsController> (); anim = GetComponent <Animator> (); rb2d = GetComponent <Rigidbody2D> (); }
// Start is called before the first frame update void Start() { radioController = GetComponent <SoundEffectsController>(); anim = GetComponent <Animator>(); }
private void Start() { levelManager = GameObject.Find("LevelManager").GetComponent <LevelManager>(); soundEffectPlayer = GameObject.Find("SoundEffectController").GetComponent <SoundEffectsController>(); }