Exemple #1
0
 private void OnGUI()
 {
     if (GUI.Button(new Rect(Screen.width / 2 - 50, 5, 100, 30), "PlaySound"))
     {
         AiryAudioSource newSource = AiryAudioManager.Instance.InitAudioSource("TestSFX1");
         AiryAudioActions.Play(newSource);
     }
 }
Exemple #2
0
 // Use this for initialization
 void Start()
 {
     if (playOnStart && myAudioDatas != null)
     {
         AiryAudioSource t_source = AiryAudioManager.Instance.InitAudioSource(myAudioDatas);
         AiryAudioActions.Play(t_source, this.transform);
     }
 }
Exemple #3
0
    public void OnButtonHideMenu()
    {
        AiryAudioSource t_airyAudioSource = AiryAudioManager.Instance.InitAudioSource("Button");

        AiryAudioActions.Play(t_airyAudioSource);

        myPage_Menu.SetActive(false);
        Time.timeScale = 1;
    }
Exemple #4
0
    public void OnButtonRestart()
    {
        AiryAudioSource t_airyAudioSource = AiryAudioManager.Instance.InitAudioSource("Button");

        AiryAudioActions.Play(t_airyAudioSource);

        SceneManager.LoadScene(SceneManager.GetActiveScene().name);
        Time.timeScale = 1;
    }
Exemple #5
0
    public void OnButtonHome()
    {
        AiryAudioSource t_airyAudioSource = AiryAudioManager.Instance.InitAudioSource("Button");

        AiryAudioActions.Play(t_airyAudioSource);

        SceneManager.LoadScene("Menu");
        Time.timeScale = 1;
    }
Exemple #6
0
    public void HideAll()
    {
        AiryAudioSource t_airyAudioSource = AiryAudioManager.Instance.InitAudioSource("Button");

        AiryAudioActions.Play(t_airyAudioSource);

        myUI.SetActive(false);
        myObject_ButtonShow.SetActive(true);
    }
Exemple #7
0
            public void Play(Vector2 g_position)
            {
                if (AiryAudioManager.Instance == null)
                {
                    Debug.LogError("AiryAudioManager is missing!");
                    return;
                }

                AiryAudioActions.Play(AiryAudioManager.Instance.InitAudioSource(this), g_position);
            }
Exemple #8
0
            public void Play(Transform g_parent)
            {
                if (AiryAudioManager.Instance == null)
                {
                    Debug.LogError("AiryAudioManager is missing!");
                    return;
                }

                AiryAudioActions.Play(AiryAudioManager.Instance.InitAudioSource(this), g_parent);
            }
Exemple #9
0
            public void PlayScheduled(double g_startTime)
            {
                if (AiryAudioManager.Instance == null)
                {
                    Debug.LogError("AiryAudioManager is missing!");
                    return;
                }

                AiryAudioActions.PlayScheduled(AiryAudioManager.Instance.InitAudioSource(this), g_startTime);
            }
Exemple #10
0
    // UI

    public void OnOption_Click(float g_value)
    {
        AiryAudioSource t_airyAudioSource = AiryAudioManager.Instance.InitAudioSource("Button");

        AiryAudioActions.Play(t_airyAudioSource);

        myCurrentValue = g_value;
        myCurrentOption.gameObject.SetActive(true);
        myCurrentOption.transform.position = Input.mousePosition;
        myCurrentOption.Set(myCurrentValue);
        Debug.Log("OnOption_Click");
    }
Exemple #11
0
    private bool CheckResult()
    {
        for (int i = 0; i < myPlanetList.Count; i++)
        {
            if (myPlanetRootList.Contains(myPlanetList[i]))
            {
                continue;
            }

            if (myPlanetEndList.Contains(myPlanetList[i]) == false)
            {
                if (myPlanetList[i].GetMultiplier_Speed() != myAnswerList[i].GetMultiplier_Speed())
                {
                    return(false);
                }
            }
            if (myPlanetList[i].GetMultiplier_TargetRadius() != myAnswerList[i].GetMultiplier_Radius())
            {
                return(false);
            }
        }

        // done
        isGameOver = true;
        OnClickPlanet(null);
        // show game over effect
        myObject_GameOver.SetActive(true);
        HideAll();

        // remove answer trail
        foreach (CS_Planet f_planet in myAnswerList)
        {
            f_planet.HideTail();
            f_planet.RemoveSFX();
        }

        AiryAudioSource t_airyAudioSource = AiryAudioManager.Instance.InitAudioSource("GameOver");

        AiryAudioActions.Play(t_airyAudioSource);

        myObject_ButtonGameOverHome.SetActive(true);

        return(true);
    }
Exemple #12
0
    public void OnOption_Release()
    {
        AiryAudioSource t_airyAudioSource = AiryAudioManager.Instance.InitAudioSource("Drop");

        AiryAudioActions.Play(t_airyAudioSource);

        myCurrentOption.gameObject.SetActive(false);

        PointerEventData t_pointerEventData = new PointerEventData(EventSystem.current);

        t_pointerEventData.position = Input.mousePosition;

        List <RaycastResult> t_raycastResultList = new List <RaycastResult> ();

        myGraphicRaycaster.Raycast(t_pointerEventData, t_raycastResultList);

        foreach (RaycastResult f_result in t_raycastResultList)
        {
            if (f_result.gameObject.GetComponent <CS_UI_Area_Radius> () == true)
            {
                // set radius
                if (myCurrentPlanet != null)
                {
                    myCurrentPlanet.LerpMultiplier_Radius(myCurrentValue, "H" + GetSoundIndex(myCurrentValue).ToString());
                    //FixedUpdate ();
                    //ClearTrail ();
                }
            }
            else if (f_result.gameObject.GetComponent <CS_UI_Area_Speed> () == true)
            {
                // set speed
                if (myCurrentPlanet != null)
                {
                    myCurrentPlanet.SetMultiplier_Speed(myCurrentValue, true);
                }
            }
        }

        if (isGameOver == false)
        {
            CheckResult();
        }
    }
Exemple #13
0
    public bool OnClickPlanet(CS_Planet g_planet)
    {
        AiryAudioSource t_airyAudioSource = AiryAudioManager.Instance.InitAudioSource("Button");

        AiryAudioActions.Play(t_airyAudioSource);

        CS_CameraManager.Instance.LookAt(g_planet);
        foreach (Level t_level in myLevels)
        {
            if (t_level.planet == g_planet)
            {
                CS_DataManager.Instance.myArrangeList = t_level.arrangeList;
                SceneManager.LoadSceneAsync(t_level.sceneName);

                t_airyAudioSource = AiryAudioManager.Instance.InitAudioSource("Drop");
                AiryAudioActions.Play(t_airyAudioSource);
                return(true);
            }
        }
        return(true);
    }
Exemple #14
0
    public bool OnClickPlanet(CS_Planet g_planet)
    {
        if (myCurrentPlanet == g_planet)
        {
            return(false);
        }

        AiryAudioSource t_airyAudioSource = AiryAudioManager.Instance.InitAudioSource("Drop");

        AiryAudioActions.Play(t_airyAudioSource);


        myCurrentPlanet = g_planet;
        CS_CameraManager.Instance.LookAt(g_planet);

        if (myPlanetRootList.Contains(g_planet) || g_planet == null)
        {
            myPage_Planet.SetActive(false);
            myArea_Speed.Set(null);
            myArea_Radius.Set(null);
        }
        else
        {
            myPage_Planet.SetActive(true);
            myArea_Radius.Set(g_planet);
            if (myPlanetEndList.Contains(g_planet))
            {
                myArea_Speed.gameObject.SetActive(false);
                myArea_Speed.Set(null);
            }
            else
            {
                myArea_Speed.gameObject.SetActive(true);
                myArea_Speed.Set(g_planet);
            }
        }

        return(true);
    }
Exemple #15
0
            public void PlayName(string t_name)
            {
                AiryAudioSource t_source = AiryAudioManager.Instance.InitAudioSource(t_name);

                AiryAudioActions.Play(t_source, this.transform);
            }
Exemple #16
0
            public void PlayIndex(int t_index)
            {
                AiryAudioSource t_source = AiryAudioManager.Instance.InitAudioSource(myAudioDatas [t_index]);

                AiryAudioActions.Play(t_source, this.transform);
            }
Exemple #17
0
            public void Play()
            {
                AiryAudioSource t_source = AiryAudioManager.Instance.InitAudioSource(myAudioDatas);

                AiryAudioActions.Play(t_source, this.transform);
            }