void Awake() { sfx = FindObjectOfType <SfxPlayer>(); music = FindObjectOfType <MusicPlayer>(); StartGame(); }
public void Ready(int i_TeamIndex) { if (IsValidIndex(i_TeamIndex)) { if (!IsReady(i_TeamIndex)) { // Cancel current selection, if any. SelectionCache cache = m_SelectionsCache[i_TeamIndex]; if (!cache.IsEmpty()) { GameObject lastSelection = cache[0]; if (lastSelection != null) { tnUICharacterSlot slot = lastSelection.GetComponent <tnUICharacterSlot>(); if (slot != null) { slot.Deselect(); } } cache.Clear(); } m_Confirmations[i_TeamIndex] = true; UpdateOverlay(i_TeamIndex); SfxPlayer.PlayMain(m_ReadySfx); } } }
public override void PlayerCommand(GameObject player) { if (hasCustomer && hasOrder) { if (Player.SetHasOrder(true, orderNumber)) { Debug.Log("Get Order"); hasOrder = false; orderBubble.sprite = foodBubble[orderNumber]; } else { //waring order } } if (hasCustomer && !hasFood && orderNumber == Player.instance.foodNumber) { if (Player.SetHasFood(false, -1)) { Debug.Log("Sent Food"); hasFood = true; foodNumber = orderNumber; hero.ReceivedFood(); SfxPlayer.PlaySfx(SfxEnum.HeroGetFood); orderBubble.sprite = null; foodOnTable.sprite = food[foodNumber]; } } player.GetComponent <Animator>().SetTrigger("SE"); }
void Start() { sfxPlayer = FindObjectOfType <SfxPlayer>(); player = GetComponent <Rigidbody2D>(); src = transform.Find("Source"); reticle = src.Find("Reticle"); characterInfo = gameObject.GetComponentInChildren <CharacterInfo>(); spriteRenderer = characterInfo.GetComponent <SpriteRenderer>(); animator = characterInfo.gameObject.GetComponent <Animator>(); switch (PlayerNumber) { case PlayerNumber.PLAYER_1: playerNum = 1; break; case PlayerNumber.PLAYER_2: playerNum = 2; break; case PlayerNumber.PLAYER_3: playerNum = 3; break; case PlayerNumber.PLAYER_4: playerNum = 4; break; case PlayerNumber.PLAYER_N: //Oh god ryan why break; } }
public void SetDeviceSide(tnUI_MP_DeviceSide i_Side, bool i_Immediatly) { if (!m_IsActive) { return; } if (i_Side != m_CurrentSide) { m_CurrentSide = i_Side; CancelCoroutine(); SfxPlayer.PlayMain(m_Move_Sfx); if (!i_Immediatly) { m_CurrentCorroutine = MoveDevice(); StartCoroutine(m_CurrentCorroutine); } else { Vector2 targetPosition = GetIdealPosition(); Internal_SetDeviceAnchoredPosition(targetPosition); } } }
protected override IEnumerator EndMatchSequence() { // Final wistle. SfxPlayer.PlayMain(m_FinalWhistleSfx); // Wait. yield return new WaitForSeconds(m_WaitBetweenFinalWhistleAndResults); // Close HUD. UI.ClosePanel(m_CelebrationPanel); // Show results. UI.OpenPanel(m_FlatBackgroundPanel); if (m_SubbuteoMatchResultsPanel != null) { m_SubbuteoMatchResultsPanel.Config(this); } UI.OpenPanel(m_SubbuteoMatchResultsPanel); // Wait. yield return new WaitForSeconds(m_WaitAfterResults); }
private void SpawnFlame() { var position = transform.position; var spawnPos = position / 1.6f; var spawnX = Mathf.Round(spawnPos.x) * 1.6f; var spawnY = Mathf.Round(spawnPos.y) * 1.6f; spawnPos = new Vector3(spawnX, spawnY, 0); // Check if the position is clear. var results = Physics2D.OverlapBoxAll(spawnPos, Vector2.one * 0.4f, 0); foreach (var coll in results) { if (coll.CompareTag("Flame")) { return; } } // Spawn the flame. SfxPlayer.PlayAudio(_castClip); _ammo--; _timeSinceAction = 0; var flame = Instantiate(_flamePrefab, spawnPos, Quaternion.identity); flame.GetComponent <Flame>().SetOwner(gameObject); }
private void OnDestroy() { if (instance == this) { instance = null; } }
// Scrolls through the list of sounds when invoken, and sets the sound settings void Awake() { if (instance == null) { instance = this; } else { Destroy(gameObject); return; } DontDestroyOnLoad(gameObject); if (sounds != null) { 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; print(s.name); } } }
public void Awake() { ship = GameObject.Find("Federico"); playspace = GameObject.FindWithTag("PlaySpace"); sPlayer = GameObject.Find("SfxPlayer").GetComponent <SfxPlayer>(); //speedometer = GameObject.Find("Speedometer").GetComponent<Text>(); //helm = GameObject.Find("HelmPanel"); }
void Awake() { if(Instance != null) { print("too many instance"); } Instance = this; }
public override void _Ready() { _animationPlayer = this.GetNode <AnimationPlayer>(); _heartBeat = GetNode <HeartBeat>("/root/HeartBeat"); _heartBeat.SafeConnect(nameof(HeartBeat.OnHeartBeat), this, nameof(OnHeartBeat)); _explodeSfx = this.GetNode <SfxPlayer>(); }
private void Start() { inputManager = ClassManager.instance.inputManager; prefabManager = ClassManager.instance.prefabManager; groundTileManager = ClassManager.instance.groundTileManager; sfxPlayer = ClassManager.instance.sfxPlayer; updateUiFoodCounts(); }
public void SelectByIndex(int i_Index) { Internal_SelectByIndex(i_Index); // Play sfx. SfxPlayer.PlayMain(m_SelectionChangedSfx); }
void Awake() { // Set up the references. gunParticles = gunBarrel.GetComponent <ParticleSystem> (); gunLine = gunBarrel.GetComponent <LineRenderer> (); gunLight = gunBarrel.GetComponent <Light> (); //faceLight = GetComponentInChildren<Light> (); sfxPlayer = GetComponent <SfxPlayer>(); }
public void Initialize(Vector2 position, float zRotationDeg, Vector2 v, SfxPlayer sfxPlayer) { this.transform.position = position; this.transform.eulerAngles = new Vector3(0, 0, zRotationDeg); this.v = v; this.timeOfCreation = Time.time; this.sfxPlayer = sfxPlayer; }
public override void OnEnter() { if (!audioClip.IsNone && audioClip.Value != null) { SfxPlayer.PlayMain((AudioClip)audioClip.Value, audioMixerGroup, volume); } Finish(); }
public override void CustomerCommand(GameObject customer) { if (customer.GetComponent <Hero>().isCheckout) { checkoutList.Add(customer.GetComponent <Hero>()); SfxPlayer.PlaySfx(SfxEnum.HeroCheckout); UpdateHeroPosition(); } }
public override void _Ready() { _fadingLabelScene = ResourceLoader.Load <PackedScene>($"res://gameplay/TemporaryLabel.tscn"); _kaboomScene = ResourceLoader.Load <PackedScene>($"res://gameplay/Kaboom.tscn"); RemainingHealth = MaxHealth; Root = this.FindRoot(); _tookDamageSfx = this.GetNode <SfxPlayer>(); }
public override void _Ready() { _notesSfx = GetNode <SfxPlayer>("NotesSfxPlayer"); _snareSfx = GetNode <SfxPlayer>("SnareSfxPlayer"); _bassSfx = GetNode <SfxPlayer>("BassSfxPlayer"); _heartBeat = GetNode <HeartBeat>("/root/HeartBeat"); _heartBeat.SafeConnect(nameof(HeartBeat.OnHeartBeat), this, nameof(OnHeartBeat)); }
private void OnTriggerEnter2D(Collider2D other) { if (other.CompareTag("Player")) { SfxPlayer.PlayAudio(_powerUpClip); other.GetComponent <PlayerAction>().ChangeAmmo(1); Destroy(gameObject); } }
private void Start() { spriteManager = ClassManager.instance.spriteManager; inputManager = ClassManager.instance.inputManager; ageManager = ClassManager.instance.ageManager; prefabManager = ClassManager.instance.prefabManager; sfxPlayer = ClassManager.instance.sfxPlayer; restock(); }
public void AddHeroCheckin(Hero hero) { if (!IsCheckinFull()) { checkinList.Add(hero); UpdateHeroPosition(); SfxPlayer.PlaySfx(SfxEnum.HeroCheckIn); } }
private void OnTriggerEnter2D(Collider2D other) { if (other.CompareTag("Player")) { SfxPlayer.PlayAudio(_powerUpClip); LightUp(); Destroy(gameObject); } }
public override void CustomerCommand(GameObject customer) { hasCustomer = true; customer.transform.position = this.customer.transform.position; hero = customer.GetComponent <Hero>(); hero.AssignTable(this); SfxPlayer.PlaySfx(SfxEnum.HeroHungry); orderBubble.sprite = unknownBubble; customer.GetComponent <Animator>().SetTrigger("SW"); }
void Awake() { img = gameObject.GetComponent <Image>(); GameObject sfxObj = GameObject.Find("SfxPlayer"); sfx = sfxObj.GetComponent <SfxPlayer>(); coroutine = Flicker(waitTime); StartCoroutine(coroutine); }
// Prepares (instantiates) n amount of audio sources based on the buffer size specified. public void PrepareSfxBuffers(float volume) { if (m_sfx != null) { m_sfx.Stop(); m_sfx = null; } m_sfx = new SfxPlayer(m_audioClip, m_SfxBufferSize); m_sfx.SetVolume(volume); }
private void Start() { playerInventory = ClassManager.instance.playerInventory; groundTileManager = ClassManager.instance.groundTileManager; selectedTileController = ClassManager.instance.selectedTileController; sfxPlayer = ClassManager.instance.sfxPlayer; plantManager = ClassManager.instance.plantManager; ageManager = ClassManager.instance.ageManager; foodManager = ClassManager.instance.foodManager; shopManager = ClassManager.instance.shopManager; }
public override void _Ready() { _battleSystem = GetNode<BattleSystem>("/root/BattleSystem"); _heartBeat = GetNode<HeartBeat>("/root/HeartBeat"); _heartBeat.SafeConnect(nameof(HeartBeat.OnHeartBeat), this, nameof(OnHeartBeat)); _root = this.FindRoot(); _vision = _root.AsNode().GetNode<Vision>(); _hitWallSfx = this.GetNode<SfxPlayer>(); }
protected override void OnGoldenGoalStart() { base.OnGoldenGoalStart(); int currentTick = TrueSyncManager.ticksMain; if (!m_GoldenGoalEffectsTicks.Contains(currentTick)) { SfxPlayer.PlayMain(m_GoldenGoalSfx); m_GoldenGoalEffectsTicks.Add(currentTick); } }
/* * private GameObject statScrOverlayEBrake; * private GameObject statScrOverlayHelm; * private GameObject statScrOverlayNav; * private GameObject statScrOverlayManual; * private GameObject statScrOverlayAirlock; * private GameObject statScrOverlayShields; */ private void Awake() { //Debug.Log(gameObject.GetComponent<SpriteRenderer>().sprite.name); anim = GetComponent <Animator>(); sfxObj = GameObject.Find("SfxPlayer"); sfx = sfxObj.GetComponent <SfxPlayer>(); Debug.Log("SFX: " + sfx); throttleLoop = GetComponent <AudioSource>(); // Debug.Log(gameObject.GetComponent<SpriteRenderer>().sprite.name); }