public AltoSystem() { _scheduler = new Scheduler(); _memBus = new MemoryBus(); _mem = new Memory.Memory(); _keyboard = new Keyboard(); _diskController = new DiskController(this); _displayController = new DisplayController(this); _mouseAndKeyset = new MouseAndKeyset(); _ethernetController = new EthernetController(this); _orbitController = new OrbitController(this); _audioDAC = new AudioDAC(this); _organKeyboard = new OrganKeyboard(this); _tridentController = new TridentController(this); _cpu = new AltoCPU(this); // Attach memory-mapped devices to the bus _memBus.AddDevice(_mem); _memBus.AddDevice(_keyboard); _memBus.AddDevice(_mouseAndKeyset); _memBus.AddDevice(_audioDAC); _memBus.AddDevice(_organKeyboard); Reset(); }
void Start() { Cursor.lockState = CursorLockMode.Locked; charContr = gameObject.GetComponent <CharacterControllerSub>(); orbitContr = gameObject.GetComponentInChildren <OrbitController>(); DOF = gameObject.GetComponentInChildren <DepthOfField>(); }
IEnumerator StartGame() { yield return(new WaitForSeconds(0.01f)); var orbitGameObject = Instantiate(orbit, Vector3.zero, Quaternion.identity); orbitGameObject.transform.localScale = new Vector3(Random.Range(4, 6), 0, Random.Range(4, 6)); orbitGameObject.transform.rotation = Quaternion.Euler(new Vector3(Random.Range(-30, 30), 0, Random.Range(-30, 30))); currentOrbit = orbitGameObject.GetComponent <OrbitController>(); currentOrbit.obstaclesCount = 3; currentOrbit.portalIntervals = new[] { (10f, 60f) };
// Use this for initialization void Start() { orbiters = new GameObject[numObjects]; for (int i = 0; i < orbiters.Length; i++) { GameObject orbiter = Instantiate(orbitObject); orbiter.AddComponent <OrbitController>(); OrbitController orbitController = orbiter.GetComponent <OrbitController>(); orbitController.origin = transform; orbitController.radius = 5; orbitController.orbitTime = orbitTime; orbitController.angle = i * 360.0f / orbiters.Length; orbiters[i] = orbiter; } }
// Use this for initialization void Start() { orbiters = new GameObject[length]; for (int i = 0; i < orbiters.Length; i++) { GameObject orbiter = Instantiate(orbitObject); orbiter.AddComponent <OrbitController>(); OrbitController orbitController = orbiter.GetComponent <OrbitController>(); orbitController.origin = transform; orbitController.radius = i + 1; orbitController.orbitTime = orbitTime; orbitController.angle = angle; orbitController.clockwise = clockwise; orbiters[i] = orbiter; } }
void SetNextOrbit(OrbitController nextOrbit, float startingAngle) { currentOrbit = nextOrbit; speed = currentOrbit.GetOrbitSpeed(spacecraftSpeed); StartCoroutine(AnimateCameraPos(camera.transform.localPosition, cameraPos, 70.0f, 60.0f, cameraInterpolationTime)); SpeedPS.gameObject.SetActive(false); ShipTrail.SetActive(false); speedMode = false; currentOrbit.RequestSpawnOfObstacles(startingAngle); x = currentOrbit.X; y = currentOrbit.Y; a = currentOrbit.A; b = currentOrbit.B; destroyedObstacles = 0; nextObstacleAngle = -1f; afterCircle = false; hasPortal = false; orbitAlpha = alpha; currentLevel++; }
public override void Start() { _camera = GetComponent <Camera>(); _orbitController = AddComponent <OrbitController>(); _fpController = AddComponent <FirstPersonController>(); _fpController.Enabled = false; int width = 180; int height = 200; _box = new Rectangle(Screen.VirtualWidth - width - 10, Screen.VirtualHeight - height - 10, width, height); _btn1 = new Rectangle(_box.X + 10, _box.Y + 30, _box.Width - 20, 30); _btn2 = new Rectangle(_box.X + 10, _btn1.Y + 40, _box.Width - 20, 30); _checkRect = new Rectangle(_box.X + 10, _btn2.Y + 40, _box.Width - 20, 30); _checkRect2 = new Rectangle(_box.X + 10, _checkRect.Y + 40, _box.Width - 20, 30); _resetPosition = true; _flyMode = false; _orbitController.MaxDistance = 200; }
void Start() { _orbitController = GetComponentInChildren <OrbitController>(); }
public void StartWithOrbit(OrbitController orbit) { SetNextOrbit(orbit, 0); }
public void UpdateSystem() { ClearSystem(); //Create Planet GameObjects foreach (OrbitLine orbit in starSystem.orbits) { GameObject newOrbitObject = Instantiate(orbitPrefab, transform.position, Quaternion.identity); newOrbitObject.transform.parent = gameObject.transform; newOrbitObject.name = orbit.name; OrbitController orbitControls = newOrbitObject.GetComponent <OrbitController>(); orbitControls.useWaypoints = orbit.useWaypoints; Slider slider = new Slider(); slider.name = orbit.name; slider.label = ""; slider.value = orbit.orbitDistance; slider.highValue = 1.0f; slider.showInputField = true; slider.RegisterCallback <ChangeEvent <float> >( e => { if (orbitControls != null) { orbitControls.UpdateOrbit(e.newValue); } } ); controls.Add(slider); newOrbitObject.DrawOrbitLine(orbit.orbitDistance, orbit.segments, orbit.thickness); foreach (Note note in orbit.notes) { GameObject noteObject = Instantiate(notePrefab, transform.position, Quaternion.identity); noteObject.transform.parent = newOrbitObject.transform; noteObject.name = note.note.ToString(); noteObject.transform.localPosition = new Vector3(0, 0, orbit.orbitDistance); //Create and extract a synth, checking so that only one synth exists when used by more than one note indicator if (note.synth != null && !synthObjects.ContainsKey(note.synth.name)) { GameObject g = Instantiate(note.synth, newOrbitObject.transform.position, Quaternion.identity, gameObject.transform); synthObjects.Add(note.synth.name, g); } //Assign the synth instantiated to the note trigger if (note.synth != null && synthObjects.ContainsKey(note.synth.name)) { SendNoteOnTrigger trigger = noteObject.GetComponentInChildren <SendNoteOnTrigger>(); if (trigger != null) { //Set up all the note data trigger.m_pentatonic = starSystem.pentatonic; trigger.octave = note.octave; trigger.velocity = note.velocity; trigger.length = note.length; trigger.pentatonicValue = note.pentatonicValue; trigger.m_root = note.note; //Find and attach the synth to the Note GameObject helm; synthObjects.TryGetValue(note.synth.name, out helm); if (helm != null) { //AudioHelm.HelmController helmController = helm.GetComponent<AudioHelm.HelmController>(); //if (helmController != null) // trigger.m_sequencer = helmController; } } } //Scale the note indicator Transform[] children = noteObject.GetComponentsInChildren <Transform>(); foreach (Transform g in children) { g.localScale = new Vector3(note.size, note.size, note.size); } noteObjects.Add(noteObject); orbitControls.notes.Add(noteObject); } foreach (Planet planet in orbit.planets) { GameObject planetObject = Instantiate(planetPrefab, transform.position, Quaternion.identity); planetObject.transform.parent = newOrbitObject.transform; planetObject.transform.localEulerAngles = Vector3.zero; planetObject.name = planet.name; planetObject.transform.localPosition = new Vector3(0, 0, orbit.orbitDistance); Transform[] children = planetObject.GetComponentsInChildren <Transform>(); foreach (Transform g in children) { g.localScale = new Vector3(planet.scale, planet.scale, planet.scale); } if (!orbitControls.useWaypoints) { RotateAroundOrigin rot = planetObject.AddComponent <RotateAroundOrigin>(); rot.target = newOrbitObject; rot.radius = orbit.orbitDistance; rot.speed = planet.speed; orbitControls.planetRotators.Add(rot); } else { MoveToWaypoints moveToWaypoints = planetObject.AddComponent <MoveToWaypoints>(); moveToWaypoints.wayPoints = orbitControls.notes.ToArray(); moveToWaypoints.speed = planet.speed; } planetObjects.Add(planetObject); orbitControls.planets.Add(planetObject); } //If you want to vary the starting angle, pass it in here. newOrbitObject.transform.localEulerAngles = Vector3.zero; orbitControls.UpdateWaypointPositions(); orbitObjects.Add(newOrbitObject); } }
// Start is called before the first frame update void Start() { orbitController = FindObjectOfType <OrbitController>(); //Debug.Log("this color:" + colorValue`); }