private void Awake() { m_InGameCamera = Camera.main.GetComponentOrFail <InGameCamera>(); m_Rigidbody2D = this.GetComponentOrFail <Rigidbody2D>(); m_Collider2D = this.GetComponentOrFail <BoxCollider2D>(); m_FlagBearer = this.GetComponentOrFail <FlagBearer>(); }
public void updateToCamera(InGameCamera camera, int frame) { if (Count == 0) { return; } float batchSize = Count / subDivide; float drawFrame = frame % subDivide; float start = batchSize * drawFrame; float end = start + batchSize; for (float i = start; i < end; i++) { camera.checkToDraw(this[(int)i]); } }
protected override void Init() { // Usually we'd have RaceManager to be DontDestroyOnLoad to preserve the stage index and increment it over races // but we currently use a self-contained scene system with no DontDestroyOnLoad (except PlayerInputGamepad), // so on new race start, a new RaceManager appears and auto-detects the stage index from the build index of the // current scene. Title scene is 0 and Stage scenes start at index 1, so subtract 1. m_CurrentStageIndex = SceneManager.GetActiveScene().buildIndex - 1; m_InGameCamera = Camera.main.GetComponentOrFail <InGameCamera>(); m_ConfettiParticleSystem = GameObject.FindWithTag(Tags.Confetti).GetComponentOrFail <ParticleSystem>(); #if SET_FLAG_ON_START m_FlagTr = GameObject.FindWithTag(Tags.Flag).transform; #endif RegisterRunners(); RegisterScriptsToRestart(); // If going from the title menu, some DontDestroyOnLoad PlayerInputGamepad have been preserved from the lobby, // and they know the player they should be bound to. Bind control to the matching runner now. RegisterAndSetupPlayerInputGamepadControls(); EvaluateRaceLength(); }
public Section() { camera = new InGameCamera(Vector2.Zero, Res.arrowAnim); }
private void Awake() { m_InGameCamera = Camera.main.GetComponentOrFail <InGameCamera>(); }