private IEnumerator AddHeartIcon(mg_ss_Item_FruitObject p_fruit, float p_delay)
        {
            yield return(new WaitForSeconds(p_delay));

            GameObject heartIcon = m_logic.Minigame.Resources.GetInstancedResource(mg_ss_EResourceList.GAME_HEART_ICON);

            MinigameSpriteHelper.AssignParentTransform(heartIcon, base.transform);
            heartIcon.GetComponent <mg_ss_HealthIcon>().Initialize(p_fruit, base.transform);
        }
Exemple #2
0
 public override void OnFruitCollision(mg_ss_Item_FruitObject p_fruit)
 {
     if (!p_fruit.ChaosItem)
     {
         m_gameLogic.ComboIncrease(p_fruit);
     }
     MinigameManager.GetActive().PlaySFX("mg_ss_sfx_fruit_splat_" + Random.Range(1, 3).ToString("00"));
     m_gameLogic.OnFruitSquashed(p_fruit, p_correctFruit: false);
 }
Exemple #3
0
 public virtual void OnFruitCollision(mg_ss_Item_FruitObject p_fruit)
 {
     Scoring.Score += 10;
     Scoring.Score += Combo * 2;
     m_conveyor.IncreaseSpeedMultiplier();
     m_itemGenerator.OnFruitCollision(p_fruit);
     if (p_fruit.ChaosItem)
     {
         OnChaosItemCollision();
     }
 }
 private void ShowHeartIcons(mg_ss_Item_FruitObject p_fruit)
 {
     StartCoroutine(AddHeartIcon(p_fruit, 0f));
     if (p_fruit.CollideState == mg_ss_ECollideState.SMASH)
     {
         float num = 0.2f;
         for (int i = 1; i < 3; i++)
         {
             StartCoroutine(AddHeartIcon(p_fruit, num));
             num += 0.2f;
         }
     }
 }
        public void OnFruitCollision(mg_ss_Item_FruitObject p_fruit)
        {
            int p_health = 2;

            if (p_fruit.CollideState == mg_ss_ECollideState.SMASH)
            {
                p_health = 4;
            }
            m_logic.AddHealth(p_health);
            if (!p_fruit.ChaosItem)
            {
                ShowHeartIcons(p_fruit);
            }
        }
Exemple #6
0
        public void OnFruitSquashed(mg_ss_Item_FruitObject p_fruit, bool p_correctFruit)
        {
            Color color = p_fruit.Color;

            if (p_correctFruit)
            {
                m_splatterObject.SetBlobRadii(0.1f, 0.1f, 0f, 0f);
                m_splatterObject.Smash(15, p_fruit.transform.position, 0.6f, color, 0.03f, p_showSplatter: false);
            }
            else
            {
                m_splatterObject.SetBlobRadii(0.1f, 0.1f, 0.8f, 0.8f);
                m_splatterObject.SmashTo(3, p_fruit.transform.position, CalculatSplatFinalPos(), 1f, color, 0.1f, p_showSplatter: true);
                m_splatterObject.SmashTo(3, p_fruit.transform.position, CalculatSplatFinalPos(), 1f, color, 0.1f, p_showSplatter: true);
            }
        }
        public bool OnFruitCollision(mg_ss_Item_FruitObject p_fruit)
        {
            bool result = false;

            if (!p_fruit.ChaosItem && IsFruitPartOfOrder(p_fruit.ItemType))
            {
                result = true;
                m_currentOrder.CompleteStep(p_fruit.ItemType);
                m_orderSystemObject.StepCompleted();
                if (m_currentOrder.OrderCompleted)
                {
                    OrderCompleted(m_currentOrder.IsSpecial);
                }
                m_itemGenerator.HighlightItemTypes(m_currentOrder.GetItemTypes());
            }
            return(result);
        }
Exemple #8
0
        public override void OnFruitCollision(mg_ss_Item_FruitObject p_fruit)
        {
            bool p_correctFruit = false;

            if (m_orderSystem.OnFruitCollision(p_fruit))
            {
                p_correctFruit = true;
                m_gameLogic.ComboIncrease(p_fruit);
                MinigameManager.GetActive().PlaySFX("mg_ss_sfx_fruit_splat_" + Random.Range(1, 3).ToString("00"));
            }
            else if (!p_fruit.ChaosItem)
            {
                m_gameLogic.ComboReset();
                PlayErrorSFX();
            }
            else
            {
                MinigameManager.GetActive().PlaySFX("mg_ss_sfx_fruit_splat_" + Random.Range(1, 3).ToString("00"));
            }
            m_gameLogic.OnFruitSquashed(p_fruit, p_correctFruit);
        }
Exemple #9
0
 public override void OnFruitCollision(mg_ss_Item_FruitObject p_fruit)
 {
     m_healthBonusManager.OnFruitCollision(p_fruit);
     base.OnFruitCollision(p_fruit);
 }
Exemple #10
0
 public void ComboIncrease(mg_ss_Item_FruitObject p_fruit)
 {
     Combo++;
     p_fruit.ShowCombo(Combo);
     MinigameManager.GetActive().PlaySFX("mg_ss_sfx_fruit_point_" + Mathf.Min(Combo, 5).ToString("00"));
 }
Exemple #11
0
 public void OnFruitSquashed(mg_ss_Item_FruitObject p_fruit, bool p_correctFruit)
 {
     ItemManager.OnFruitSquashed(p_fruit, p_correctFruit);
 }
Exemple #12
0
 public virtual void OnFruitCollision(mg_ss_Item_FruitObject p_fruit)
 {
 }
 public void Initialize(mg_ss_Item_FruitObject p_fruit, Transform p_target)
 {
     m_startPos              = p_fruit.transform.position;
     m_targetPos             = p_target.position;
     base.transform.position = m_startPos;
 }