private void Start() { mg_JetpackReboot active = MinigameManager.GetActive <mg_JetpackReboot>(); m_scrollingData = active.GameLogic.ScrollingSpeed; ScrollingLayer = mg_jr_SpriteDrawingLayers.DrawingLayers.OBSTACLE_0; }
private void Start() { m_speedData = GetComponent <mg_jr_ScrollingSpeed>(); Assert.NotNull(m_speedData, "Odometer requires an mg_jr_ScrollingSpeed component on the same object"); Assert.NotNull(m_balance, "Balance can't be null, did you call Init?"); Assert.NotNull(m_goalManager, "Goal manager can't be null, did you call Init?"); Reset(); }
private void Start() { mg_jr_GameLogic gameLogic = MinigameManager.GetActive <mg_JetpackReboot>().GameLogic; m_speed = gameLogic.ScrollingSpeed; mg_jr_Environment mg_jr_Environment2 = AddNewEnvironment(new mg_jr_EnvironmentID(EnvironmentType.FOREST, EnvironmentVariant.DEFAULT)); CurrentEnvironment = m_environments[mg_jr_Environment2.Id]; CurrentEnvironment.gameObject.SetActive(value: true); AddNewEnvironment(new mg_jr_EnvironmentID(EnvironmentType.FOREST, EnvironmentVariant.NIGHT)); AddNewEnvironment(new mg_jr_EnvironmentID(EnvironmentType.CAVE, EnvironmentVariant.DEFAULT)); AddNewEnvironment(new mg_jr_EnvironmentID(EnvironmentType.TOWN, EnvironmentVariant.DEFAULT)); AddNewEnvironment(new mg_jr_EnvironmentID(EnvironmentType.TOWN, EnvironmentVariant.NIGHT)); AddNewEnvironment(new mg_jr_EnvironmentID(EnvironmentType.WATER, EnvironmentVariant.DEFAULT)); AddNewEnvironment(new mg_jr_EnvironmentID(EnvironmentType.WATER, EnvironmentVariant.NIGHT)); }
private void Start() { Assert.IsFalse(m_screenAreaInWorld.size == Vector3.zero, "Call Init before start"); m_leftScreenEdgeInWorld = m_screenAreaInWorld.min.x; float x = m_screenAreaInWorld.max.x; m_spriteSetForLayer = new List <SpriteRenderer>(16); foreach (Transform item in base.transform) { SpriteRenderer component = item.GetComponent <SpriteRenderer>(); m_spriteSetForLayer.Add(component); component.gameObject.SetActive(value: false); } Assert.That(m_spriteSetForLayer.Count > 0); foreach (SpriteRenderer item2 in m_spriteSetForLayer) { item2.sortingOrder = m_orderInLayer; } m_activeSprites = new List <SpriteRenderer>(32); int expected = (int)m_spriteSetForLayer[0].sprite.rect.width; foreach (SpriteRenderer activeSprite in m_activeSprites) { Assert.AreEqual(expected, (int)activeSprite.sprite.rect.width, "Sprites in parallax layer are not all of the same width"); } float x2 = m_spriteSetForLayer[0].sprite.bounds.size.x; float num = x - m_leftScreenEdgeInWorld; float num2 = num / x2; int num3 = Mathf.FloorToInt(num2); float num4 = num2 - (float)num3; m_spritesNeeded = num3 + 1; if (num4 > 0.001f) { m_spritesNeeded++; } while (m_activeSprites.Count < m_spritesNeeded) { AddRandomSpriteToQueue(); } m_scrollingSpeed = MinigameManager.GetActive <mg_JetpackReboot>().GameLogic.ScrollingSpeed; }
public void Init(mg_jr_ScrollingSpeed _scrolling, mg_jr_GameLogic _gameLogic) { m_scrolling = _scrolling; m_gameLogic = _gameLogic; }
public static mg_jr_Environment CreateEnvironment(mg_jr_EnvironmentID _id, mg_jr_ScrollingSpeed _scrolling) { return(CreateEnvironment(_id.Type, _id.Variant, _scrolling)); }
public static mg_jr_Environment CreateEnvironment(EnvironmentType _environmentType, EnvironmentVariant _variant, mg_jr_ScrollingSpeed _scrolling) { mg_JetpackReboot active = MinigameManager.GetActive <mg_JetpackReboot>(); GameObject gameObject = new GameObject("mg_jr_environment_" + _environmentType.ToString().ToLowerInvariant()); mg_jr_Environment mg_jr_Environment2 = gameObject.AddComponent <mg_jr_Environment>(); mg_jr_Environment2.Type = _environmentType; mg_jr_Environment2.Variant = _variant; mg_jr_Environment2.m_scrolling = _scrolling; foreach (EnvironmentLayer value in Enum.GetValues(typeof(EnvironmentLayer))) { if (value != EnvironmentLayer.MAX) { mg_jr_ParallaxLayer instancedParallaxLayer = active.Resources.GetInstancedParallaxLayer(_environmentType, _variant, value); instancedParallaxLayer.Init(active.GameLogic.TurboPlayArea); Assert.NotNull(instancedParallaxLayer, "There should be a parallaxlayer for every environment and layer combination"); mg_jr_Environment2.SetLayer(value, instancedParallaxLayer); } } return(mg_jr_Environment2); }