private void Awake() { DependencyManager.AddDependency <AppStateMachine>(new AppStateMachine()); DependencyManager.AddDependency <SceneTransitionStateMachine>(new SceneTransitionStateMachine()); DependencyManager.AddDependency <ILog>(new DebugLog()); DependencyManager.AddDependency <ObjectPool>(new ObjectPool()); }
internal void AddDependency(string expressionKey, string dependsOn) { if (ContainsExpression(dependsOn) == false && Variables.ContainsKey(dependsOn) == false) { throw new InvalidOperationException($"Dependent expression or variable {dependsOn} does not exist"); } dependencies.AddDependency(expressionKey, dependsOn); }
private void Awake() { DependencyManager.AddDependency <PlatformMoveController>(this); foreach (var item in PlatformPrefabs) { Pool.PrewarmPool(item, PlatformCount); } for (int i = 0; i < PlatformCount; i++) { AddPlatform(); UpdatePlatformPosition(i); } }
private void Awake() { DependencyManager.AddDependency <RunController>(this); Balls = new List <BallController>(); var platformSizeHorizontal = PlatformMoveController.PlatformSize; platformSizeHorizontal.Scale(Vector3.forward); var verticalOffset = PlatformMoveController.PlatformSize; verticalOffset.Scale(Vector3.up / 2f); BallController ball; for (int i = 0; i < BallCount; i++) { ball = Instantiate(BallPrefabs.Random()); ball.transform.SetParent(transform); ball.transform.position = StartPos.position + platformSizeHorizontal * ((float)(1 + i) / (BallCount + 1) - 0.5f) + verticalOffset + Vector3.up * ball.Radius; ball.Name = (i + 1).ToString(); Balls.Add(ball); } }
private void Awake() { DependencyManager.AddDependency <LeaderBoard>(this); }