SetState() public static method

public static SetState ( string in_pszStateGroup, string in_pszState ) : AKRESULT
in_pszStateGroup string
in_pszState string
return AKRESULT
Ejemplo n.º 1
0
 private void RpcSetInstrumentRed(int round, string instrument)
 {
     Debug.Log("Red Temp win actions");
     AkSoundEngine.SetState("Arkryas_" + instrument + "_Track", "A_" + instrument + "_OFF");
     AkSoundEngine.SetState("Nethmi_" + instrument + "_Track", "N_" + instrument + round);
     Debug.Log("round " + round + "Red or Nethmi" + instrument);
 }
Ejemplo n.º 2
0
    void Start()
    {
        if (instance == null)
        {
            instance = this;
            DontDestroyOnLoad(this);
            DontDestroyOnLoad(UI);
            gameObject.name       = "Player";
            currentLives          = maxLives;
            currentItems          = -1;
            spawnPointSet         = false;
            controller            = gameObject.AddComponent <CharacterController>();
            controller.stepOffset = 0.7f;
            Cursor.visible        = false;
            Cursor.lockState      = CursorLockMode.Locked;
            playerVelocity        = Vector3.zero;
            inventory             = new bool[maxItems];
            AkSoundEngine.SetState("Dead_or_Alive", "Alive");
            AkSoundEngine.SetRTPCValue("Music_RTCP", myRTCP);
            musicPlaying   = false;
            sceneChanged   = false;
            firstUpdate    = false;
            brickText.text = "Bricks: " + (currentItems + 1);
            livesText.text = "Lives: " + currentLives;

            spawnPointLocation = new Vector3(0, 2.5f, 0);
            currentLevel       = 1;
            deathPosted        = false;
        }
        else if (instance != this)
        {
            Destroy(gameObject);
        }
    }
Ejemplo n.º 3
0
 public override void SetVerticalMix(string name)
 {
     if (string.IsNullOrEmpty(VerticalStateGroup) == false)
     {
         AkSoundEngine.SetState(VerticalStateGroup, name);
     }
 }
Ejemplo n.º 4
0
    //Creates a beam that functions as an extension, continuing on from the original collided lightbeams
    //connection, all while taking the original beams colour into account. Since the light splitter object
    //is designed to split the beam into two beams, its two beams not one that continues on from the original.
    //Furthermore, additional functionality was added to this object so that the colour of original beam could also
    //be split into its components. The two new beams are split by 45 degrees on either side by design.
    private void CreateExtendedBeam()
    {
        if (splitBeams.Count > 0)
        {
            DestroyBeam();
        }

        for (int i = 0; i < totalLightSplits; i++)
        {
            GameObject lightBeam = Instantiate(Resources.Load("Prefabs/Light/LightBeam")) as GameObject;
            lightBeam.name = "LightBeamObject " + i;
            lightBeam.transform.SetParent(this.transform);
            lightBeam.transform.position = this.transform.position;
            lightBeam.transform.rotation = this.transform.rotation;

            splitBeams.Add(lightBeam);
            splitBeams[i].GetComponent <StraightSplineBeam>().beamColour = beamColour;
            splitBeams[i].GetComponent <StraightSplineBeam>().beamLength = beamLength;
        }
        splitBeams[0].transform.Rotate(Vector3.up * 45);
        splitBeams[1].transform.Rotate(Vector3.up * -45);

        if ((splitColour) && (beamColour.Equals(new Color(1, 0, 1, 1))))
        {
            SplitColourBetweenBeams();
        }

        AkSoundEngine.SetState("Drone_Modulator", "Splitter");
    }
Ejemplo n.º 5
0
    public void LoadMatchmakingScene()
    {
        AkSoundEngine.SetState("GameState", "None");
        gameCanvas.SetActive(false);
        teamCanvas.SetActive(true);
        for (int i = 0; i < maxPlayers; i++)
        {
            PlayersGameObjects[i].SetActive(false);
            NetworkServerManager.getInstance().SwitchInputManager(i, true);
        }
        teams[0] = Random.Range(1, 3);
        teams[1] = Random.Range(1, 3);
        if (teams[0] == teams[1])
        {
            if (teams[0] == 1)
            {
                teams[2] = 2;
                teams[3] = 2;
            }
            else
            {
                teams[2] = 1;
                teams[3] = 1;
            }
        }
        else
        {
            teams[2] = Random.Range(1, 3);
            if (teams[2] == 1)
            {
                teams[3] = 2;
            }
            else
            {
                teams[3] = 1;
            }
        }
        //teams = new int[] { 1, 2, 1, 2 };
        keyCollected = new int[] { 0, 0, 0, 0 };
        SceneManager.LoadScene("Matchmaking Scene");
        //DebugText.instance.Log("Loaded Matchmaking Scene");
        int team1Comp = 0, team2Comp = 0;

        for (int i = 0; i < maxPlayers; i++)
        {
            if (teams[i] == 1)
            {
                teamCanvas.transform.GetChild(1).GetChild(i).gameObject.GetComponent <RectTransform>().localPosition = teamsFacesPos[team1Comp];

                team1Comp++;
            }
            else
            {
                teamCanvas.transform.GetChild(1).GetChild(i).gameObject.GetComponent <RectTransform>().localPosition = teamsFacesPos[team2Comp + 2];
                team2Comp++;
            }
        }
        timer = MatchMakingSceneDuration;
        isMatchmakingScene = true;
    }
Ejemplo n.º 6
0
 public void Resume()
 {
     PauseMenuUI.SetActive(false);
     AkSoundEngine.SetState("Pause", "Not_Paused");
     GameIsPaused = false;
     GameObject.Find("SceneTransition").GetComponent <SceneTransition>().transActive = 0;
 }
Ejemplo n.º 7
0
    IEnumerator LoadPanel(float nextTransTime)
    {
        transition.SetTrigger("Start");

        AkSoundEngine.PostEvent("Woosh_Trans_Event", gameObject);

        yield return(new WaitForSeconds(nextTransTime));

        nextPanel = manager.GetComponent <CollisionManager>().tab[tabNum];

        AkSoundEngine.SetState("Pause", "Not_Paused");

        nextPanel.SetActive(true);

        helmetUI.SetActive(true);

        continueButton.SetActive(false);

        transitionPanel.SetActive(false);

        transActive = 0;

        transition.SetTrigger("End");
        Inventaire.SetActive(true);
    }
    private void SetState(int newState)
    {
        switch (newState)
        {
        case 0:    // Field scene
            AkSoundEngine.SetState("IMAmb1", "Amb1start");
            break;

        case 1:
            AkSoundEngine.SetState("IMAmb1", "Amb1end");
            break;

        case 2:     // Volcano scene
            AkSoundEngine.SetState("IMAmb2", "CP2");
            break;

        case 3:
            AkSoundEngine.SetState("IMAmb2", "CP3");
            break;

        case 4:     // Beginning cave scene
            AkSoundEngine.SetState("IMAmb3", "Hunted");
            break;

        case 5:     // boss theme
            AkSoundEngine.SetState("IMAmb3", "Over");
            break;

        default:
            break;
        }
    }
    void OnTriggerEnter(Collider col)     // when entering a new music intensity  room
    {
        switch (col.gameObject.tag)       // Switch statement to check which room we entered
        {
        case "MusicRoom1":
            displayIntensity.text = "Music Intensity: 1";             // Display the current intensity
            AkSoundEngine.SetState("DynamicMusicIntensity", "Int1");  // Setting the Intensity State.
            break;

        case "MusicRoom2":
            displayIntensity.text = "Music Intensity: 2";
            AkSoundEngine.SetState("DynamicMusicIntensity", "Int2");
            break;

        case "MusicRoom3":
            displayIntensity.text = "Music Intensity: 3";
            AkSoundEngine.SetState("DynamicMusicIntensity", "Int3");
            break;

        case "MusicRoom4":
            displayIntensity.text = "Music Intensity: 4";
            AkSoundEngine.SetState("DynamicMusicIntensity", "Int4");
            AkSoundEngine.PostTrigger("Music_Intensity_Fill", gameObject);            // Calling a Trigger to activate a Stringer on the event, (We are doing this same thing in FMOD just in Engine)
            break;

        default:
            break;
        }
    }
Ejemplo n.º 10
0
    private void SetState(int newState)
    {
        // Debug.Log("new state: " + newState);
        switch (newState)
        {
        case 0:    // Field scene
            AkSoundEngine.SetState("IMAmb1", "Amb1start");
            break;

        case 1:
            AkSoundEngine.SetState("IMAmb1", "Amb1end");
            break;

        case 2:     // Volcano scene
            AkSoundEngine.SetState("IMAmb2", "CP2");
            break;

        case 3:
            AkSoundEngine.SetState("IMAmb2", "CP3");
            break;

        case 4:     // Beginning cave scene
            //AkSoundEngine.PostEvent("Ambient2Stop", this.gameObject);
            //AkSoundEngine.PostEvent("Ambient3", this.gameObject);
            AkSoundEngine.SetState("IMAmb3", "Hunted");
            break;

        case 5:     // boss theme
            AkSoundEngine.SetState("IMAmb3", "Over");
            break;

        default:
            break;
        }
    }
Ejemplo n.º 11
0
 private void DropCalled(DropColor color, int length)
 {
     if (length == 8) //short drop should not be followed by intro
     {
         AkSoundEngine.SetState("GrooveType", "Flow");
     }
     else if (length == 16) //this is the medium drop, every other medium drop should be followed by intro
     {
         if (!mediumDropCounter)
         {
             mediumDropCounter = true;
             AkSoundEngine.SetState("GrooveType", "Flow");
         }
         else
         {
             AkSoundEngine.SetState("GrooveType", "Intro");
             mediumDropCounter = false;
         }
     }
     else if (length == 32) //this is the long drop, should always be followed by intro
     {
         AkSoundEngine.SetState("GrooveType", "Intro");
         mediumDropCounter = false;
     }
 }
Ejemplo n.º 12
0
 /// <summary>
 /// Set the states to 0 to the Wwise sound engine
 /// </summary>
 public override void Stop()
 {
     foreach (var customState in CustomStates)
     {
         AkSoundEngine.SetState(customState.GroupId, 0U);
     }
 }
Ejemplo n.º 13
0
    private void AddModule(Module module)
    {
        if (module.GetComponent <ShooterModule>() != null)
        {
            module.GetComponent <ShooterModule>().isEnemy = false;
        }

        if (module.GetComponent <VGun>() != null)
        {
            AkSoundEngine.SetState("vGun_state", "yes");
        }

        module.transform.parent = _transform;

        if (module.rotateWhenPickUp)
        {
            Vector3 directionToLookAt = module.transform.position - _transform.position;
            //TO DO : need to make a clear feedback
            //something to make the module really go from start direction to this one
            module.transform.rotation = Quaternion.LookRotation(Vector3.forward, directionToLookAt);
        }
        module.free = false;

        _modulesList.Add(module);

        _listLenght++;

        UpdateWeight();
    }
Ejemplo n.º 14
0
    // Update is called once per frame
    private void Update()
    {
        if (Input.GetKeyDown(KeyCode.Escape) && this.GetComponentInParent <Canvas>().gameObject.activeSelf)
        {
            this.GetComponentInParent <Canvas>().gameObject.SetActive(false);

            red.GetComponent <InControlMovement>().enabled = true;
            red.GetComponent <SCR_TradeLimb>().enabled     = true;
            red.GetComponentInChildren <PickupAndDropdown_Trigger>().enabled = true;
            red.GetComponent <Chirps>().enabled      = true;
            red.GetComponent <MelodyInput>().enabled = true;

            blue.GetComponent <InControlMovement>().enabled    = true;
            blue.GetComponent <SCR_player2Initalise>().enabled = true;
            blue.GetComponentInChildren <PickupAndDropdown_Trigger>().enabled = true;
            blue.GetComponent <Chirps>().enabled      = true;
            blue.GetComponent <MelodyInput>().enabled = true;

            settingArea.SetActive(false);
            pauseBtn[0].GetComponent <Transform>().parent.gameObject.SetActive(true);
            pauseBtn[2].GetComponent <Transform>().parent.gameObject.SetActive(true);
            pauseBtn[3].GetComponent <Transform>().parent.gameObject.SetActive(true);
            pauseBtn[1].GetComponent <Text>().text = "Options";

            AkSoundEngine.SetState("UI", "Off");
            AkSoundEngine.PostEvent("Menu_Exit", gameObject);


            FindObjectOfType <EventSystem>().firstSelectedGameObject = null;
            FindObjectOfType <SwitchSelectController>().selectObj    = null;
            FindObjectOfType <SwitchSelectController>().enabled      = false;
            //
        }
    }
Ejemplo n.º 15
0
    private void Update()
    {
        timer -= Time.deltaTime;
        if (timer <= 0)
        {
            if (clicked && step == 1)
            {
                AkSoundEngine.PostEvent("Play_ocean", gameObject);
                Debug.Log("GO !");
                step = 4;
            }
            else
            {
                switch (step)
                {
                case 0:
                    timer += 5.345f;
                    step   = 1;
                    break;

                case 1:
                    AkSoundEngine.SetState("menuState", "menuIn");
                    timer += 7.53f - 5.345f;
                    step   = 2;
                    break;

                case 2:
                    timer += 5.345f;
                    step   = 1;
                    break;
                }
            }
        }
    }
Ejemplo n.º 16
0
 void OnLevelWasLoaded(int level)
 {
     if (level == 0)
     {
         AkSoundEngine.SetState("GameScreen", "TitleScreen");
     }
     if (level == 1)
     {
         InitGame();
         AkSoundEngine.SetState("GameScreen", "InGame");
     }
     if (level == 2)
     {
         AkSoundEngine.SetState("GameScreen", "Scoreboard");
         AkSoundEngine.SetState("isBoosting", "None");
     }
     if (level == 4)
     {
         AkSoundEngine.SetState("GameScreen", "death");
     }
     if (level == 5)
     {
         AkSoundEngine.SetState("GameScreen", "death");
     }
     if (level == 6)
     {
         AkSoundEngine.SetState("GameScreen", "credits");
     }
 }
Ejemplo n.º 17
0
 //Upon a collison being detected with a object
 void OnEnterObject()
 {
     if (!finished)
     {
         if (objectInfo.collider.name.Contains("ColourBarrier"))
         {
             if (objectInfo.transform.GetComponent <LightBarrier>().OnEnter(lineBeam.beamColour))
             {
                 BeamResizeController();
                 AkSoundEngine.SetState("Drone_Modulator", "Hit_Wall");
             }
             else
             {
                 lightBarrier = true;
                 if (ObjectFoundBehindIgnoredObject())
                 {
                     distance += objectInfo.distance + 0.5f;
                     BeamResizeController();
                 }
                 AkSoundEngine.SetState("Drone_Modulator", "Through_Barrier");
             }
         }
         //prolly remove this if statement at some pt
         else if ((!objectInfo.collider.name.Contains("Pole")) && (!objectInfo.collider.name.Contains("LineColliderObject")))
         {
             BeamResizeController();
         }
     }
 }
Ejemplo n.º 18
0
    void Start()
    {
        AkBankManager.LoadBank("main");
        AkSoundEngine.PostEvent("GameMusic", gameObject);
        AkSoundEngine.SetState("GameScreen", "TitleScreen");
        gameActive                    = false;
        initialTimeLeft               = timeLeft;
        highscoreListAsArrayOfInts    = new int[10];
        highscoreListAsArrayOfStrings = new string[10];
        highscore    = new Text[10];
        disconnector = new string[10];

        //Check if instance already exists.
        if (instance == null)
        {
            //If not, set instance to this.
            instance = this;
        }
        //If instance already exists and it's not this:
        else if (instance != this)
        {
            //Then destroy this. This enforces our singleton pattern, meaning there can only ever be one instance of a GameManager.
            Destroy(gameObject);
        }

        //Sets this to not be destroyed when reloading scene.
        DontDestroyOnLoad(gameObject);

        //Call the InitGame function to initialize the game.
    }
Ejemplo n.º 19
0
 void Pause()
 {
     PauseMenuUI.SetActive(true);
     AkSoundEngine.SetState("Pause", "Paused");
     GameIsPaused = true;
     GameObject.Find("SceneTransition").GetComponent <SceneTransition>().transActive = 1;
 }
Ejemplo n.º 20
0
    // Update is called once per frame
    void Update()
    {
        if (Input.GetKeyDown(KeyCode.Escape) && !isMenu && !optionsCanvas.activeSelf)
        {
            menuCanvas.SetActive(!menuCanvas.activeSelf);
            AkSoundEngine.SetState("GameState", "Pause");
            if (Time.timeScale != 0f)
            {
                Time.timeScale = 0f;
            }
            else
            {
                Time.timeScale = 1f;
                AkSoundEngine.SetState("GameState", "InGame");
            }
            es.SetSelectedGameObject(resume.gameObject);
        }
        else if (Input.GetKeyDown(KeyCode.Escape) && optionsCanvas.activeSelf)
        {
            HideOptions();
            ShowMenu();
        }
        if (SceneManager.sceneCount > 1 && SceneManager.GetSceneAt(1).isLoaded)
        {
            SceneManager.UnloadSceneAsync("Loading");
        }

        /* foreach(Button b in buttons) {
         *   if (EventSystem.current.IsPointerOverGameObject()) {
         *       AkSoundEngine.PostEvent("Scroll",gameObject);
         *       Debug.Log("Sound");
         *   }
         * }*/
    }
Ejemplo n.º 21
0
    public void LoadPreviousScene()
    {
        if (currentScene.name == "TableauElectrique2")
        {
            StartCoroutine(LoadLevel(SceneManager.GetActiveScene().buildIndex - 2));
            buildIndex = currentScene.buildIndex;
        }
        else
        {
            StartCoroutine(LoadLevel(SceneManager.GetActiveScene().buildIndex - 1));
        }
        buildIndex = currentScene.buildIndex;

        if (buildIndex == 1)
        {
            tabNum = manager.GetComponent <CollisionManager>().tabNum;
            AkSoundEngine.SetState("Location", "CP2_02");
            AkSoundEngine.SetState("Music", "Stasis");
        }
        if (buildIndex == 0)
        {
            AkSoundEngine.SetState("Location", "CL1");
            AkSoundEngine.SetState("Music", "None");
        }
    }
Ejemplo n.º 22
0
 public void Resume()
 {
     menuCanvas.SetActive(false);
     es.SetSelectedGameObject(null);
     Time.timeScale = 1f;
     AkSoundEngine.SetState("GameState", "InGame");
 }
Ejemplo n.º 23
0
    void Update()
    {
        transform.position = new Vector3(transform.position.x + (Input.GetAxis("Horizontal") / 10), transform.position.y, transform.position.z);

        float xpos = startpos.x - transform.position.x;


        // Event2: "PressSpace" kaldes ved tryk af knap
        if (Input.GetKeyDown(KeyCode.Space))
        {
            AkSoundEngine.PostEvent("PressSpace", gameObject);
            transform.localScale = new Vector3(Random.Range(0.2f, 1.5f), Random.Range(0.2f, 1.5f), Random.Range(0.2f, 1.5f));
        }

        // GameSync1 (Switch): "LeftRight" skifter mellem PressSpace-filer ud fra binær x
        // GameSync2 (State): "LeftRight" fader mellem Ambience-filer ud fra binær x
        if (transform.position.x <= startpos.x)
        {
            AkSoundEngine.SetSwitch("LeftRight", "Left", gameObject);
            AkSoundEngine.SetState("LeftRight", "Left");
        }
        else if (transform.position.x > startpos.x)
        {
            AkSoundEngine.SetSwitch("LeftRight", "Right", gameObject);
            AkSoundEngine.SetState("LeftRight", "Right");
        }

        // GameSync3 (RTPC): "XPosition" lader x som talværdi styre parametre for PressSpace & Ambience
        AkSoundEngine.SetRTPCValue("XPosition", xpos);
    }
Ejemplo n.º 24
0
 void UpdateState(int count)
 {
     if (count >= 0 && count < m_states.Count)
     {
         AkSoundEngine.SetState(m_states[count].GroupId, m_states[count].Id);
     }
 }
Ejemplo n.º 25
0
 public void Enter()
 {
     background.DOFade(0, 0);
     victoryText.DOFade(0, 0);
     StartCoroutine(Victory());
     AkSoundEngine.SetState("Battle_State", "Battle_End");
 }
Ejemplo n.º 26
0
 private void OnTriggerExit(Collider other)
 {
     if (other.CompareTag("Player"))
     {
         AkSoundEngine.SetState("Dans_Tunnel", "Non");
     }
 }
Ejemplo n.º 27
0
    // interactive music

    public override void SetHorizontalSequence(string name)
    {
        if (string.IsNullOrEmpty(HorizontalStateGroup) == false)
        {
            AkSoundEngine.SetState(HorizontalStateGroup, name);
        }
    }
Ejemplo n.º 28
0
 void Start()
 {
     AkSoundEngine.SetState("menuState", "menuIn");
     AkSoundEngine.PostEvent("Play_menuMusicSwitch", gameObject);
     timer = 2.625f;
     step  = 0;
 }
Ejemplo n.º 29
0
 public void ResumeGame()
 {
     SetChildrenActive(1, false);
     Time.timeScale = 1f;
     AkSoundEngine.SetState("Pause_Menu_Filter", "Pause_Off");
     animator.SetTrigger("pause_disable");
 }
Ejemplo n.º 30
0
 public void Recycle()
 {
     foreach (var current in typeState_ConfigId_Datas.Values)
     {
         if (!current.IsDefault)
         {
             AKRESULT result = AkSoundEngine.SetState
                                   (current.GetGroupName(), current.GetDefaultState());
             VaryGroupIfSucess(current, result, current.GetDefaultState());
         }
     }
     foreach (KeyValuePair <int, AKSwitchGroup> pairs in typeSwitch_GameObjHash_Datas)
     {
         if (pairs.Value.Dismiss())
         {
             typeSwitch_GameObjHash_Datas.Remove(pairs.Key);
         }
         else
         {
             if (!pairs.Value.IsDefault)
             {
                 AKRESULT result = AkSoundEngine.SetState
                                       (pairs.Value.GetGroupName(), pairs.Value.GetDefaultState());
                 VaryGroupIfSucess(pairs.Value, result, pairs.Value.GetDefaultState());
             }
         }
     }
 }