public void GenerateMesh(ExtrudeShape shape, float detail)
    {
        List <OrientationPoint> path = new List <OrientationPoint>();
        int refPointCount            = Mathf.FloorToInt(ControlPointCount * detail);

        for (int i = 0; i < refPointCount; i++)
        {
            float      t = (float)i / refPointCount;
            Vector3    generatePointRef = GetPoint(t);
            Quaternion rotation         = Quaternion.LookRotation(GetDirection(t), Vector3.up);

            path.Add(new OrientationPoint(generatePointRef, rotation));

            if (i == 1)
            {
                path.Add(new OrientationPoint(generatePointRef, rotation));
            }
        }

        if (Loop)
        {
            path.Add(path[0]);
        }

        GetComponent <MeshFilter>().sharedMesh = TrackGenerator.Extrude(shape, path.ToArray());
    }
示例#2
0
    public RacingTrack CreateTrack(int seed, int length, float difficulty)
    {
        System.Random rand = new System.Random(seed);

        GameObject trackBase = null;

        bool done = false;

        while (!done)
        {
            string name = "RacingTrack" + rand.Next(10000).ToString();
            trackBase = new GameObject(name);

            TrackGenerator generator = new TrackGenerator(trackBase, rand, trackChunks);
            generator.difficulty = difficulty;
            generator.length     = length;

            try {
                generator.GenerateTrack();
                done = true;
            } catch (TrackGenerator.InvalidTrackException) {
                if (Application.isPlaying)
                {
                    Destroy(trackBase);
                }
            }
        }

        return(trackBase.GetComponent <RacingTrack>());
    }
示例#3
0
    void Awake()
    {
        if (m_bIsOpponentTrackGenerator)
        {
            OpponentInstance = this;
        }
        else
        {
            Instance = this;
        }

        m_tileLength = m_trackPrefabs[0].GetComponent <SpriteRenderer>().size.y;
        for (m_newTileIndex = 0; m_newTileIndex < m_trackTileBufferSize; ++m_newTileIndex)
        {
            var go = (GameObject)Instantiate(m_trackPrefabs[0], new Vector3(transform.position.x, (float)m_newTileIndex * m_tileLength, transform.position.z), Quaternion.identity);
            if (m_bIsOpponentTrackGenerator)
            {
                go.GetComponent <TrackTile>().m_bIsOpponentTrack = true;
                go.name += "_opponent";
            }
            else
            {
                go.GetComponent <TrackTile>().m_bIsOpponentTrack = false;

                go.name += "_local";
            }
        }
    }
示例#4
0
 public ConferenceTrackManager(IDisplay display, IInputCollector inputCollector, IInputProvider inputProvider, IInputProcessor inputProcessor, TrackGenerator trackGenerator)
 {
     _display        = display;
     _inputCollector = inputCollector;
     _inputProvider  = inputProvider;
     _inputProcessor = inputProcessor;
     _trackGenerator = trackGenerator;
 }
示例#5
0
    public override Node GetTrack()
    {
        TrackInstance bassInstance = bass.GetComponent <TrackInstance>();

        if (bassInstance != null)
        {
            return(TrackGenerator.GenerateMelody(bassInstance.GetTrack(), tableType));
        }
        return(null);
    }
示例#6
0
    private void Start()
    {
        Application.targetFrameRate = 60;

        TrackGenerator trackGenerator = new TrackGenerator();

        m_track = trackGenerator.Generate(m_platformPrefab, m_seed);

        m_dude.SetTrack(m_track);
    }
示例#7
0
    private void Awake()
    {
        // Singleton
        instance = this;


        // Begin
        Application.targetFrameRate = 60;

        highScorePanel.SetActive(false);

        // First Start Defaulu Settings
        if (PlayerPrefs.GetInt("firstStart", 0) == 0)
        {
            PlayerPrefs.SetInt("firstStart", 1);
            PlayerPrefs.SetInt("rate_complete", 0);
            PlayerPrefs.SetInt("rate_peak", 16);

            PlayerPrefs.SetInt("audio", 1);
            PlayerPrefs.SetInt("highscore", 0);
            PlayerPrefs.SetInt("ads_unitypeak", 5);
            PlayerPrefs.SetInt("ads_chartboostpeak", 0);
        }


        // Assing Bending Values
        Shader.SetGlobalFloat("_V_CW_X_Bend_Size", bendingX);
        Shader.SetGlobalFloat("_V_CW_Y_Bend_Size", bendingY);
        Shader.SetGlobalFloat("_V_CW_Z_Bend_Size", 0);
        Shader.SetGlobalFloat("_V_CW_Z_Bend_Bias", 0);
        Shader.SetGlobalFloat("_V_CW_Camera_Bend_Offset", 0);



        player           = GameObject.Find("Player");
        playerController = GameObject.Find("playerController");

        controller      = GetComponent <Controller>();
        audioController = GetComponent <AudioController>();

        mainCamera      = GameObject.Find("Main Camera").GetComponent <Camera>();
        cameraFovEffetc = GameObject.Find("Main Camera").GetComponent <TweenFOV>();

        cameraController = GetComponent <CameraController>();

        trackGenerator    = GetComponent <TrackGenerator>();
        achievements      = GetComponent <Achievements>();
        powerupController = GetComponent <PowerupController>();
        touchController   = GetComponent <TouchController>();
    }
    private void Awake()
    {
        //sets up singleton
        if (instance == null)
        {
            instance = this;
        }
        if (instance != this)
        {
            Destroy(this);
        }

        TG = FindObjectOfType <TrackGenerator>();
    }
示例#9
0
文件: GameTools.cs 项目: nqnq/pa22
    static GameObject getGameObjectPrefab(string ID)
    {
        TrackGenerator trackGen = GameObject.Find("PlayMaker").GetComponent <TrackGenerator>();

        foreach (GameObject item in trackGen.trackObjects)
        {
            if (item.GetComponent <TrackObject>().ID.Equals(ID))
            {
                return(item);
            }
        }

        return(null);
    }
示例#10
0
        public void It_Should_Return_ValidTracks_Given_AListOfTalks(List <Block> talks, List <string> expectedFirstTrack)
        {
            //arrange
            var morningSession   = new SessionAllocator(ConfigurationLoader.LoadSessionConfiguration("morningSession.json"));
            var afternoonSession = new SessionAllocator(ConfigurationLoader.LoadSessionConfiguration("afternoonSession.json"));
            var trackGenerator   = new TrackGenerator(2, new List <SessionAllocator> {
                morningSession, afternoonSession
            }, new TalkDurationValidator());

            //act
            var tracks = trackGenerator.GenerateTracks(talks);

            //assert
            var actualFirstTrack = tracks[0].Blocks.Select(t => t.BlockName).ToList();

            Assert.Equal(expectedFirstTrack, actualFirstTrack);
        }
示例#11
0
        public void It_Should_Indicate_AllocationStatusOfAllTalks(List <Block> talks)
        {
            //arrange
            var morningSession   = new SessionAllocator(ConfigurationLoader.LoadSessionConfiguration("morningSession.json"));
            var afternoonSession = new SessionAllocator(ConfigurationLoader.LoadSessionConfiguration("afternoonSession.json"));
            var trackGenerator   = new TrackGenerator(2, new List <SessionAllocator> {
                morningSession, afternoonSession
            }, new TalkDurationValidator());

            //act
            var tracks = trackGenerator.GenerateTracks(talks);

            //assert
            foreach (var block in tracks.SelectMany(track => track.Blocks))
            {
                Assert.True(block.IsAllocated);
            }
        }
示例#12
0
        public void It_Should_ExitTheApplication_When_UserInputIsQ()
        {
            //Arrange
            var trackGenerator = new TrackGenerator(
                2,
                new List <SessionAllocator>
            {
                new SessionAllocator(
                    ConfigurationLoader.LoadSessionConfiguration("morningSession.json")),
                new SessionAllocator(
                    ConfigurationLoader.LoadSessionConfiguration("afternoonSession.json"))
            },
                new TalkDurationValidator());

            var pathValidator = new PathValidator();

            var talkValidator = new TalkValidator();

            var consoleDisplay = new ConsoleDisplayStub();

            var consoleCollector = new Mock <IInputCollector>();

            consoleCollector.SetupSequence(x => x.Collect())
            .Returns("q");

            var conferenceTrackManager = new ConferenceTrackManager(consoleDisplay, consoleCollector.Object, new TextFileInputProvider(pathValidator), new TextFileInputProcessor(talkValidator), trackGenerator);

            //Act
            conferenceTrackManager.ManageTracks();

            //Assert
            var expectedMessages = new List <string>
            {
                Constants.Welcome,
                Constants.FilePathPrompt
            };

            for (var i = 0; i < consoleDisplay.Messages.Count; i++)
            {
                Assert.Equal(expectedMessages[i], consoleDisplay.Messages[i]);
            }
            //Assert.True(consoleDisplay.Messages.SequenceEqual(expectedMessages));
        }
示例#13
0
        public void It_Should_Return_AListOfTalksThatFitIntoTheAfternoonSession_Given_AListOfTalks(List <Block> talks,
                                                                                                   List <List <string> > expectedAfternoonSessions)
        {
            //arrange
            var morningSession   = new SessionAllocator(ConfigurationLoader.LoadSessionConfiguration("morningSession.json"));
            var afternoonSession = new SessionAllocator(ConfigurationLoader.LoadSessionConfiguration("afternoonSession.json"));
            var trackGenerator   = new TrackGenerator(2, new List <SessionAllocator> {
                morningSession, afternoonSession
            }, new TalkDurationValidator());

            //act
            trackGenerator.GenerateTracks(talks);

            //assert
            var afternoonSessions = trackGenerator.SessionAllocators[1].Sessions
                                    .Select(s => s.Select(t => t.BlockName).ToList()).ToList();

            Assert.Equal(expectedAfternoonSessions, afternoonSessions);
        }
示例#14
0
    private void Awake()
    {
        // Need a track mesh and generator script to determine track size,
        // sections per bezier curve, and spline to follow
        if (trackMesh == null || trackMesh.GetComponent <TrackGenerator>() == null)
        {
            return;
        }

        TrackGenerator trackGenerator = trackMesh.GetComponent <TrackGenerator>();

        trackWidth  = trackGenerator.trackWidth;
        trackHeight = trackGenerator.trackHeight;

        sectionsPerCurve = trackGenerator.sectionsPerCurve;

        spline = trackGenerator.spline;

        Generate();
    }
示例#15
0
        static void Main(string[] args)
        {
            var morningSessionAllocator = new SessionAllocator(
                ConfigurationLoader.LoadSessionConfiguration("morningSession.json"));

            var afternoonSessionAllocator = new SessionAllocator(
                ConfigurationLoader.LoadSessionConfiguration("afternoonSession.json"));

            var trackGenerator = new TrackGenerator(
                2,
                new List <SessionAllocator>
            {
                morningSessionAllocator,
                afternoonSessionAllocator
            },
                new TalkDurationValidator());

            var talkValidator = new TalkValidator();

            var pathValidator = new PathValidator();

            var conferenceTrackManager = new ConferenceTrackManager(
                new ConsoleDisplay(),
                new ConsoleInputCollector(),
                new TextFileInputProvider(pathValidator),
                new TextFileInputProcessor(talkValidator),
                trackGenerator);

            conferenceTrackManager.ManageTracks();

            // /Users/amanda.chau/fma/fma-katas/ConferenceTrackManagementKata/ConferenceTrack.UnitTests/Input/OriginalTestInput.txt

            ///Users/amanda.chau/fma/fma-katas/ConferenceTrackManagementKata/ConferenceTrack.UnitTests/Input/InvalidTestInput.txt
            ///
            /// /Users/amanda.chau/fma/fma-katas/ConferenceTrackManagementKata/ConferenceTrack.UnitTests/Input/InvalidTalkDuration.txt
        }
示例#16
0
文件: GameTools.cs 项目: nqnq/pa22
    private static void synceTrackObjects()
    {
        if (Selection.activeGameObject == null)
        {
            Debug.Log("Please select a track");
            return;
        }

        if (Selection.activeGameObject.transform.Find("trackObjects") == null)
        {
            Debug.Log("Track object does not contains trackObjects root");
            return;
        }

        TrackGenerator trackGen = GameObject.Find("PlayMaker").GetComponent <TrackGenerator>();

        if (trackGen == null)
        {
            Debug.Log("Track generator gameobject not found");
            return;
        }


        foreach (GameObject currentObject in trackGen.trackObjects)
        {
            TrackObject tObject = currentObject.GetComponent <TrackObject>();
            if (tObject != null)
            {
                switch (tObject.ID)
                {
                case "gray1":
                    tObject.objectGroup = TrackObject.ObjectGroup.Bales1;
                    tObject.objectType  = TrackObject.ObjectType.BaleGray1;
                    break;

                case "gray3":
                    tObject.objectGroup = TrackObject.ObjectGroup.Bales3;
                    tObject.objectType  = TrackObject.ObjectType.BaleGray3;
                    break;

                case "gray5":
                    tObject.objectGroup = TrackObject.ObjectGroup.Bales5;
                    tObject.objectType  = TrackObject.ObjectType.BaleGray5;
                    break;

                case "green1":
                    tObject.objectGroup = TrackObject.ObjectGroup.Bales1;
                    tObject.objectType  = TrackObject.ObjectType.BaleGreen1;
                    break;

                case "green3":
                    tObject.objectGroup = TrackObject.ObjectGroup.Bales3;
                    tObject.objectType  = TrackObject.ObjectType.BaleGreen3;
                    break;

                case "green5":
                    tObject.objectGroup = TrackObject.ObjectGroup.Bales5;
                    tObject.objectType  = TrackObject.ObjectType.BaleGreen5;
                    break;

                case "yellow1":
                    tObject.objectGroup = TrackObject.ObjectGroup.Bales1;
                    tObject.objectType  = TrackObject.ObjectType.BaleYellow1;
                    break;

                case "yellow3":
                    tObject.objectGroup = TrackObject.ObjectGroup.Bales3;
                    tObject.objectType  = TrackObject.ObjectType.BaleYellow3;
                    break;

                case "yellow5":
                    tObject.objectGroup = TrackObject.ObjectGroup.Bales5;
                    tObject.objectType  = TrackObject.ObjectType.BaleYellow5;
                    break;

                case "ramp":
                    tObject.objectGroup = TrackObject.ObjectGroup.None;
                    tObject.objectType  = TrackObject.ObjectType.Ramp;
                    break;

                case "barrierdown":
                    tObject.objectGroup = TrackObject.ObjectGroup.Barriers;
                    tObject.objectType  = TrackObject.ObjectType.BarrierDown;
                    break;

                case "barrierdownup":
                    tObject.objectGroup = TrackObject.ObjectGroup.Barriers;
                    tObject.objectType  = TrackObject.ObjectType.BarrierUpDown;
                    break;

                case "barrierup":
                    tObject.objectGroup = TrackObject.ObjectGroup.Barriers;
                    tObject.objectType  = TrackObject.ObjectType.BarrierUp;
                    break;

                case "currency":
                    tObject.objectGroup = TrackObject.ObjectGroup.None;
                    tObject.objectType  = TrackObject.ObjectType.PointsSingle;
                    break;

                case "pointscurve":
                    tObject.objectGroup = TrackObject.ObjectGroup.None;
                    tObject.objectType  = TrackObject.ObjectType.PointsCurve;
                    break;

                case "pointsline":
                    tObject.objectGroup = TrackObject.ObjectGroup.None;
                    tObject.objectType  = TrackObject.ObjectType.PointsLine;
                    break;

                case "pointsmovingline":
                    tObject.objectGroup = TrackObject.ObjectGroup.None;
                    tObject.objectType  = TrackObject.ObjectType.PointsMovingLine;
                    break;

                case "trailgray3":
                    tObject.objectGroup = TrackObject.ObjectGroup.MovingObstaclesTrail3;
                    tObject.objectType  = TrackObject.ObjectType.TrailGray3;
                    break;

                case "trailgray5":
                    tObject.objectGroup = TrackObject.ObjectGroup.MovingObstaclesTrail5;
                    tObject.objectType  = TrackObject.ObjectType.TrailGray5;
                    break;

                case "trailgreen3":
                    tObject.objectGroup = TrackObject.ObjectGroup.MovingObstaclesTrail3;
                    tObject.objectType  = TrackObject.ObjectType.TrailGreen3;
                    break;

                case "trailgreen5":
                    tObject.objectGroup = TrackObject.ObjectGroup.MovingObstaclesTrail5;
                    tObject.objectType  = TrackObject.ObjectType.TrailGreen5;
                    break;

                case "trailyellow3":
                    tObject.objectGroup = TrackObject.ObjectGroup.MovingObstaclesTrail3;
                    tObject.objectType  = TrackObject.ObjectType.TrailYellow3;
                    break;

                case "trailyellow5":
                    tObject.objectGroup = TrackObject.ObjectGroup.MovingObstaclesTrail5;
                    tObject.objectType  = TrackObject.ObjectType.TrailYellow5;
                    break;

                case "croco":
                    tObject.objectGroup = TrackObject.ObjectGroup.CharacterObstacles;
                    tObject.objectType  = TrackObject.ObjectType.StaticCroco;
                    break;

                case "monke":
                    tObject.objectGroup = TrackObject.ObjectGroup.CharacterObstacles;
                    tObject.objectType  = TrackObject.ObjectType.StaticMonke;
                    break;

                case "tunnel2path":
                    tObject.objectGroup = TrackObject.ObjectGroup.Tunnels;
                    tObject.objectType  = TrackObject.ObjectType.Tunnel2Path;
                    break;

                case "tunnelcenter":
                    tObject.objectGroup = TrackObject.ObjectGroup.Tunnels;
                    tObject.objectType  = TrackObject.ObjectType.TunnelCenter;
                    break;

                case "tunnelleft":
                    tObject.objectGroup = TrackObject.ObjectGroup.Tunnels;
                    tObject.objectType  = TrackObject.ObjectType.TunnelLeft;
                    break;

                case "tunnelright":
                    tObject.objectGroup = TrackObject.ObjectGroup.Tunnels;
                    tObject.objectType  = TrackObject.ObjectType.TunnelRight;
                    break;

                case "elephant":
                    tObject.objectGroup = TrackObject.ObjectGroup.MovingObstaclesSingle;
                    tObject.objectType  = TrackObject.ObjectType.MovingElephant;
                    break;

                case "gazelle":
                    tObject.objectGroup = TrackObject.ObjectGroup.MovingObstaclesSingle;
                    tObject.objectType  = TrackObject.ObjectType.MovingGazelle;
                    break;

                case "gireffe":
                    tObject.objectGroup = TrackObject.ObjectGroup.MovingObstaclesSingle;
                    tObject.objectType  = TrackObject.ObjectType.MovingGireffe;
                    break;

                case "hippo":
                    tObject.objectGroup = TrackObject.ObjectGroup.MovingObstaclesSingle;
                    tObject.objectType  = TrackObject.ObjectType.MovingHippo;
                    break;

                case "lion":
                    tObject.objectGroup = TrackObject.ObjectGroup.MovingObstaclesSingle;
                    tObject.objectType  = TrackObject.ObjectType.MovingLion;
                    break;

                case "rhino":
                    tObject.objectGroup = TrackObject.ObjectGroup.MovingObstaclesSingle;
                    tObject.objectType  = TrackObject.ObjectType.MovingRhino;
                    break;

                case "tiger":
                    tObject.objectGroup = TrackObject.ObjectGroup.MovingObstaclesSingle;
                    tObject.objectType  = TrackObject.ObjectType.MovingTiger;
                    break;
                }

                // Syncing Track Object
                //changeElementTypeInScene(trackGen,tObject.ID,tObject.objectGroup,tObject.objectType);

                Transform trackObjectsRoot = Selection.activeGameObject.transform.Find("trackObjects");

                if (trackObjectsRoot != null)
                {
                    List <GameObject> trackObjectsClone = new List <GameObject>();

                    foreach (Transform item in trackObjectsRoot.transform)
                    {
                        trackObjectsClone.Add(item.gameObject);
                    }


                    foreach (GameObject existTrackObject in trackObjectsClone)
                    {
                        TrackObject tObj = existTrackObject.GetComponent <TrackObject>();
                        if (tObj != null)
                        {
                            if (tObj.ID.Equals(tObject.ID))
                            {
                                // Assign Object Type
                                tObj.objectGroup = tObject.objectGroup;
                                tObj.objectType  = tObject.objectType;

                                GameObject newPrefab = getGameObjectPrefab(tObj.ID);
                                if (newPrefab != null)
                                {
                                    GameObject newTrackObject = (GameObject)Editor.Instantiate(newPrefab, Vector3.zero, Quaternion.identity);
                                    newTrackObject.transform.parent = trackObjectsRoot.transform;

                                    newTrackObject.GetComponent <TrackObject>().placeHolder    = tObj.placeHolder;
                                    newTrackObject.GetComponent <TrackObject>().disableShuffle = tObj.disableShuffle;

                                    newTrackObject.transform.position      = existTrackObject.transform.position;
                                    newTrackObject.transform.localPosition = existTrackObject.transform.localPosition;


                                    // Speacial Components

                                    if (existTrackObject.GetComponent <MovingObstacle>() != null)
                                    {
                                        copyComponentValues(existTrackObject.GetComponent <MovingObstacle>(), newTrackObject.GetComponent <MovingObstacle>());
                                    }
                                    if (existTrackObject.GetComponent <CoinLine>() != null)
                                    {
                                        copyComponentValues(existTrackObject.GetComponent <CoinLine>(), newTrackObject.GetComponent <CoinLine>());
                                    }
                                    if (existTrackObject.GetComponent <CoinCurve>() != null)
                                    {
                                        copyComponentValues(existTrackObject.GetComponent <CoinCurve>(), newTrackObject.GetComponent <CoinCurve>());
                                    }
                                    if (existTrackObject.GetComponent <MovingCoin>() != null)
                                    {
                                        copyComponentValues(existTrackObject.GetComponent <MovingCoin>(), newTrackObject.GetComponent <MovingCoin>());
                                    }

                                    Editor.DestroyImmediate(existTrackObject);
                                }
                            }
                        }
                    }
                }
            }
        }
    }
示例#17
0
        public void It_Should_DisplayErrorsAndTracks_WhenGivenInValidFilesThenAValidOne()
        {
            //Arrange
            var trackGenerator = new TrackGenerator(
                2,
                new List <SessionAllocator>
            {
                new SessionAllocator(
                    ConfigurationLoader.LoadSessionConfiguration("morningSession.json")),
                new SessionAllocator(
                    ConfigurationLoader.LoadSessionConfiguration("afternoonSession.json"))
            },
                new TalkDurationValidator());

            var pathValidator = new PathValidator();

            var talkValidator = new TalkValidator();

            var consoleDisplay = new ConsoleDisplayStub();

            var consoleCollector = new Mock <IInputCollector>();

            consoleCollector.SetupSequence(x => x.Collect())
            .Returns(Path.Combine(AppDomain.CurrentDomain.BaseDirectory, "In", "OriginalTestInput.txt"))
            .Returns(Path.Combine(AppDomain.CurrentDomain.BaseDirectory, "Input", "InvalidTestInput.txt"))
            .Returns(Path.Combine(AppDomain.CurrentDomain.BaseDirectory, "Input", "InvalidTalkDuration.txt"))
            .Returns(Path.Combine(AppDomain.CurrentDomain.BaseDirectory, "Input", "OriginalTestInput.txt"))
            .Returns("1");

            var conferenceTrackManager = new ConferenceTrackManager(consoleDisplay, consoleCollector.Object, new TextFileInputProvider(pathValidator), new TextFileInputProcessor(talkValidator), trackGenerator);

            //Act
            conferenceTrackManager.ManageTracks();

            //Assert
            var expectedMessages = new List <string>
            {
                Constants.Welcome,
                Constants.FilePathPrompt,
                $"Not a valid path or file: {Path.Combine(AppDomain.CurrentDomain.BaseDirectory, "In", "OriginalTestInput.txt")}. \nOnly .txt files are valid",
                Constants.FilePathPrompt,
                "Not a valid talk: A World Without HackerNews. \nMust contain duration in minutes or be a lightning talk.",
                Constants.FilePathPrompt,
                "Invalid talk duration: 445min.\nThe duration of talks must be shorter then the session duration",
                Constants.FilePathPrompt,
                Constants.DisplayTypePrompt,
                "Track 1",
                "09:00 AM  Writing Fast Tests Against Enterprise Rails 60min",
                "10:00 AM  Communicating Over Distance 60min",
                "11:00 AM  Rails Magic 60min",
                "12:00 PM  Lunch",
                "01:00 PM  Ruby Errors from Mismatched Gem Versions 45min",
                "01:45 PM  Common Ruby Errors 45min",
                "02:30 PM  Accounting-Driven Development 45min",
                "03:15 PM  Pair Programming vs Noise 45min",
                "04:00 PM  Clojure Ate Scala (on my project) 45min",
                "05:00 PM  Networking Event",
                "Track 2",
                "09:00 AM  Ruby on Rails: Why We Should Move On 60min",
                "10:00 AM  Ruby on Rails Legacy App Maintenance 60min",
                "11:00 AM  Overdoing it in Python 45min",
                "11:45 AM  Rails for Python Developers lightning",
                "12:00 PM  Lunch",
                "01:00 PM  Lua for the Masses 30min",
                "01:30 PM  Woah 30min",
                "02:00 PM  Sit Down and Write 30min",
                "02:30 PM  Programming in the Boondocks of Seattle 30min",
                "03:00 PM  Ruby vs. Clojure for Back-End Development 30min",
                "03:30 PM  A World Without HackerNews 30min",
                "04:00 PM  User Interface CSS in Rails Apps 30min",
                "05:00 PM  Networking Event"
            };

            for (var i = 0; i < consoleDisplay.Messages.Count; i++)
            {
                Assert.Equal(expectedMessages[i], consoleDisplay.Messages[i]);
            }
            //Assert.True(consoleDisplay.Messages.SequenceEqual(expectedMessages));
        }
 public TrackGeneratorTests()
 {
     _trackGenerator = new TrackGenerator(new Utils.Utils());
 }
示例#19
0
 private void OnEnable()
 {
     _t = target as TrackGenerator;
 }
示例#20
0
 // Use this for initialization
 void Start()
 {
     vc       = GetComponent <VehicleController>();
     track    = FindObjectOfType <TrackGenerator>();
     DoUpdate = AIUpdate;
 }
 private void OnEnable() => _holder = (TrackGenerator)target;
示例#22
0
 private void Start()
 {
     track          = GetComponent <BezierSpline>();
     trackGenerator = GetComponent <TrackGenerator>();
 }
示例#23
0
    private void Awake()
    {
        instance = this;
        //PlayerPrefs.DeleteAll();
        //PlayerPrefs.SetInt("tutorial", 1);
        //System.Random r = new System.Random();
        player           = GameObject.Find("Player");
        tracksRoot       = GameObject.Find("TracksRoot");
        trackObjectsRoot = GameObject.Find("TrackObjectsRoot");
        glodParents      = GameObject.Find("GlodsRoot");


        // Clonning Tutorial Track
        if (PlayerPrefs.GetInt("tutorial", 0) == 0)
        {
            tutorialTrackInstance = (GameObject)GameObject.Instantiate(tutorialTrack, new Vector3(0, 0, 0), new Quaternion(0, 0, 0, 0));
            tutorialTrackInstance.transform.parent   = tracksRoot.transform;
            tutorialTrackInstance.transform.position = rootPos;
            tutorialTrackInstance.gameObject.SetActive(false);

            disposeEditorTrackItems(tutorialTrackInstance);
        }

        // Colling Start Tracks
        foreach (GameObject track in startTracks)
        {
            GameObject cloneTrack = (GameObject)GameObject.Instantiate(track, new Vector3(0, 0, 0), new Quaternion(0, 0, 0, 0));
            cloneTrack.transform.parent   = tracksRoot.transform;
            cloneTrack.transform.position = rootPos;
            cloneTrack.gameObject.SetActive(false);

            disposeEditorTrackItems(cloneTrack);

            startTrackPool.Add(cloneTrack);
        }

        // Clonnig Regular Tracks
        foreach (GameObject track in tracks)
        {
            if (track != null)
            {
                GameObject cloneTrack = (GameObject)GameObject.Instantiate(track, new Vector3(0, 0, 0), new Quaternion(0, 0, 0, 0));
                cloneTrack.transform.parent   = tracksRoot.transform;
                cloneTrack.transform.position = rootPos;
                cloneTrack.gameObject.SetActive(false);

                disposeEditorTrackItems(cloneTrack);
                trackPool.Add(cloneTrack);
            }
        }

        //// Clonig Track Objects
        //foreach (GameObject trackObject in trackObjects)
        //{

        //    for (int i = 0; i < getMaxCountPerTrackObject(trackObject.GetComponent<TrackObject>()); i++)
        //    {
        //        GameObject cloneTrackObject = (GameObject)GameObject.Instantiate(trackObject, new Vector3(0, 0, 0), new Quaternion(0, 0, 0, 0));
        //        cloneTrackObject.transform.parent = trackObjectsRoot.transform;
        //        cloneTrackObject.transform.position = rootPos;
        //        cloneTrackObject.GetComponent<TrackObject>().placeHolder = false;
        //        cloneTrackObject.gameObject.SetActive(false);
        //        trackObjectPool.Add(cloneTrackObject);
        //    }

        //}

        //Reset();
    }
示例#24
0
	void Awake(){
		Instance = this;
	}
示例#25
0
 void Start()
 {
     _trackGenerator = gameObject.GetComponentInParent <TrackGenerator>();
     _trackLenght    = _trackGenerator.TrackLenght;
 }
示例#26
0
 public override Node GetTrack()
 {
     return(TrackGenerator.BuildTrackFromList(NoteList));
 }