protected override void OnStart() { sfx = SFX("Rayman2/Ambience/rain"); sfx.polyphony = SFXPlayer.Polyphony.Loop; sfx.SetSpace(SFXPlayer.Space.Global); SetRule("Drout"); }
void PlaySFX(SFXStates SFX) { GameObject clipGOInstance = Instantiate(audioSFX); SFXPlayer clipSFXInstance = clipGOInstance.GetComponent <SFXPlayer>(); clipSFXInstance.PlaySFX(SFX); }
public void Initialize(int seed) { rand = new System.Random(seed); PV = this.GetComponent <PhotonView>(); gameBoard = new Nine.Core.Board(ScrollSpeed, seed); Frame.transform.position = this.transform.position - new Vector3(0, 0, 4); position = this.GetComponent <Transform>(); blocks = new List <ViewBlock>(); for (int x = 0; x < Nine.Core.Board.ROW_WIDTH; x++) { for (int y = 0; y < Nine.Core.Board.COLUMN_HEIGHT; y++) { if (gameBoard.Blocks[y][x] != null) { blocks.Add ( ViewBlockFactory.CreateBlock(gameBoard.Blocks[y][x]) ); } } } Cursor = GameObject.Instantiate(Cursor); SoundPlayer = GameObject.Instantiate(SoundPlayer); }
void PlayExplosionSFX(SFXStates SFXStates) { GameObject explosionPrefab = Instantiate(explosionsSFX); SFXPlayer explosionPlayer = explosionPrefab.GetComponent <SFXPlayer>(); explosionPlayer.PlaySFX(SFXStates); }
public override IEnumerator DelayGrowl() { if (effect) { effect.Play(); } else { print("BoAtLeHeFireballPickup/DelayFireball: no effect found"); } yield return(new WaitForSeconds(1f)); if (SFXPlayer && AttackSound) { SFXPlayer.PlayClipOnce(AttackSound); } else { Boss.PlayGrowl(); print("BoAtRiHeLifePickup/DelayGrowl: missing SoundSystem or AttackSound"); } yield return(new WaitForSeconds(0.5f)); if (pickup) { //Pickup spawnedPickup = Instantiate(pickup, transform.position, Quaternion.identity); } else { print("BoAtLeHeFireballPickup/Activate: no pickup to instantiate found."); } }
void Awake() { pausedPanel = GameObject.Find("PausedPanel"); howToPlayPanel01 = GameObject.Find("HowToPlayPanel01"); howToPlayPanel02 = GameObject.Find("HowToPlayPanel02"); howToPlayPanel03 = GameObject.Find("HowToPlayPanel03"); gameClearPanel = GameObject.Find("GameClearPanel"); stageUIButtons = GameObject.Find("StageUIButtons"); camType01 = GameObject.Find("CamType01"); camType02 = GameObject.Find("CamType02"); camType03 = GameObject.Find("CamType03"); helpButton = GameObject.Find("HelpButton"); hideStageUIPanel = GameObject.Find("HideStageUIPanel"); pC = GameObject.Find("Player").GetComponent <PlayerController>(); cC = GameObject.Find("Camera").GetComponent <CameraController>(); // SFXPlayerの取得 sfx_UI = GetComponent <SFXPlayer>(); // MusicPlayerの取得 mP = GameObject.FindWithTag("Music").GetComponent <MusicPlayer>(); // Sliderの取得 slider_BGM = GameObject.FindWithTag("Slider_BGM").GetComponent <Slider>(); slider_SFX = GameObject.FindWithTag("Slider_SFX").GetComponent <Slider>(); }
public override void onUpdate(float dt) { base.onUpdate(dt); if (this.Timer.TotalMilliseconds > ControlLevelConstructor.ObjectSpawnDelay * this.Index) { int wall_count = WallSpawns?.Length ?? 0; int portal_count = PortalSpawns?.Length ?? 0; if (this.WallSpawns != null && this.Index < wall_count) { var spawn = this.WallSpawns[this.Index]; Engine.SpawnInstance(new Wall(spawn.X, spawn.Y, spawn.Scale)); if (this.SoundToggle) { SFXPlayer.Play(AvailableSounds.create_block, 0.75f); } } else if (this.PortalSpawns != null && this.Index < wall_count + portal_count) { var spawn = this.PortalSpawns[this.Index - wall_count]; Engine.SpawnInstance(new Portal(spawn)); } this.SoundToggle = !this.SoundToggle; this.Index++; if (this.Index > wall_count + portal_count - 1) { this.Destroy(); } } }
public override IEnumerator DelayGrowl() { if (effect) { effect.Play(); } else { print("BoAtRiHeHealing/DelayFireball: no effect found"); } yield return(new WaitForSeconds(1f)); if (SFXPlayer && AttackSound) { SFXPlayer.PlayClipOnce(AttackSound); } else { Boss.PlayGrowl(); print("BoAtRiHeHealing/DelayGrowl: missing SoundSystem or AttackSound"); } print("Boss casts healing"); Boss.AdjustHealthAndHealthPB(10f); //yield return new WaitForSeconds(0.5f); }
void Awake() { // Cameraの取得 cam = this.GetComponent <Camera>(); // playerの取得 player = GameObject.Find("Player"); // PlayerControllerの取得 pC = player.GetComponent <PlayerController>(); // Playerのスキンの取得 pSkin = GameObject.FindWithTag("PlayerTexture").GetComponent <SkinnedMeshRenderer>(); // facePosの取得 facePos = GameObject.Find("FacePos"); // camPosの取得 camPos = GameObject.Find("CamPos"); // ClearLightの取得 clearLight = GameObject.Find("ClearLight"); // ClearJudgementの取得 cJ = GameObject.Find("GameDirector").GetComponent <ClearJudgement>(); // 追跡用ロボットの取得 robot = GameObject.Find("TrackingRobot"); // InsideColorBoxのMeshRendererの取得 insideColorBox = GameObject.FindWithTag("InsideColorBox").GetComponent <MeshRenderer>(); // BringingPosの取得 bringingPos = GameObject.FindWithTag("BringingPos"); GameObject uiD = GameObject.Find("UIDirector"); // StageUIの取得 sUI = uiD.GetComponent <StageUI>(); // SFXPlayerの取得 sfx_UI = uiD.GetComponent <SFXPlayer>(); }
private void Awake() { Instance = this; _cameraPos = Camera.main.transform.position; volume = gameSettings.volume; gameSettings.OnVolumeChanged += SetVolume; }
protected virtual void CheckPlayerCollision(Collision collision) { if (collision.collider.tag == "Player") { rb.AddForce((rb.position - collision.rigidbody.position) * Config.CollisionForce, ForceMode.Impulse); SFXPlayer.PlayClip(SFX.PlayerBallHitBall); } }
public void Swap(Tile a, Tile b) { SFXPlayer.PlaySwapSound(Vector3.Lerp(a.transform.position, b.transform.position, 0.5f)); Vector3 pos = b.transform.position; b.transform.position = a.transform.position; a.transform.position = pos; }
public override void Dying() { attackPhase = false; isAlive = false; MrBAnimator.SetTrigger(triggers.DYING); StartCoroutine(OnDying()); SFXPlayer.PlayClipOnce(SFXDyingSound); }
private void Start() { CreateProjectileParent(); sfxPlayer = FindObjectOfType <SFXPlayer>(); myAudioSource = GetComponent <AudioSource>(); myAnimator = GetComponent <Animator>(); myAnimator.SetFloat("cycleOffset", UnityEngine.Random.Range(0f, 1f)); }
// Use this for initialization void Start() { sP = GetComponent <SpriteRenderer>(); gM = FindObjectOfType <GameManager>(); sfx = FindObjectOfType <SFXPlayer>(); sP.material.color = startColor; }
// Start is called before the first frame update void Start() { sFXPlayer = GameObject.Find("SFXPlayer").GetComponent <SFXPlayer>(); CoinX = Random.Range(0, 12) - 6; CoinRotation = Random.Range(0, 180) - 90; gameObject.transform.position = new Vector3(CoinX, this.transform.position.y, 0); gameObject.transform.rotation = new Quaternion(0, 0, CoinRotation, 0); }
/// <summary> /// Attacks the base which then calculates the caused damage. /// </summary> /// <param name="strength">The strength of the attack.</param> /// <returns>The caused damage.</returns> public double ApplyAttack(double strength) { double damage = strength; health -= damage; SFXPlayer.Play(Sound.Hit); return(damage); }
internal void StartGame() { cue.Shoot(OnHit); gameState = GameState.Game; uiManager.SetState(gameState); SFXPlayer.PlayClip(SFX.Go); MusicPlayer.SetFilterActive(false); }
void Start() { sfx = FindObjectOfType <SFXPlayer>(); gameObject.AddComponent <AudioSource>(); aS.clip = sound; aS.playOnAwake = false; aS.volume = sfx.SFX_Volume; button.onClick.AddListener(() => PlaySound()); }
void Start() { sfx = FindObjectOfType <SFXPlayer>(); gameObject.AddComponent <AudioSource>(); aS.clip = sound; aS.playOnAwake = false; aS.volume = sfx.SFX_Volume; toggle.onValueChanged.AddListener(delegate { PlaySound(); }); }
protected void Start() { if (_sfxPlayer == null) { _sfxPlayer = GetComponent <SFXPlayer>(); } collectibleSpriteRenderer = GetComponentInChildren <SpriteRenderer>(); collectibleCollider = GetComponent <Collider2D>(); }
IEnumerator restart() { SFXPlayer.PlayRageFullSound(); Time.timeScale = 0.0f; yield return(new WaitForSecondsRealtime(2f)); Time.timeScale = 1.0f; gm.restartScene(); }
private void CheclBallCollision(Collision collision) { if (collision.collider.tag == "BadBall" || collision.collider.tag == "GoodBall" || collision.collider.tag == "EightBall") { SFXPlayer.PlayClip(SFX.OtherBallHitBall); rb.AddForce((rb.position - collision.rigidbody.position) * Config.SecondaryCollisionForce, ForceMode.Impulse); } }
void Start() { onGround = true; standRotation = Quaternion.Euler(0f, 0f, 0f); rb = GetComponent <Rigidbody2D> (); armature = GetComponentInChildren <UnityArmatureComponent> (); TIM = FindObjectOfType <TouchInputMovement> (); m_SFXPlayer = FindObjectOfType <SFXPlayer> (); m_MusicPlayer = FindObjectOfType <MusicPlayer> (); }
// Start is called before the first frame update void Start() { MaxHP = 100f; CurHP = 100f; LookHP = 100f; isGameOver = false; sFXPlayer = GameObject.Find("SFXPlayer").GetComponent <SFXPlayer>(); HPBar = GameObject.Find("HP_Bar"); }
private void Awake() { if (instance == null) { instance = this; } else { Destroy(gameObject); } }
// Use this for initialization void Start() { gM = FindObjectOfType <GameManager>(); eAI = FindObjectOfType <EnemyAI>(); possibleMovements = new List <Vector3>(); possibleMovemenstWithEnemy = new List <Vector3>(); sfx = FindObjectOfType <SFXPlayer>(); FindPieceSquares(); }
internal void EndGame() { int bestScore = GetBestScore(); if (score > bestScore) { PlayerPrefs.SetInt(BestScoreKey, score); SFXPlayer.PlayClip(SFX.HighScore); fireworks.Play(); } SetState(GameState.Menu); }
void Awake() { if (instance == null) { instance = this; } else if (instance != this) { Destroy(gameObject); } DontDestroyOnLoad(gameObject); }
public void TakeDamage(Damage damage, Vector3 point) { onDamaged?.Invoke(damage); SFXPlayer.PlaySound(hitSound, 0.2f); var knockback = (transform.position - point).normalized * damage.knockback * 10; StartCoroutine(HitFlash()); StartCoroutine(Knockback(knockback)); SetHealth(data.health - damage.amount); }
void Awake() { sfx = GameObject.Find("SFX").GetComponent<SFXPlayer>(); level = GameObject.Find("LevelController").GetComponent<LevelController>(); }