protected override void Awake() { base.Awake(); base.HasPauseButton = false; base.ShouldShowPauseOver = false; mg_Pizzatron active = MinigameManager.GetActive <mg_Pizzatron>(); int ordersCompleted = active.GameLogic.OrdersCompleted; Localizer localizer = null; if (Service.IsSet <Localizer>()) { localizer = Service.Get <Localizer>(); } mg_pt_EResourceList assetTag; if (ordersCompleted <= 5) { assetTag = mg_pt_EResourceList.RESULT_BG_01; m_text = ((localizer == null) ? "Kitchen Chaos!" : localizer.GetTokenTranslation("Activity.MiniGames.KitchenChaos")); } else if (ordersCompleted <= 30) { assetTag = mg_pt_EResourceList.RESULT_BG_02; m_text = ((localizer == null) ? "On Special!" : localizer.GetTokenTranslation("Activity.MiniGames.OnSpecial")); } else { assetTag = mg_pt_EResourceList.RESULT_BG_03; m_text = ((localizer == null) ? "Dish of the Day!" : localizer.GetTokenTranslation("Activity.MiniGames.DishoftheDay")); } m_canContinue = ordersCompleted >= 40 && active.GameLogic.Lives > 0; m_background = active.Resources.GetInstancedResource(assetTag); MinigameSpriteHelper.AssignParentTransform(m_background, active.transform); }
protected override void Awake() { m_logic = new mg_ss_TitleLogic(this); base.Awake(); m_title = m_logic.Minigame.Resources.GetInstancedResource(mg_ss_EResourceList.TITLE_LOGIC); MinigameSpriteHelper.AssignParentTransform(m_title, m_logic.Minigame.transform); }
private GameObject CreateObject(mg_if_EResourceList p_tag) { GameObject instancedResource = m_minigame.Resources.GetInstancedResource(p_tag); MinigameSpriteHelper.AssignParentTransform(instancedResource, m_gameTransform); return(instancedResource); }
protected override void Awake() { m_logic = new mg_pt_GameLogic(); base.Awake(); m_game = m_logic.Minigame.Resources.GetInstancedResource(mg_pt_EResourceList.GAME_GENERIC); MinigameSpriteHelper.AssignParentTransform(m_game, m_logic.Minigame.transform); m_pizzaSpawnPoints = m_game.transform.Find("pizza_spawn_points"); }
protected override void Awake() { base.Awake(); mg_IceFishing active = MinigameManager.GetActive <mg_IceFishing>(); m_gameObject = active.Resources.GetInstancedResource(mg_if_EResourceList.GAME_LOGIC); MinigameSpriteHelper.AssignParentTransform(m_gameObject, active.transform); }
protected override void Awake() { base.Awake(); mg_IceFishing active = MinigameManager.GetActive <mg_IceFishing>(); m_title = active.Resources.GetInstancedResource(mg_if_EResourceList.TITLE_LOGIC); MinigameSpriteHelper.AssignParentTransform(m_title, active.transform); m_titleLogic = m_title.GetComponent <mg_if_TitleLogic>(); }
public void ShowCombo(int p_combo) { GameObject combo = m_logic.Minigame.Resources.GetCombo(p_combo); MinigameSpriteHelper.AssignParentTransform(combo, m_comboHolder); combo.transform.localPosition = new Vector2(0f, 0f); m_comboRenderer = combo.GetComponent <SpriteRenderer>(); m_alphaCountDown = 1f; }
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); }
protected override void Awake() { base.Awake(); m_gameSpecific = m_logic.Minigame.Resources.GetInstancedResource(mg_ss_EResourceList.GAME_SPECIFIC); MinigameSpriteHelper.AssignParentTransform(m_gameSpecific, m_logic.Minigame.transform); m_gameGeneric = m_logic.Minigame.Resources.GetInstancedResource(mg_ss_EResourceList.GAME_GENERIC); MinigameSpriteHelper.AssignParentTransform(m_gameGeneric, m_gameSpecific.transform); PlayerObject = m_gameGeneric.GetComponentInChildren <mg_ss_PlayerObject>(); ConveyorObject = m_gameGeneric.GetComponentInChildren <mg_ss_ConveyorObject>(); SplatterObject = m_gameGeneric.GetComponentInChildren <mg_ss_SplatterObject>(); GameZoneLeft = m_gameGeneric.transform.Find("game_zone/mg_ss_zone_left"); GameZoneRight = m_gameGeneric.transform.Find("game_zone/mg_ss_zone_right"); ItemGenerator = m_gameSpecific.GetComponentInChildren <mg_ss_ItemGenerator>(); }
private void CheckForSplats(mg_ss_BlobCluster p_cluster) { List <Vector3> splatPositions = p_cluster.GetSplatPositions(); float num = 1f; mg_ss_SplatObject mg_ss_SplatObject2 = null; foreach (Vector3 item in splatPositions) { num = Random.Range(m_minSplatScale, m_maxSplatScale); mg_ss_SplatObject2 = ((Random.Range(0, 5) != 0) ? MinigameManager.GetActive <mg_SmoothieSmash>().Resources.GetInstancedResource(mg_ss_EResourceList.GAME_SPLAT).GetComponent <mg_ss_SplatObject>() : MinigameManager.GetActive <mg_SmoothieSmash>().Resources.GetInstancedResource(mg_ss_EResourceList.GAME_SPLAT_LITTLE).GetComponent <mg_ss_SplatObject>()); mg_ss_SplatObject2.Initialize(item, num, p_cluster.Color); MinigameSpriteHelper.AssignParentTransform(mg_ss_SplatObject2.gameObject, base.transform); } }
public mg_ss_BlobCluster(int p_numBlobs, Vector2 p_initialOffset, Vector2 p_finalOffset, float p_initialClusterRadiusX, float p_initialClusterRadiusY, float p_finalClusterRadiusX, float p_finalClusterRadiusY, float p_initialBlobScale, float p_finalBlobScale, float p_blobScaleVariationPercentage, float p_duration, Color p_color, float p_blobDelay, bool p_showSplatter, float p_blobSinMin, float p_blobSinMax, Transform p_parentTransform) { Color = p_color; m_blobTTL = p_duration; m_timeActive = 0f; m_showSplatter = p_showSplatter; m_duration = p_duration + p_blobDelay * (float)p_numBlobs; m_blobs = new List <mg_ss_BlobObject>(); for (int i = 0; i < p_numBlobs; i++) { mg_ss_BlobObject component = MinigameManager.GetActive <mg_SmoothieSmash>().Resources.GetInstancedResource(mg_ss_EResourceList.GAME_SPLAT_BLOB).GetComponent <mg_ss_BlobObject>(); MinigameSpriteHelper.AssignParentTransform(component.gameObject, p_parentTransform); m_blobs.Add(component); component.Initialize(i, p_initialOffset, p_finalOffset, p_initialClusterRadiusX, p_initialClusterRadiusY, p_finalClusterRadiusX, p_finalClusterRadiusY, p_initialBlobScale, p_finalBlobScale, p_blobScaleVariationPercentage, p_color, p_blobDelay, p_blobSinMin, p_blobSinMax); } }
public void SpawnItem(mg_ss_EItemTypes p_itemType, mg_ss_IItemMovement p_movement, float p_timeAdjustment, bool p_chaosItem = false) { GameObject resource = GetResource(p_itemType); if (resource != null) { MinigameSpriteHelper.AssignParentTransform(resource, m_transformParent); mg_ss_ItemObject component = resource.GetComponent <mg_ss_ItemObject>(); m_spawnedItems.Add(component); Vector2 p_spawnPointTop = m_spawnTop.position; Vector2 p_spawnPointBottom = m_spawnBottom.position; p_spawnPointBottom.x = p_spawnPointTop.x; component.Initialize(p_itemType, p_movement, p_spawnPointBottom, p_spawnPointTop, m_screenHalfWidth, p_chaosItem); component.UpdatePosition(p_timeAdjustment, ConveyorSpeed); CheckHighlight(component); } }
public void OnCustomerLeft() { if (m_currentCustomer.IsSpecial) { Object.Destroy(m_currentCustomer.gameObject); m_currentCustomer = m_customerGeneric; } if (m_orderLogic.IsSpecial) { GameObject customer = MinigameManager.GetActive <mg_SmoothieSmash>().Resources.GetCustomer(m_orderLogic.SpecialCustomer); MinigameSpriteHelper.AssignParentTransform(customer, base.transform); customer.transform.localPosition = new Vector2(0f, 0f); m_currentCustomer = customer.GetComponent <mg_ss_CustomerObject>(); m_currentCustomer.Initialize(this, p_isSpecial: true); } m_currentCustomer.ZipIn(); m_orderSystemObject.OnCustomerLeft(); m_customerTransitioning = false; }
public void Reset() { m_totalCoinsSpawned = 0; m_gameLogic.Order.Reset(); SpeedModifier = 1f; State = mg_pt_EPizzaState.ACTIVE; m_toppings.ForEach(delegate(mg_pt_Topping topping) { topping.Reset(); }); m_toppings.Clear(); if (m_pizzaObject != null) { Object.Destroy(m_pizzaObject.gameObject); } m_pizzaObject = m_gameLogic.Minigame.Resources.GetInstancedResource(m_gameLogic.Order.PizzaBase).GetComponent <mg_pt_PizzaObject>(); MinigameSpriteHelper.AssignParentTransform(m_pizzaObject.gameObject, m_gameScreen.GameTransform); m_pizzaObject.transform.position = m_gameScreen.PizzaSpawnStart.position; m_sauceBeingAdded = mg_pt_EToppingType.INVALID; }
private void Spawn() { GameObject gameObject = GenerateObjectToSpawn(); if (gameObject != null) { mg_bc_FlyingObject component = gameObject.GetComponent <mg_bc_FlyingObject>(); MinigameSpriteHelper.AssignParentTransform(gameObject, base.transform.parent); m_flyingObjects.Add(component); gameObject.transform.localPosition = m_spawnLocation; component.SetLayers(m_availableSpriteLayers.Dequeue(), m_availableSpriteLayers.Dequeue()); string text = "mg_bc_sfx_BagThrowWhoosh0" + UnityEngine.Random.Range(1, 4); MinigameManager.GetActive().PlaySFX(text); m_timeSinceLastSpawn = 0f; Rigidbody2D component2 = gameObject.GetComponent <Rigidbody2D>(); component2.gravityScale = 2f; int num = UnityEngine.Random.Range(0, VELOCITIES.Length); component2.AddForce(VELOCITIES[num]); } }
public void FlyApplesFly(mg_SmoothieSmash p_minigame) { Camera mainCamera = MinigameManager.GetActive().MainCamera; Vector2 start = new Vector2(0f - mainCamera.aspect * mainCamera.orthographicSize, mainCamera.orthographicSize); start.x /= p_minigame.transform.lossyScale.x; start.x -= -0.714f; start.y /= p_minigame.transform.lossyScale.y; start.y -= 1.16f; mg_ss_GoldenApple_FlyInfo p_flyInfo = default(mg_ss_GoldenApple_FlyInfo); p_flyInfo.Start = start; p_flyInfo.Target = m_playerObject.transform.position; p_flyInfo.Target.y -= 0.2f * p_minigame.transform.lossyScale.y; p_flyInfo.TotalFlyTime = 1f; p_flyInfo.RemainingFlyTime = 1f; mg_ss_GoldenApple_RotateInfo p_rotateInfo = default(mg_ss_GoldenApple_RotateInfo); p_rotateInfo.StartingAngle = 4.712389f; p_rotateInfo.CurrentAngle = p_rotateInfo.StartingAngle; p_rotateInfo.RotateTime = 1f; p_rotateInfo.MaxTurns = 1f; p_rotateInfo.Radius = 1.5f; p_rotateInfo.Offset = 0.2f * p_minigame.transform.lossyScale.y; float num = 0.2f; for (int i = 0; i < 5; i++) { GameObject instancedResource = p_minigame.Resources.GetInstancedResource(mg_ss_EResourceList.GAME_GOLDEN_APPLE_ROTATE); MinigameSpriteHelper.AssignParentTransform(instancedResource, p_minigame.transform); mg_ss_GoldenAppleRotationObject component = instancedResource.GetComponent <mg_ss_GoldenAppleRotationObject>(); component.Fly(p_flyInfo); component.RotateAround(p_rotateInfo); component.Delay((float)i * num); m_apples.Add(component); } }