private void OnHitHazard(mg_bc_Hazard _hazard) { if (!m_isShielded) { switch (_hazard.HazardType) { case mg_bc_EHazardType.HAZARD_ANVIL: Die(mg_bc_EPenguinDeaths.DEATH_ANVIL); break; case mg_bc_EHazardType.HAZARD_FISH: Die(mg_bc_EPenguinDeaths.DEATH_FISH); break; case mg_bc_EHazardType.HAZARD_FLOWERS: Die(mg_bc_EPenguinDeaths.DEATH_POT); break; } _hazard.OnCaught(); Animator component = m_explosion.GetComponent <Animator>(); component.SetTrigger("start"); } else { Animator component2 = m_poof.GetComponent <Animator>(); if (component2.GetCurrentAnimatorStateInfo(0).fullPathHash == POOF_IDLE_HASH) { m_poof.GetComponent <Animator>().SetTrigger("start"); } } _hazard.Destroy(); }
private GameObject GetHazard(mg_bc_EHazardType _type) { mg_BeanCounter active = MinigameManager.GetActive <mg_BeanCounter>(); GameObject instancedResource = active.Resources.GetInstancedResource(mg_bc_EResourceList.GAME_ASSET_HAZARD); mg_bc_Hazard component = instancedResource.GetComponent <mg_bc_Hazard>(); component.SetType(_type); return(instancedResource); }
private void OnTriggerEnter2D(Collider2D _collider) { if (!IsDead && m_canCatch) { mg_bc_Hazard component = _collider.gameObject.GetComponent <mg_bc_Hazard>(); if (component != null) { OnHitHazard(component); } mg_bc_Bag component2 = _collider.gameObject.GetComponent <mg_bc_Bag>(); if (component2 != null) { OnCaughtBag(component2); } mg_bc_Powerup component3 = _collider.gameObject.GetComponent <mg_bc_Powerup>(); if (component3 != null) { OnCaughtPowerup(component3); } } }