Esempio n. 1
0
 protected override void OnStart()
 {
     sfx           = SFX("Rayman2/Ambience/rain");
     sfx.polyphony = SFXPlayer.Polyphony.Loop;
     sfx.SetSpace(SFXPlayer.Space.Global);
     SetRule("Drout");
 }
Esempio n. 2
0
    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);
    }
Esempio n. 4
0
    void PlayExplosionSFX(SFXStates SFXStates)
    {
        GameObject explosionPrefab = Instantiate(explosionsSFX);
        SFXPlayer  explosionPlayer = explosionPrefab.GetComponent <SFXPlayer>();

        explosionPlayer.PlaySFX(SFXStates);
    }
Esempio n. 5
0
    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.");
        }
    }
Esempio n. 6
0
    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();
                }
            }
        }
Esempio n. 8
0
    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);
    }
Esempio n. 9
0
    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>();
    }
Esempio n. 10
0
 private void Awake()
 {
     Instance   = this;
     _cameraPos = Camera.main.transform.position;
     volume     = gameSettings.volume;
     gameSettings.OnVolumeChanged += SetVolume;
 }
Esempio n. 11
0
 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);
     }
 }
Esempio n. 12
0
    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;
    }
Esempio n. 13
0
 public override void Dying()
 {
     attackPhase = false;
     isAlive     = false;
     MrBAnimator.SetTrigger(triggers.DYING);
     StartCoroutine(OnDying());
     SFXPlayer.PlayClipOnce(SFXDyingSound);
 }
Esempio n. 14
0
 private void Start()
 {
     CreateProjectileParent();
     sfxPlayer     = FindObjectOfType <SFXPlayer>();
     myAudioSource = GetComponent <AudioSource>();
     myAnimator    = GetComponent <Animator>();
     myAnimator.SetFloat("cycleOffset", UnityEngine.Random.Range(0f, 1f));
 }
Esempio n. 15
0
    // 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);
 }
Esempio n. 17
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);
        }
Esempio n. 18
0
 internal void StartGame()
 {
     cue.Shoot(OnHit);
     gameState = GameState.Game;
     uiManager.SetState(gameState);
     SFXPlayer.PlayClip(SFX.Go);
     MusicPlayer.SetFilterActive(false);
 }
Esempio n. 19
0
 void Start()
 {
     sfx = FindObjectOfType <SFXPlayer>();
     gameObject.AddComponent <AudioSource>();
     aS.clip        = sound;
     aS.playOnAwake = false;
     aS.volume      = sfx.SFX_Volume;
     button.onClick.AddListener(() => PlaySound());
 }
Esempio n. 20
0
 void Start()
 {
     sfx = FindObjectOfType <SFXPlayer>();
     gameObject.AddComponent <AudioSource>();
     aS.clip        = sound;
     aS.playOnAwake = false;
     aS.volume      = sfx.SFX_Volume;
     toggle.onValueChanged.AddListener(delegate { PlaySound(); });
 }
Esempio n. 21
0
 protected void Start()
 {
     if (_sfxPlayer == null)
     {
         _sfxPlayer = GetComponent <SFXPlayer>();
     }
     collectibleSpriteRenderer = GetComponentInChildren <SpriteRenderer>();
     collectibleCollider       = GetComponent <Collider2D>();
 }
Esempio n. 22
0
    IEnumerator restart()
    {
        SFXPlayer.PlayRageFullSound();
        Time.timeScale = 0.0f;
        yield return(new WaitForSecondsRealtime(2f));

        Time.timeScale = 1.0f;
        gm.restartScene();
    }
Esempio n. 23
0
 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);
     }
 }
Esempio n. 24
0
 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> ();
 }
Esempio n. 25
0
    // 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");
    }
Esempio n. 26
0
 private void Awake()
 {
     if (instance == null)
     {
         instance = this;
     }
     else
     {
         Destroy(gameObject);
     }
 }
Esempio n. 27
0
    // Use this for initialization
    void Start()
    {
        gM  = FindObjectOfType <GameManager>();
        eAI = FindObjectOfType <EnemyAI>();
        possibleMovements          = new List <Vector3>();
        possibleMovemenstWithEnemy = new List <Vector3>();
        sfx = FindObjectOfType <SFXPlayer>();


        FindPieceSquares();
    }
Esempio n. 28
0
    internal void EndGame()
    {
        int bestScore = GetBestScore();

        if (score > bestScore)
        {
            PlayerPrefs.SetInt(BestScoreKey, score);
            SFXPlayer.PlayClip(SFX.HighScore);
            fireworks.Play();
        }
        SetState(GameState.Menu);
    }
Esempio n. 29
0
 void Awake()
 {
     if (instance == null)
     {
         instance = this;
     }
     else if (instance != this)
     {
         Destroy(gameObject);
     }
     DontDestroyOnLoad(gameObject);
 }
Esempio n. 30
0
        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>();
 }