Example #1
0
 public override void OnCollisionEnter(Collision col)
 {
     if (col.gameObject.name.Contains("Rail"))
     {
         //we hit the wall.
         HOAudioManager.BallhitRail(m_rigidbody.velocity);
         if (!hitWall)
         {
             GameManager.Rules.BallHitRail();
             hitWall = true;
         }
     }
     if (col.gameObject.CompareTag("Ball"))
     {
         PoolBall ball = col.transform.GetComponent <PoolBall>();
         if (ball.ballType != BallType.WHITE && BallState == State.ROLL)
         {
             m_AbsorbList.Add(ball);
             //ball.Hide();
             TemporarySlot.Add(ball);
         }
         else
         {
             HOAudioManager.BallhitBall(m_rigidbody.velocity);
         }
     }
 }
Example #2
0
    void Update()
    {
        if (m_Value == value)
        {
            return;
        }

        if (m_Value < value)
        {
            m_Value += Time.deltaTime * m_RollSpeed;
            HOAudioManager.PlayLoopClip("Scoreup");
            if (m_Value > value)
            {
                m_Value = value;
                HOAudioManager.StopLoopClip();
            }
        }
        else if (m_Value > value)
        {
            m_Value -= Time.deltaTime * m_RollSpeed;
            HOAudioManager.PlayLoopClip("Scoreup");
            if (m_Value < value)
            {
                m_Value = value;
                HOAudioManager.StopLoopClip();
            }
        }
        Pattern();
    }
Example #3
0
    public override void OnCollisionEnter(Collision col)
    {
        if (GameManager.Rules.State == GlobalState.DRAG_WHITEBALL)
        {
            return;
        }

        if (col.gameObject.name.Contains("Rail"))
        {
            HOAudioManager.BallhitRail(m_rigidbody.velocity);
            GameManager.Rules.CueBallHitRail();
            GameManager.Rules.BallHitRail();
            GameStatistics.MarkCueballHitRail(1);
        }
        if (col.transform.CompareTag("Ball"))
        {
            HOAudioManager.BallhitBall(m_rigidbody.velocity);
            GameStatistics.MarkCueballHitBall(1);
            PoolBall ball = col.gameObject.GetComponent <PoolBall>();
            GameManager.Rules.WhiteBallHitBall(ball);
            if (ball && ball == m_targetBall)
            {
                m_targetBall.PointAtTarget(m_targetPos);
                m_targetBall = null;
            }
        }
    }
Example #4
0
 private void Boom()
 {
     HOAudioManager.Explosion();
     m_BombGO = Instantiate(m_BombEffect, transform.position, Quaternion.identity) as GameObject;
     Invoke("GameOverWithBoom", m_TimeToGameOver);
     gameObject.SetActive(false);
 }
Example #5
0
    void Start()
    {
#if UNITY_ANDROID && !UNITY_EDITOR
        StartCoroutine(LoadPoolAsset(OnPoolAssetLoadedAtAndroidPlatform));
#endif
        HOAudioManager.PlayBGM(m_bgmName);
    }
Example #6
0
 public override void OnCollisionEnter(Collision col)
 {
     if (col.gameObject.name.Contains("Rail"))
     {
         //we hit the wall.
         //BaseGameManager.ballHitWall(rigidbody.velocity);
         HOAudioManager.BallhitRail(m_rigidbody.velocity);
         if (!hitWall)
         {
             GameManager.Rules.BallHitRail();
             hitWall = true;
         }
     }
     if (col.gameObject.CompareTag("Ball"))
     {
         PoolBall ball = col.transform.GetComponent <PoolBall>();
         if (ball.ballType != BallType.WHITE && BallState == State.ROLL)
         {
             Instantiate(m_BreakEffect, transform.position, Quaternion.identity);
             if (SingularityBreakBall != null)
             {
                 SingularityBreakBall(ball);
             }
             HOAudioManager.Break();
         }
         else
         {
             HOAudioManager.BallhitBall(m_rigidbody.velocity);
         }
     }
 }
Example #7
0
 void OnApplicationQuit()
 {
     m_ClipsPool.Clear();
     m_Instance  = null;
     m_ClipCache = null;
     m_BGMPlayer.DestroySelf();
 }
Example #8
0
    public void SetValue(float fillAmount)
    {
        m_Image.fillAmount = fillAmount;
        if (m_Image.fillAmount < .25f)
        {
            m_Twinkle.enabled = true;
        }

        if (m_Image.fillAmount <= 0)
        {
            enabled = false;
        }
        else
        {
            enabled = true;
        }
        if (m_Twinkle.enabled)
        {
            HOAudioManager.PlayLoopClip("Clock");
        }
        if (!enabled || !m_Twinkle.enabled)
        {
            HOAudioManager.StopLoopClip();
        }
    }
Example #9
0
 void OnDestroy()
 {
     PoolRulesBase.onFireBall -= OnFireBall;
     PoolRulesBase.onNewTurn  -= OnStartRound;
     m_Instance = null;
     GameStatistics.Serialize();
     HOAudioManager.StopLoopClip();
 }
Example #10
0
 public virtual void Begin()
 {
     if (!m_Outline.enabled)
     {
         HOAudioManager.PlayClip("Ready", 1);
     }
     //m_Outline.enabled = true;
 }
Example #11
0
 public void LoadScene(int sceneIndex)
 {
     //animation tools component attached at blackmask has a method named loadscene. we use this
     m_RiseMask.gameObject.SetActive(true);
     HOAudioManager.StopBGM();
     m_RiseMask.GetComponent <AnimationTools>().sceneIndex = 1;
     //Application.LoadLevel(sceneIndex);
 }
Example #12
0
 void Awake()
 {
     if (m_BGMKey == default(int))
     {
         HOAudioManager.StopBGM(true);
     }
     else
     {
         HOAudioManager.PlayBGM(m_BGMKey, true);
     }
 }
Example #13
0
    public void fireBall(float powerScalar, Vector3 fireDir, Vector3 hitPoint)
    {
        HOAudioManager.FireBall();
        GameManager.Rules.OnBallFired();
        m_slowTime = 0;

        Vector3 fireForce = fireDir * powerScalar * ConstantData.GetPoolDatas().MaxImpulse;

        m_rigidbody.AddForceAtPosition(fireForce, hitPoint, ForceMode.Impulse);
        m_state = State.ROLL;
        OpenDrag();
    }
Example #14
0
 private void SetSound()
 {
     if (ConstantData.Sound)
     {
         m_SoundText.text = string.Format(HOLocalizationConfiguration.GetValue(161), HOLocalizationConfiguration.GetValue(421));
     }
     else
     {
         m_SoundText.text = string.Format(HOLocalizationConfiguration.GetValue(161), HOLocalizationConfiguration.GetValue(422));
     }
     HOAudioManager.SetSound(ConstantData.Sound);
 }
Example #15
0
 private void SetMusic()
 {
     if (ConstantData.Music)
     {
         m_MusicText.text = string.Format(HOLocalizationConfiguration.GetValue(160), HOLocalizationConfiguration.GetValue(421));
     }
     else
     {
         m_MusicText.text = string.Format(HOLocalizationConfiguration.GetValue(160), HOLocalizationConfiguration.GetValue(422));
     }
     HOAudioManager.SetMusic(ConstantData.Music);
 }
Example #16
0
 public void OnCollisionEnter(Collision collision)
 {
     if (collision.transform.CompareTag("Ball"))
     {
         if (!pocketTriggerBallList.Contains(collision.collider.GetInstanceID()))
         {
             HOAudioManager.PottedBall();
             collision.transform.GetComponent <PoolBall>().CloseRenderer();
             pocketTriggerBallList.Add(collision.collider.GetInstanceID());
         }
     }
 }
Example #17
0
 public virtual void OnCollisionEnter(Collision col)
 {
     if (col.gameObject.name.Contains("Rail"))
     {
         //we hit the wall.
         HOAudioManager.BallhitRail(m_rigidbody.velocity);
         if (!hitWall)
         {
             GameManager.Rules.BallHitRail();
             hitWall = true;
         }
     }
     if (col.gameObject.CompareTag("Ball"))
     {
         HOAudioManager.BallhitBall(m_rigidbody.velocity);
     }
 }
Example #18
0
    void Awake()
    {
        if (m_Instance == null)
        {
            m_Instance = this;
            DontDestroyOnLoad(gameObject);

            //Get music toggle
            if (!PlayerPrefs.HasKey(ConstantData.MusicVolumnKey))
            {
                ConstantData.Music = true;
            }
            else
            {
                ConstantData.Music = PlayerPrefs.GetInt(ConstantData.MusicVolumnKey) == 1;
            }

            //Get sound toggggggggggggggggggggggggle
            if (!PlayerPrefs.HasKey(ConstantData.SoundVolumnKey))
            {
                ConstantData.Sound = false;
            }
            else
            {
                ConstantData.Sound = PlayerPrefs.GetInt(ConstantData.SoundVolumnKey) == 1;
            }

            m_OneShotSource          = GetComponent <AudioSource>();
            m_LoopSource             = SupportTools.AddChild <AudioSource>(gameObject);
            m_LoopSource.loop        = true;
            m_LoopSource.playOnAwake = false;
            m_LoopSource.name        = "Loop source";
            m_ClipsPool = new System.Collections.Generic.Dictionary <string, AudioClip>(m_ClipsPoolCount);
            m_BGMPlayer = new BGMPlayer(gameObject);
        }
        else
        {
            Destroy(gameObject);
        }
    }
Example #19
0
 void OnFireBall()
 {
     m_Twinkle.enabled = false;
     HOAudioManager.StopLoopClip();
 }
Example #20
0
 public void StopLoopClip()
 {
     HOAudioManager.StopLoopClip();
 }
Example #21
0
 public void PlayLoopI(int key)
 {
     HOAudioManager.PlayLoopClip(key);
 }
Example #22
0
 public void PlayLoopS(string key)
 {
     HOAudioManager.PlayLoopClip(key);
 }
Example #23
0
 public void PlayI(int key)
 {
     HOAudioManager.PlayClip(key);
 }
Example #24
0
 public void PlayS(string key)
 {
     HOAudioManager.PlayClip(key, 1);
 }
    void Awake()
    {
        if (m_Instance == null)
        {
            m_Instance = this;
            DontDestroyOnLoad(gameObject);

            //Get music toggle
            if (!PlayerPrefs.HasKey(ConstantData.MusicVolumnKey))
                ConstantData.Music = true;
            else
                ConstantData.Music = PlayerPrefs.GetInt(ConstantData.MusicVolumnKey) == 1;

            //Get sound toggggggggggggggggggggggggle
            if (!PlayerPrefs.HasKey(ConstantData.SoundVolumnKey))
                ConstantData.Sound = false;
            else
                ConstantData.Sound = PlayerPrefs.GetInt(ConstantData.SoundVolumnKey) == 1;

            m_OneShotSource = GetComponent<AudioSource>();
            m_LoopSource = SupportTools.AddChild<AudioSource>(gameObject);
            m_LoopSource.loop = true;
            m_LoopSource.playOnAwake = false;
            m_LoopSource.name = "Loop source";
            m_ClipsPool = new System.Collections.Generic.Dictionary<string, AudioClip>(m_ClipsPoolCount);
            m_BGMPlayer = new BGMPlayer(gameObject);
        }
        else
        {
            Destroy(gameObject);
        }
    }
 void OnApplicationQuit()
 {
     m_ClipsPool.Clear();
     m_Instance = null;
     m_ClipCache = null;
     m_BGMPlayer.DestroySelf();
 }
Example #27
0
 public void OnPointerClick(PointerEventData eventData)
 {
     //GetComponent<AudioSource>().PlayOneShot();
     HOAudioManager.PlayClip(m_AudioClip);
 }
Example #28
0
 void OnDestroy()
 {
     m_Instance = null;
     GameStatistics.Serialize();
     HOAudioManager.StopLoopClip();
 }