Ejemplo n.º 1
0
    public bool addRecordedWaypoint(Vector3 position)
    {
        SimulationResources sr = FindObjectOfType <SimulationResources>();
        WaypointOld         wp = Instantiate(sr.waypoint_prefab, position, Quaternion.identity);

        wp.GetComponent <Renderer>().material = sr.waypointRecorded_material;
        recordedWaypoints.Add(wp);
        return(true);
    }
Ejemplo n.º 2
0
    // Use this for initialization
    void Start()
    {
        //busSpawnCountdown = busSpawnDelay;
        simResources = GetComponent <SimulationResources>();
        sceneManager = FindObjectOfType <SceneManager>();

        receiveData();
        initializeBusRoutes();
        initializeWaypoints();
        //initializeBuses();
    }
Ejemplo n.º 3
0
    IResources CreateResources()
    {
        IResources resources = null;

#if UNITY_EDITOR
        if (SimulationSetting.IsSimulationMode)
        {
            LogManager.Log("Use SimulationResources. Run In Editor");

            /* Create a PathInfoParser. */
            //IPathInfoParser pathInfoParser = new SimplePathInfoParser("@");
            IPathInfoParser pathInfoParser = new SimulationAutoMappingPathInfoParser();

            /* Create a BundleManager */
            IBundleManager manager = new SimulationBundleManager();

            /* Create a BundleResources */
            resources = new SimulationResources(pathInfoParser, manager);
        }
        else
#endif
        {
            /* Create a BundleManifestLoader. */
            IBundleManifestLoader manifestLoader = new BundleManifestLoader();


            /* Loads BundleManifest. */
            BundleManifest manifest;
            manifest = manifestLoader.Load(BundleUtil.GetStorableDirectory() + BundleSetting.ManifestFilename);

            //manifest.ActiveVariants = new string[] { "", "sd" };
            //manifest.ActiveVariants = new string[] { "", "hd" };

            /* Create a PathInfoParser. */
            //IPathInfoParser pathInfoParser = new SimplePathInfoParser("@");
            IPathInfoParser pathInfoParser = new AutoMappingPathInfoParser(manifest);

            /* Create a BundleLoaderBuilder */
            ILoaderBuilder builder;
            builder = new WWWComplexLoaderBuilder(new Uri(BundleUtil.GetStorableDirectory()), false);

            /* Create a BundleManager */
            IBundleManager manager = new BundleManager(manifest, builder);

            /* Create a BundleResources */
            resources = new BundleResources(pathInfoParser, manager);
        }
        return(resources);
    }
    // Use this for initialization
    void Start()
    {
        simulationStartTime = new DateTime(
            simulationYear, simulationMonth, simulationDay,
            simulationHour, simulationMinute, simulationSecond);
        executionStartTime = DateTime.Today;
        simulationTime     = simulationStartTime;
        executionTime      = executionStartTime;

        cameraFocus = FindObjectOfType <CameraFocus>();

        simData      = FindObjectOfType <SimulationData>();
        simResources = FindObjectOfType <SimulationResources>();

        recolorWaypoints();
    }
Ejemplo n.º 5
0
    IEnumerator Start()
    {
        downloading = false;

#if UNITY_EDITOR
        if (SimulationSetting.IsSimulationMode)
        {
            IPathInfoParser spathInfoParser = new SimulationAutoMappingPathInfoParser();

            IBundleManager smanager = new SimulationBundleManager();

            simulator = new SimulationResources(spathInfoParser, smanager);
        }
#endif

        yield return(Init());
    }
    public WaypointOld askNextWaypoint()
    {
        //TODO Mudar esta função para realmente contactar o webservice ou outro repositório de dados.
        if (recordedCoordinates.Count > 0)
        {
            Vector3 position = recordedCoordinates[0];
            usedCoordinates.Add(position);
            recordedCoordinates.RemoveAt(0);

            SimulationResources sr = FindObjectOfType <SimulationResources>();
            WaypointOld         wp = Instantiate(sr.waypoint_prefab, position, Quaternion.identity);
            wp.GetComponent <Renderer>().material = sr.waypointRecorded_material;
            wp.isRecordedWP = true;
            return(wp);
        }
        return(null);
    }