示例#1
0
 public void StartSimulation(Action <ITrail> simulationComplete, Transform parent,
                             Vector3 solutionStartPosition)
 {
     transform.parent        = parent;
     transform.localPosition = solutionStartPosition;
     solutionViewer.ClearTrail();
     this.simulationComplete = simulationComplete;
     animate.SetValue(true);
     Time.timeScale  = simulationSpeed;
     currSampleIndex = 0;
 }
示例#2
0
        public void NewLevel()
        {
            loadingScreen.enabled = true;
            levelPlayable.SetValue(false);
            levelGenerator.GenerateNewLevel();
            levelGenerator.LoadGeneratedLevel();

            var config       = levelConfigurationReference.GetLevelConfiguration();
            var solutionBall = Array.Find(world.GetComponentsInChildren <ItemAnimator>(),
                                          item => item.GetId() == config.solutionItemId);

            solutionTrailGenerator.transform.position = solutionBall.transform.position + config.solutionStartPositionOnItem;
            solutionTrailGenerator.StartSimulation(samples =>
            {
                solutionTrail = samples;
                levelGenerator.LoadGeneratedLevel();
                loadingScreen.enabled = false;
                levelPlayable.SetValue(true);
            }, solutionBall.transform, config.solutionStartPositionOnItem);
        }
示例#3
0
 private void StartTrail(RaycastHit hit)
 {
     currSpawner = Instantiate(prefab, hit.point, Quaternion.identity, hit.transform);
     animate.SetValue(true);
     wasAnimating = true;
 }