예제 #1
0
 void task_5()
 {
     BoomBox.Play(SoundEnum.Sound.CLICK);
     ToggleThisMenu();
     optionsMenu.enabled  = false;
     controlsMenu.enabled = false;
 }
예제 #2
0
    public void TickRogolf()
    {
        if (ball.InHole())
        {
            BoomBox.Play(Sound.SINK);
            game.SetState(new PostHoleState(game));
        }
        else
        {
            // TODO - debug
            List <Tuple <string, int> > scoreInfo = game.GetScore().AddShotScore();
            string s = string.Join(", ",
                                   (from item in scoreInfo select String.Format("{0}: {1}", item.Item1, item.Item2.ToString())));
            GodOfUI gui = GameObject.Find("UICanvas").GetComponent <GodOfUI>();
            gui.WriteBonus(s);
            gui.InvokeBonus(2f);

            int shotScore = (from item in scoreInfo select item.Item2).Sum();
            game.GetScore().AddCredit(shotScore);

            if (ball.InWater())
            {
                ball.Reset();
                game.GetHoleBag().GetCurrentHoleData().IncrementStrokes();
                BoomBox.Play(Sound.SPLASH);
            }

            game.SetState(new PrepareState(game));
        }
    }
예제 #3
0
 void task_4()
 {
     BoomBox.Play(SoundEnum.Sound.CLICK);
     activeCharacter++;
     if (activeCharacter >= powValues.Length)
     {
         activeCharacter = powValues.Length - 1;
     }
     updateCharacterText();
 }
예제 #4
0
 void task_3()
 {
     BoomBox.Play(SoundEnum.Sound.CLICK);
     activeCharacter--;
     if (activeCharacter < 0)
     {
         activeCharacter = 0;
     }
     updateCharacterText();
 }
 //called in the begining
 void Start()
 {
     //links scripts with eachother
     Movement         = GameObject.FindObjectOfType <MovementChar>();
     opengameobject   = GameObject.FindObjectOfType <OpenGameObject>();
     pickup           = GameObject.FindObjectOfType <PickUp>();
     panelpuzzle      = GameObject.FindObjectOfType <PanelPuzzle>();
     boomBox          = GameObject.FindObjectOfType <BoomBox>();
     deur1            = GameObject.FindObjectOfType <Deur1>();
     SwitchScript     = GameObject.FindObjectOfType <Switch>();
     wasmachinePuzzel = GameObject.FindObjectOfType <WasmachinePuzzel>();
 }
예제 #6
0
    public bool SetVolume(string[] arr)
    {
        string errorMessage = "SetVolume vol";

        if (arr.Length == 1)
        {
            BoomBox.SetVolumeStat(Floatify(arr[0]));
            return(true);
        }
        Reply(errorMessage);
        return(true);
    }
예제 #7
0
    public bool PlaySound(string[] arr)
    {
        string errorMessage = "PlaySound name";

        if (arr.Length == 1)
        {
            Reply("Clip: " + Enum.Parse(typeof(SoundEnum.Sound), arr[0].ToUpper().ToString()) + " Volume: " + BoomBox.GetVolumeStat());
            return(BoomBox.Play((SoundEnum.Sound)Enum.Parse(typeof(SoundEnum.Sound), arr[0].ToUpper())));
        }
        Reply(errorMessage);
        return(true);
    }
예제 #8
0
    // OnTriggerEnter is called when the Collider other enters the trigger
    public void OnTriggerEnter(Collider other)
    {
        if (other.tag == "Pushable")
        {
            BoomBox bb = other.GetComponent <BoomBox>();
            if (bb == null)
            {
                return;
            }

            if (bb.chargedUp)
            {
                return;
            }

            //maybe apply force on the point of impact? not quite easy to get with trigger
            Vector3   dir = other.transform.position - this.transform.position;
            Rigidbody boomBoxRigidBody = other.GetComponent <Rigidbody>();

            //could consider these:

            /*
             * boomBoxRigidBody.AddForceAtPosition
             * boomBoxRigidBody.AddExplosionForce
             */

            //old version: impact force higher the closer the object is to the impact point
            //boomBoxRigidBody.AddForce(dir.normalized * (Mathf.Abs((1 - dir.magnitude / impactSize)) / maxRadius) * forceModifier, ForceMode.Impulse);

            //new version: forced is the same for every object, determined by the blast radius
            boomBoxRigidBody.AddForce(dir.normalized * impactSize, ForceMode.Impulse);

            if (doDamage)
            {
                bb.ChargeUp(redWave);
            }
        }
        else if (other.tag == "enemy")
        {
            Enemy_AI enem = other.GetComponent <Enemy_AI>();
            if (enem.redEnemy == this.redWave)
            {
                if (doDamage)
                {
                    enem.Stun();
                }
                else
                {
                    other.GetComponent <Rigidbody>().AddForce((other.transform.position - this.transform.position).normalized * impactSize, ForceMode.Impulse);
                }
            }
        }
    }
예제 #9
0
    void Update()
    {
        volumeSliderText.text = (int)(volumeSlider.value * 100f) + "%";
        panSliderText.text    = (int)(panSlider.value * 100f) + "%";
        rotSliderText.text    = (int)(rotSlider.value * 100f) + "%";
        BoomBox.SetVolumeStat(volumeSlider.value);
        MouseOrbitImproved.SetMouseSensitivity(rotSlider.value);
        Game game = GameObject.Find("GameController").GetComponent <Game>();

        if (game != null)
        {
            game.SetPanSensitivity(panSlider.value);
        }
    }
예제 #10
0
        public BoomBox Pull(BoomBox b)
        {
            int read = Pull(b.AudioChunk, 0);

            b.ReadPosition = buffer.readPosition;

            //if (b.RequestWaveFormat) {
            b.Format = WaveFormat;
            //}

            b.Succeeded = true;

            b.ReadPosition = buffer.readPosition;

            return(b);
        }
예제 #11
0
 public void clickSelect(bool left, bool right)
 {
     if (left && right)
     {
         return;                        //Shouldn't happen anyway but paranoid programmer
     }
     if (left)
     {
         game.GetPlayerAttributes().ApplyItem(game, leftItem);
     }
     if (right)
     {
         game.GetPlayerAttributes().ApplyItem(game, rightItem);
     }
     BoomBox.Play(SoundEnum.Sound.CLICK);
     MoveOn();
 }
예제 #12
0
    private void StartGame(GameMode gameMode)
    {
        BoomBox.Play(SoundEnum.Sound.CLICK);

        // Get GameController and start game
        GameObject     gameObject     = GameObject.Find(GameController.NAME);
        GameController gameController = gameObject.GetComponent <GameController>();

        gameController.StartGame(gameMode);

        // Set PlayerAttributes according to preset
        PlayerAttributes p = gameController.GetComponent <Game>().GetPlayerAttributes();

        p.SetPower((float)powValues[activeCharacter] / 100f);
        p.SetControl((float)conValues[activeCharacter] / 100f);
        p.SetImpact((float)impValues[activeCharacter] / 100f);
        p.SetSpin((float)spiValues[activeCharacter] / 100f);
    }
예제 #13
0
        public BoomBox Pull(int sampleCount, int channelCount = 1, int?readHead = null, bool getFormat = true)
        {
            if (readHead != null)
            {
                buffer.readPosition = readHead.Value;
            }

            BoomBox b = new BoomBox(sampleCount)
            {
                RequestWaveFormat = getFormat
            };

            float[] ac = b.AudioChunk;
            Array.Resize(ref ac, sampleCount);
            b.AudioChunk = ac;

            return(Pull(b));
        }
예제 #14
0
    private void PlayStrikeSound()
    {
        Sound strikeSound;

        switch (game.GetBag().GetClub().GetClubClass())
        {
        case ClubClass.WEDGE:
            strikeSound = Sound.WEDGEHIT;
            break;

        case ClubClass.PUTTER:
            strikeSound = Sound.PUTTHIT;
            break;

        default:
            strikeSound = Sound.IRONHIT;
            break;
        }
        BoomBox.Play(strikeSound);
    }
예제 #15
0
    public void OnPressed(Interactor by)
    {
        BoomBox boomBox = this.GetComponentInParent <BoomBox>();

        if (buttonType == BoomBoxButtonType.back)
        {
            boomBox.Back();
        }
        else if (buttonType == BoomBoxButtonType.forward)
        {
            boomBox.Forward();
        }
        else if (buttonType == BoomBoxButtonType.play)
        {
            boomBox.Play();
        }
        else if (buttonType == BoomBoxButtonType.stop)
        {
            boomBox.Stop();
        }
    }
예제 #16
0
 void Clicked(int row, int column)
 {
     BoomBox.Play(SoundEnum.Sound.CLICK);
     if (row == 0 && score.GetCredits() >= SUB_CREDITS_AMOUNT)
     {
         BoomBox.Play(SoundEnum.Sound.PURCHASE);
         score.AddDebit(SUB_CREDITS_AMOUNT);
         MarkChecked(row, column);
         playerAttributes.ApplyItem(game, GetItem(row, column));
     }
     else if (row == 1)
     {
         game.GetBag().RemoveClub(clubTrades[column]);
         game.GetBag().DecrementBag();
         MarkChecked(row, column);
         playerAttributes.ApplyItem(game, GetItem(row, column));
     }
     else if (row == 2)
     {
         playerAttributes.ApplyItem(game, GetItem(row, column));
         playerAttributes.ApplyItem(game, GetBadItem(column));
         MarkChecked(row, column);
     }
 }
예제 #17
0
 void Start()
 {
     boombox = GameObject.FindGameObjectWithTag("BoomBox").GetComponent <BoomBox>();
 }
예제 #18
0
 void task_9()
 {
     BoomBox.Play(SoundEnum.Sound.CLICK);
 }
예제 #19
0
 void task_7()
 {
     BoomBox.Play(SoundEnum.Sound.CLICK);
     Application.Quit();
 }
예제 #20
0
 void task_6()
 {
     BoomBox.Play(SoundEnum.Sound.CLICK);
     controlsMenu.enabled = true;
 }
예제 #21
0
 void task_5()
 {
     BoomBox.Play(SoundEnum.Sound.CLICK);
     optionsMenu.enabled = true;
 }
예제 #22
0
 void task_3()
 {
     // Volume test
     BoomBox.Play(SoundEnum.Sound.CLICK);
 }
예제 #23
0
 void task_2()
 {
     BoomBox.Play(SoundEnum.Sound.CLICK);
     //Save Settings here...
 }
예제 #24
0
 void task_3()
 {
     BoomBox.Play(SoundEnum.Sound.CLICK);
     ToggleThisMenu();
     GameObject.Find(GameController.NAME).GetComponent <GameController>().ExitToMenu();
 }
예제 #25
0
    public static IEnumerator StartServer(bool doLoad, string saveFileOverride, bool allowOutOfDateSaves)
    {
        float timeScale = UnityEngine.Time.timeScale;

        if (ConVar.Time.pausewhileloading)
        {
            UnityEngine.Time.timeScale = 0f;
        }
        RCon.Initialize();
        BaseEntity.Query.Server = new BaseEntity.Query.EntityTree(8096f);
        if ((bool)SingletonComponent <WorldSetup> .Instance)
        {
            yield return(SingletonComponent <WorldSetup> .Instance.StartCoroutine(SingletonComponent <WorldSetup> .Instance.InitCoroutine()));
        }
        if ((bool)SingletonComponent <DynamicNavMesh> .Instance && SingletonComponent <DynamicNavMesh> .Instance.enabled && !AiManager.nav_disable)
        {
            yield return(SingletonComponent <DynamicNavMesh> .Instance.StartCoroutine(SingletonComponent <DynamicNavMesh> .Instance.UpdateNavMeshAndWait()));
        }
        if ((bool)SingletonComponent <AiManager> .Instance && SingletonComponent <AiManager> .Instance.enabled)
        {
            SingletonComponent <AiManager> .Instance.Initialize();

            if (!AiManager.nav_disable && AI.npc_enable && TerrainMeta.Path != null)
            {
                foreach (MonumentInfo monument in TerrainMeta.Path.Monuments)
                {
                    if (monument.HasNavmesh)
                    {
                        yield return(monument.StartCoroutine(monument.GetMonumentNavMesh().UpdateNavMeshAndWait()));
                    }
                }
                if ((bool)TerrainMeta.Path && (bool)TerrainMeta.Path.DungeonRoot)
                {
                    DungeonNavmesh dungeonNavmesh = TerrainMeta.Path.DungeonRoot.AddComponent <DungeonNavmesh>();
                    dungeonNavmesh.NavMeshCollectGeometry = NavMeshCollectGeometry.PhysicsColliders;
                    dungeonNavmesh.LayerMask = 65537;
                    yield return(dungeonNavmesh.StartCoroutine(dungeonNavmesh.UpdateNavMeshAndWait()));
                }
                else
                {
                    Debug.LogError("Failed to find DungeonRoot, NOT generating Dungeon navmesh");
                }
            }
        }
        GameObject gameObject = GameManager.server.CreatePrefab("assets/bundled/prefabs/system/server.prefab");

        Object.DontDestroyOnLoad(gameObject);
        ServerMgr serverMgr = gameObject.GetComponent <ServerMgr>();

        serverMgr.Initialize(doLoad, saveFileOverride, allowOutOfDateSaves);
        yield return(CoroutineEx.waitForSecondsRealtime(0.1f));

        SaveRestore.InitializeEntityLinks();
        yield return(CoroutineEx.waitForSecondsRealtime(0.1f));

        SaveRestore.InitializeEntitySupports();
        yield return(CoroutineEx.waitForSecondsRealtime(0.1f));

        SaveRestore.InitializeEntityConditionals();
        yield return(CoroutineEx.waitForSecondsRealtime(0.1f));

        SaveRestore.GetSaveCache();
        yield return(CoroutineEx.waitForSecondsRealtime(0.1f));

        BaseGameMode.CreateGameMode();
        yield return(CoroutineEx.waitForSecondsRealtime(0.1f));

        serverMgr.OpenConnection();
        CompanionServer.Server.Initialize();
        using (BenchmarkTimer.New("Boombox.LoadStations"))
        {
            BoomBox.LoadStations();
        }
        if (ConVar.Time.pausewhileloading)
        {
            UnityEngine.Time.timeScale = timeScale;
        }
        WriteToLog("Server startup complete");
    }
예제 #26
0
 void task_1()
 {
     BoomBox.Play(SoundEnum.Sound.CLICK);
     //UnityEngine.Debug.Log("Back to main...");
     thisMenu.enabled = false;
 }
예제 #27
0
 private void Start()
 {
     boomBox = GetComponentInParent <BoomBox>();
 }