void Start() { _sfxManager = GameObject.FindGameObjectWithTag("SFXManager").GetComponent <SFXController> (); _spriteRenderer = gameObject.transform.FindChild("Sprite").GetComponent <SpriteRenderer> (); GameOverText.enabled = false; PlayerDead = false; }
// Use this for initialization void Start() { PlayerCurrentHealth = playerMaxHealth; playerSpriteRenderer = GetComponent <SpriteRenderer>(); numberOfBlinks = (int)(blinkDuration / timeBetweenEachBlink); sfxController = FindObjectOfType <SFXController>(); }
// Attack animation variation //[SerializeField] //private int numAttackAnims = 1; void Start() { sfxc = GetComponent <SFXController>(); dropper = GetComponent <LootDropper>(); healthBar.SetMaxHealth(maxHealth); currHealth = maxHealth; }
protected override void OnStart() { base.OnStart(); _sfx = _bootstrap.GetController(ControllerTypes.SoundSFX) as SFXController; _io = _bootstrap.GetController(ControllerTypes.IO) as IOController; switch (CamResolution) { case Resolutions.FullHD: WebCam = new WebCamTexture(1920, 1080); break; case Resolutions.HD: WebCam = new WebCamTexture(1280, 720); break; case Resolutions.Vga: WebCam = new WebCamTexture(640, 480); break; } DebugDevices(); WebCam.deviceName = WebCamTexture.devices[0].name; }
public static IEnumerator TakeAITurn() { foreach (var state in TileState.AllTiles() .Where(x => x.Friendliness == Friendliness.Hostile) .OrderBy(x => - x.playOrder)) { if (state.Friendliness == Friendliness.Hostile) { yield return(TakeTurn(state)); if (state.unit != UnitType.Fire && state.alerted) { yield return(new WaitForSeconds(0.6f)); } } } foreach (var state in TileState.AllTiles()) { if (state.fireIncoming) { state.unit = UnitType.Fire; state.alerted = true; if (!Generator.isRunning) { SFXController.PlayFire(); yield return(new WaitForSeconds(0.1f)); } } } yield return(YieldFast.Get); }
private void Awake() { if (instance == null) { instance = this; } }
// Start is called before the first frame update void Start() { sentences = new Queue <string>(); dialoguePanel.SetActive(false); sfx = GameObject.Find("SFX Controller").GetComponent <SFXController>(); }
void Awake() { base.ID = (int)IDList.ID.Box; _happyStage = GameObject.FindGameObjectWithTag("HappyStage"); _sadStage = GameObject.FindGameObjectWithTag("SadStage"); _sfxManager = GameObject.FindGameObjectWithTag("SFXManager").GetComponent <SFXController> (); }
private void Start() { if (sfxController == null) { sfxController = GameObject.FindGameObjectWithTag("SFXController").GetComponent <SFXController>(); } }
protected override void OnStart() { base.OnStart(); _score = _bootstrap.GetController(ControllerTypes.Score) as ScoreController; _questions = _bootstrap.GetModel(ModelTypes.Questions) as QuestionsData; _questions.OnNewQuestionReady += QuestionDone; _questions.OnQuestionsOver += NoMoreQuestions; _timeController = _bootstrap.GetController(ControllerTypes.Time) as TimeController; if (_timeController != null) { _timeController.GameTimeout += TimeOut; } if (SaveToRegistry) { _registry = _bootstrap.GetController(ControllerTypes.Register) as RegisterController; } _sfx = _bootstrap.GetController(ControllerTypes.SoundSFX) as SFXController; _answers = new Dictionary <int, int>(); }
private void FixedUpdate() { bool wasGrounded = m_Grounded; m_Grounded = false; // The player is grounded if a circlecast to the groundcheck position hits anything designated as ground // This can be done using layers instead but Sample Assets will not overwrite your project settings. Collider2D[] colliders = Physics2D.OverlapCircleAll(m_GroundCheck.position, k_GroundedRadius, m_WhatIsGround); for (int i = 0; i < colliders.Length; i++) { if (colliders[i].gameObject != gameObject) { if (!wasGrounded) { SFXController.PlayClip(SFXClipName.JUMP); } m_Grounded = true; } } m_Anim.SetBool("Ground", m_Grounded); // Set the vertical animation m_Anim.SetFloat("vSpeed", m_Rigidbody2D.velocity.y); }
// Use this for initialization void Start() { //instantiate private variables _wood = 0; _power = 0; _food = 0; _numElectr = 0; _numScav = 0; _numLogger = 0; _checkTime5 = 5f; _checkTime10 = 10f; _checkTime20 = 20f; _enemies = new List <EnemyController>(); _friendlies = new List <CivilianController>(); _locations = new Location[5]; CreateLocations(); Debug.Log("Global Controller initialized."); //musicController = GameObject.FindWithTag("BGMController").GetComponent<BGMController>(); voiceController = GameObject.FindWithTag("SFXController").GetComponent <SFXController>(); voiceEffects = voiceController.GetComponents <AudioSource>(); radioSongSnapshots = new AudioMixerSnapshot[7]; radioSongSnapshots[0] = mixer.FindSnapshot("Overworld"); radioSongSnapshots[1] = mixer.FindSnapshot("TheGoodOne"); radioSongSnapshots[2] = mixer.FindSnapshot("Electrician"); radioSongSnapshots[3] = mixer.FindSnapshot("Forest"); radioSongSnapshots[4] = mixer.FindSnapshot("TheBadOne"); radioSongSnapshots[5] = mixer.FindSnapshot("TitleScreen"); radioSongSnapshots[6] = mixer.FindSnapshot("Battle"); }
public void Move(float move, bool crouch, bool jump) { if (m_Paused) { move = 0.0f; crouch = false; jump = false; } // If crouching, check to see if the character can stand up if (!crouch && m_Anim.GetBool("Crouch")) { // If the character has a ceiling preventing them from standing up, keep them crouching if (Physics2D.OverlapCircle(m_CeilingCheck.position, k_CeilingRadius, m_WhatIsGround)) { crouch = true; } } // Set whether or not the character is crouching in the animator m_Anim.SetBool("Crouch", crouch); //only control the player if grounded or airControl is turned on if (m_Grounded || m_AirControl) { // Reduce the speed if crouching by the crouchSpeed multiplier move = (crouch ? move * m_CrouchSpeed : move); // The Speed animator parameter is set to the absolute value of the horizontal input. m_Anim.SetFloat("Speed", Mathf.Abs(move)); // Move the character m_Rigidbody2D.velocity = new Vector2(move * m_MaxSpeed * speedFactor, m_Rigidbody2D.velocity.y); // If the input is moving the player right and the player is facing left... if (move > 0 && !m_FacingRight) { // ... flip the player. Flip(); } // Otherwise if the input is moving the player left and the player is facing right... else if (move < 0 && m_FacingRight) { // ... flip the player. Flip(); } } // If the player should jump... if (m_Grounded && jump && m_Anim.GetBool("Ground")) { // Add a vertical force to the player. m_Grounded = false; m_Anim.SetTrigger("Jump"); m_Anim.SetBool("Ground", false); m_Rigidbody2D.AddForce(new Vector2(0f, m_JumpForce)); SFXController.PlayClip(SFXClipName.JUMP); } m_Walking = m_Grounded && Math.Abs(move) > 0.05f; }
// Use this for initialization new void Start() { base.Start(); sfxController = FindObjectOfType <SFXController>(); ennemyAttacksManager = GetComponent <EnnemyAttacksManager>(); ennemyCombatController = GetComponent <EnnemyCombatController>(); }
// Start is called before the first frame update void Start() { sfx = GameObject.FindGameObjectWithTag("SFX").GetComponent <SFXController>(); FindFireKey(); projectileOffsetX = gameObject.GetComponent <MeshRenderer>().bounds.size.x / 2f; // get size of paddle gun object projectileOffsetX *= 0.9f; // bring offset in from edge projectileOffsetZ = ObjectPooler.SharedInstance.GetPooledObject1().GetComponent <MeshRenderer>().bounds.size.z / 2f; // set to edge of projectile }
private void Awake() { // Setting up references. m_GroundCheck = transform.Find("GroundCheck"); m_Rigidbody2D = GetComponent <Rigidbody2D> (); _playerAnim = gameObject.transform.FindChild("Sprite").GetComponent <Animator> (); _sfxManager = GameObject.FindGameObjectWithTag("SFXManager").GetComponent <SFXController> (); }
// Use this for initialization void Start() { EnnemyCurrentHealth = ennemyMaxHealth; immunityDurationCounter = immunityDuration; playerStats = FindObjectOfType <PlayerStats>(); sfxController = FindObjectOfType <SFXController>(); ennemyController = GetComponent <EnnemyController>(); }
private void Awake() { if (instance == null) { instance = this; } audioSource = GetComponent <AudioSource>(); }
private void Awake() { levelController = transform.parent.gameObject.GetComponent <LevelController>(); playerId = levelController.playerId; player = levelController.player; gameManager = levelController.gameManager; sfx = GameObject.FindGameObjectWithTag("SFX").GetComponent <SFXController>(); }
private void OnValueChanged(bool value) { if (value) { SFXController.PlayToggle(); PaintingRaycaster.SelectTool(ToolToUse); } }
void OnTriggerEnter2D(Collider2D collider2D) { if (collider2D.gameObject.tag == enemyTag) { SFXController.PlayClip(SFXClipName.SPLASH); Creature c = collider2D.gameObject.GetComponent <Creature>(); c.Hit(damage, force * Vector2.up); } }
// Use this for initialization void Start() { _camera = Camera.main; _cameraTransform = this.gameObject.transform; _initialSize = _camera.orthographicSize; _sfxManager = GameObject.FindGameObjectWithTag("SFXManager").GetComponent <SFXController> (); _sfxManager.PlaySFX(StartLevelClip, StartLevelVolume); }
protected static IEnumerator DoBehavior(TileState state) { Selector.SelectEnemy(state); int range = GetInteractionRange(state.unit); var neighbors = state.position.Neighbors(maxDistance: range).Select(Board.ToState); state.alerted = false; switch (state.unit) { case UnitType.Bomb: yield return(DestroyController.Destroy(state)); break; case UnitType.Fire: foreach (var neighborState in neighbors) { if (!neighborState.fireIncoming && neighborState.unit != UnitType.Fire && neighborState.unit != UnitType.Hole) { yield return(DestroyController.Destroy(neighborState)); SFXController.PlayFire(); neighborState.fireIncoming = true; if (!Generator.isRunning) { yield return(new WaitForSeconds(0.05f)); } } } break; case UnitType.Fang: yield return(new WaitForSeconds(0.7f)); var enemies = neighbors.Where(x => x.Friendliness == Friendliness.Friendly) .OrderBy(x => - x.moveOrder * 1000 + x.playOrder); if (enemies.Any()) { var target = enemies.First(); SFXController.PlayFire(); if (target.unit != UnitType.Shield) { yield return(DestroyController.Destroy(enemies.First())); } else { yield return(DestroyController.Destroy(state)); } // TODO: strike animation yield return(new WaitForSeconds(0.6f)); } break; } Selector.DeselectEnemy(state); yield return(YieldFast.Get); }
public float gravity_cutoff = -50f; //If the y velocity is below this value stop applying gravity private void Awake() { player = ReInput.players.GetPlayer(playerId); _rigidbody2D = this.GetComponent <Rigidbody2D>(); _characterCollider = this.GetComponent <BoxCollider2D>(); _xAnimator = this.GetComponent <XAnimator>(); sfxPlayer = this.GetComponent <SFXController>(); staminaSystem = this.GetComponent <StaminaSystem>(); }
void BlowUp(Vector2 position) { blownUp = true; sprite.sprite = explosionSprite; trailSystem.Stop(); blastSystem.Play(); SFXController.PlayClip(SFXClipName.SHOOT); this.transform.position = position; Invoke("Kill", 0.5f); }
protected override void OnStart() { _controller.OnGameStart += StartCount; _timeflow = UnityEngine.Time.realtimeSinceStartup; _sfx = _bootstrap.GetController(ControllerTypes.SoundSFX) as SFXController; _image.color = new Color(0, 0, 0, 0); }
// Start is called before the first frame update void Start() { controller = GetComponent <Controller2D> (); jugador = GameObject.Find("Chawa"); enemyTransform = GetComponent <Transform> (); currentHealth = maxHealth; sfx = GameObject.Find("SFX Controller").GetComponent <SFXController>(); }
// Use this for initialization void Start () { sfx = GameObject.FindGameObjectWithTag ("sfx").GetComponent<SFXController> (); _lars = GameObject.Instantiate (LarsNormal, posicaoLars, LarsNormal.transform.rotation) as GameObject; _lars.SetActive (true); _larsatirando = GameObject.Instantiate (LarsAtirando, posicaoLars, LarsAtirando.transform.rotation) as GameObject; _larsatirando.SetActive (false); }
void Start() { GameController gc = GameController.gameController; gc.addResourceGrowthRate (populationGrowth, materialGrowth, pollutionGrowth, foodGrowth); //Play the building sound effect GameObject musicPlayer = GameObject.FindWithTag ("SFX"); SFX = musicPlayer.GetComponent ("SFXController") as SFXController; SFX.playClip (0); }
// Start is called before the first frame update void Start() { jugador = GameObject.Find("Chawa"); enemyTransform = GetComponent <Transform> (); enemyAnimator = GetComponent <Animator>(); sfx = GameObject.Find("SFX Controller").GetComponent <SFXController>(); StartCoroutine(cambiarEstado(2)); }
void Awake() { if (instance == null) { instance = this; } else { Destroy(this); } }
void Awake() { base.ID = (int)IDList.ID.Dummy; _pickups = GameObject.FindGameObjectsWithTag("Pickup"); _interactive = GameObject.FindGameObjectsWithTag("Interactive"); _happyStage = GameObject.FindGameObjectWithTag("HappyStage"); _sadStage = GameObject.FindGameObjectWithTag("SadStage"); _player = GameObject.FindGameObjectWithTag("Player").GetComponent <PlayerPickup> (); _sfxManager = GameObject.FindGameObjectWithTag("SFXManager").GetComponent <SFXController> (); }
// Use this for initialization void Start () { enabled_shoot = true; //Capta o controlador de SFX - Para chamar as funcoes sfx = GameObject.FindGameObjectWithTag ("sfx").GetComponent<SFXController> (); //vikingInstanciar (); timeFlecha = 1.0f; flechaInstanciar (); //Inicializa a vida life = 3; }
void Start () { sfxController = gameObject.GetComponent<SFXController>(); hum = FMOD_StudioSystem.instance.GetEvent("event:/alpaca_hum"); hum.getParameter("occlusion", out occlusion); hum.getParameter("distanceFromSmallRm", out distanceFromSmallRm); hum.getParameter("distanceFromLargeRm", out distanceFromLargeRm); distanceFromLargeRm.setValue(distLargeRm); distanceFromSmallRm.setValue(distSmallRm); // set up snap shot for displaced sound var system = FMOD_StudioSystem.instance.System; FMOD.Studio.EventDescription description; system.getEvent("snapshot:/displacedSound", out description); description.createInstance(out displacedSound); }
// Use this for initialization void Start () { bool _isRight; _colidiu = false; //Capta o controlador de SFX - Para chamar as funcoes sfx = GameObject.FindGameObjectWithTag ("sfx").GetComponent<SFXController> (); _unit = GameObject.FindGameObjectWithTag ("GameMaker").GetComponent<UnitF2> (); _unit.procuraCasas (); _isRight = _unit.isRight(); score = GameObject.FindGameObjectWithTag ("score").GetComponent<Score> (); _carregaPedra = CarregaPedra (); SetaPedra (_carregaPedra); if (gameObject.name == "Dragon-blue(Clone)") { _velocidade = _unit.velAzul (); danoPontuacao = 10; sfx.playHitBlue (); } if (gameObject.name == "dragonYellow(Clone)") { _velocidade = _unit.velAmarelo (); danoPontuacao = 20; sfx.playHitYel (); } if (gameObject.name == "dragonBlack(Clone)") { _velocidade = _unit.velAmarelo (); danoPontuacao = 30; } if (_isRight) { GetComponent<Rigidbody2D>().velocity = new Vector2 (-_velocidade, 0); } else { transform.localScale = new Vector3 (-transform.localScale.x, transform.localScale.y, transform.localScale.z); GetComponent<Rigidbody2D>().velocity = new Vector2 (_velocidade, 0); } }
// Use this for initialization void Start () { sfx = GameObject.FindGameObjectWithTag ("sfx").GetComponent<SFXController> (); //Inicializa as variaveis minVertical = 1.0f; minHorizontal = -10.56f; maxVertical = 2.9f; maxHorizontal = 10.13f; //Define as variaveis de velocidades Iniciais _veloAzul = 3; _veloAmarelo = 2; _veloPreto = 3; _veloVermelho = 1; timeInicial = 5.0f; incrementseedTime = 8.0f; Invoke ("geradorDragao", timeInicial); InvokeRepeating ("horda",incrementseedTime , incrementseedTime); }
// Use this for initialization void Start () { life = 7; indexdano = 0; sfx = GameObject.FindGameObjectWithTag ("sfx").GetComponent<SFXController> (); }
private void SetupSFX() { sfxController = gameObject.GetComponent<SFXController>(); gunshotAudio = FMOD_StudioSystem.instance.GetEvent("event:/flute"); gunshotAudio.getParameter("distanceFromLargeRm", out distanceFromLargeRm); gunshotAudio.getParameter("distanceFromSmallRm", out distanceFromSmallRm); GameObject s = GameObject.Find("Building Small/Audio Zone"); GameObject l = GameObject.Find("Building Large/Audio Zone"); smallRoom = s.GetComponent<Transform>(); largeRoom = l.GetComponent<Transform>(); InvokeRepeating("FindNearestAudioOpenings", 0, 1); }
// Use this for initialization void Start () { life = 3; //Capta o controlador de SFX - Para chamar as funcoes sfx = GameObject.FindGameObjectWithTag ("sfx").GetComponent<SFXController> (); }