void Start() { cartController = cartObject.GetComponent <CartController>(); switchController = switchObject.GetComponent <SwitchController>(); leftPath.SetActive(switchState == SwitchMachineState.SwitchMachineLeft); rightPath.SetActive(switchState == SwitchMachineState.SwitchMachineRight); }
public TestRunner(SwitchController sc, NetworkAnalyzer av, Oscillograph osc) { this.av = av; this.osc = osc; this.sc = sc; }
void Awake() { if (instance == null) { instance = this; } else if (instance != this) { Destroy(gameObject); } }
private void performActionSwitch(GameObject switchObj) { SwitchController controller = switchObj.GetComponent <SwitchController>(); if (Input.GetKeyDown(KeyCode.K)) { GameController.usingGameAction = true; controller.ActionSwitch(); //Debug.Log("ACTION Switch"); } }
private void Start() { switchController = GetComponent <SwitchController>(); player = FindObjectOfType <PlayerController>(); if (player == null) { Debug.LogError("Can't find the player object"); } PlayerController.OnItemCarried += OnItemCarried; PlayerController.OnItemDropped += OnItemDropped; }
// Use this for initialization void Start() { //Transform content = transform.Find ("Scroll View").Find ("Viewport").Find ("Content"); this.switchReplay = transform.Find("Container").Find("SaveEnabled").Find("Switch").GetComponent<SwitchController>(); this.switchReplay.AddListener(OnSwitchChange); this.switchReplay.Value = Settings.Instance.AllowReplayBackup; this.emptyBackup = transform.Find("Container").Find("EmptyBackup").Find("Button").GetComponent<Button>(); this.emptyBackup.onClick.AddListener(delegate () { OnEmptyBackup(); }); }
//各スイッチにsequenceDataを振り分ける public void SetGhost(List <SequenceData> sequenceList) { for (int i = 0; i < sequenceList.Count(); i++) { if (i < m_SwitchList.Count()) { SwitchController sSwitchController = m_SwitchList[i].GetComponent <SwitchController>(); sSwitchController.m_itemList = sequenceList[i].itemList; Debug.Log("データをswitchに振り分けました"); } } }
private void TouchEndedHandler(TouchInfo touchInfo) { if (catchSwitchState == null) { return; } var delta = touchInfo.TouchPosition.x - previewPosition; ProcessingSwitch(delta); catchSwitchState = null; }
private void Start() { for (int i = 0; i < 3; i++) { for (int j = 0; j < 2; j++) { SwitchController controller = Instantiate(switchControllerPrefab) as SwitchController; switchController[i, j] = controller; } } SetLevel(); SetSwitchController(); }
private bool OpenSwitch(int id) { try { SwitchController.Open(id); SwitchController.Default.Initialize(); } catch (CustomException e) { return(false); } return(true); }
public MainPage() { this.settings = new Settings(); this.settings.SelectedPresetChanged += new SelectedPresetChangedHandler(settings_SelectedPresetChanged); this.controller = new SwitchController(this.settings); this.webServer = new WebServer(this.settings); this.DataContext = this.settings; this.InitializeComponent(); this.presetButtons = new ExclusiveToggleButtonSet( this.presetButton0, this.presetButton1, this.presetButton2, this.presetButton3, this.presetButton4, this.presetButton5, this.presetButton6, this.presetButton7, this.presetButton8, this.presetButton9, this.presetButton10, this.presetButton11, this.presetButton12, this.presetButton13, this.presetButton14, this.presetButton15 ); presetButtons.ItemSelected += new ItemSelectedHandler(preset_ItemSelected); new ExclusiveToggleButtonSet( this.previewButton0, this.previewButton1, this.previewButton2, this.previewButton3, this.previewButton4, this.previewButton5, this.previewButton6, this.previewButton7 ).ItemSelected += new ItemSelectedHandler(preview_ItemSelected); this.webServer.Start(); DispatcherTimer timer = new DispatcherTimer(); timer.Tick += Timer_Tick; timer.Interval = TimeSpan.FromSeconds(1); timer.Start(); }
public void OnToggleSwitch(SwitchController sw) { if (_door.IsOpen) { return; } if (_switches.Any(o => !o.Switched)) { return; } _door.Open(); _camera.Shake(); }
static void Main() { SwitchController controller = new SwitchController(new Tv(), new OnCommand()); controller.Action(); controller.Command = new OffCommand(); controller.Action(); controller.Device = new Fan(); controller.Command = new OnCommand(); controller.Action(); controller.Undo(); Console.ReadKey(); }
void Start() { switch01 = GameObject.Find("switch_1"); switch02 = GameObject.Find("switch_2"); switch03 = GameObject.Find("switch_3"); switchDoor = GameObject.Find("switch_door"); switch04 = GameObject.Find("switch_4"); water00 = GameObject.Find("water_00"); water01 = GameObject.Find("water_01"); water02 = GameObject.Find("water_02"); boat = GameObject.Find("boat"); player = GameObject.Find("player"); mainCamera = GameObject.Find("Main Camera"); offset = transform.position - mainCamera.transform.position; s1 = switch01.GetComponent <SwitchController>(); s2 = switch02.GetComponent <SwitchController>(); s3 = switch03.GetComponent <SwitchController>(); s4 = switch04.GetComponent <SwitchController>(); sd = switchDoor.GetComponent <SwitchController>(); w0 = water00.GetComponent <WaterController>(); w1 = water01.GetComponent <WaterController>(); w2 = water02.GetComponent <WaterController>(); bc = boat.GetComponent <BoatController>(); pc = player.GetComponent <PlyrMoveController>(); cc = mainCamera.GetComponent <CameraController>(); gameElements = GameObject.Find("GameElements"); menuposition = GameObject.Find("menuposition"); //clone.transform.position = cannon.transform.position; items = new List <GameObject>(); items.Add(createLife()); items.Add(createLife()); items.Add(createLife()); //MountMenu(); goToSavePoint(); }
public void ActivateSwitch(SwitchController s) { if (switches[index] == s.GetComponent <SwitchController>()) { index += 1; if (index == switches.Length - 1) { unlocker.Unlock(); unlocked = true; } } else { index = 0; } }
private void ProcessingSwitch(float delta) { if (Math.Abs(delta) < 0.1f) { catchSwitchState = null; return; } if (delta > 0) { catchSwitchState.SetNextState();; } else { catchSwitchState.SetPreviewState(); } }
private void TouchBeganHandler(TouchInfo touchInfo) { if (!TouchController.LockTouchObject.activeSelf) { return; } if (touchInfo.HitObject == null || touchInfo.HitObject.parent == null) { return; } catchSwitchState = touchInfo.HitObject.parent.GetComponent <SwitchController>(); if (catchSwitchState == null) { return; } previewPosition = touchInfo.TouchPosition.x; }
public void CheckAllSwitchesState() { bool oneSwitchOff = false; foreach (GameObject switchObj in switches) { SwitchController switchController = switchObj.GetComponent <SwitchController>(); if (!switchController.switchOn) { oneSwitchOff = true; break; } } if (!oneSwitchOff) { gameHud.finish = true; } }
private void Start() { _cCtrl = GetComponentInParent <ChassisController>(); _redSwitchCtrl = _redSwitch.GetComponent <SwitchController>(); isRecording = _redSwitchCtrl.isOn; }
void OnTriggerExit2D(Collider2D collider) { if (collider.gameObject.tag == "SavePoint") { saveActive = false; } if (collider.gameObject.tag == "Switch") { switchActive = false; currSwitch = null; } }
void OnTriggerEnter2D(Collider2D collider) { if (collider.gameObject.tag == "SavePoint") { saveActive = true; } if (collider.gameObject.tag == "Switch") { switchActive = true; currSwitch = collider.gameObject.GetComponent<SwitchController>(); } }
// Update is called once per frame void Update() { if (CollisionFlag == true) { Balloon.SetActive(true); if (Input.GetKeyDown(KeyCode.C)) { if (SwitchFlag == true) { SwitchController Switch = obj.gameObject.GetComponent <SwitchController> (); Switch.TurnSwitch(); } else if (RockFlag == true) { obj.gameObject.SetActive(false); } else if (Switch_GarekiFlag == true) { SwitchController Switch = obj.gameObject.GetComponent <SwitchController>(); Switch.TurnSwitch(); obj.SetActive(false); } else if (BridgeFlag == true) { BridgeController Bridge = obj.gameObject.GetComponent <BridgeController>(); Bridge.BridgeAction(); } else if (PCFlag == true) { if (PC.player == PlayerControler.playerType.Ed) { PC.player = PlayerControler.playerType.Dola; } else { PC.player = PlayerControler.playerType.Ed; } } else if (doorFlag == true) { doorController dc = obj.gameObject.GetComponent <doorController>(); dc.Moving(); } else if (waterFlag == true) { waterType++; waterType %= 4; switch (waterType) { case 0: water.Event = WaterController.eventType.BtoA; break; case 1: water.Event = WaterController.eventType.AtoB; break; case 2: water.Event = WaterController.eventType.BtoC; break; case 3: water.Event = WaterController.eventType.CtoB; break; } water.EventFlag = true; } else if (keyFlag == true) { if (KC.open == true) { KC.gateClose(); } else { KC.gateOpen(); } } } } else { Balloon.SetActive(false); } }
public void SetUp() { _switchResourceBuilder = new SwitchResourceBuilder() .WithDefaultGasDetailedEstimateItems() .WithDefaultElectricityDetailedEstimateItems() .WithLinks(CreateDefaultLinks()); _usageDataBuilder = new ResourceBuilder() .WithDataTemplate() .WithGroup("gasSimpleEstimate") .WithItem("simpleEstimate") .WithAcceptableValue("1", "Low (small flat) gas") .WithAcceptableValue("2", "Medium (house or large flat) gas") .WithAcceptableValue("3", "High (large house) gas") .WithGroup("gasDetailedEstimate") .WithItem("houseType") .WithAcceptableValue("Value 1", "Name 1") .WithItem("numberOfBedrooms") .WithAcceptableValue("Value 3", "Name 3") .WithItem("mainCookingSource") .WithAcceptableValue("Value 5", "Name 5") .WithItem("cookingFrequency") .WithAcceptableValue("Value 7", "Name 7") .WithItem("centralHeating") .WithAcceptableValue("Value 9", "Name 9") .WithItem("numberOfOccupants") .WithAcceptableValue("Value 11", "Name 11") .WithItem("insulation") .WithAcceptableValue("Value 13", "Name 13") .WithItem("energyUsage") .WithAcceptableValue("Value 15", "Name 15") .WithGroup("elecSimpleEstimate") .WithItem("simpleEstimate") .WithAcceptableValue("1", "Low (small flat) elec") .WithAcceptableValue("2", "Medium (house or large flat) elec") .WithAcceptableValue("3", "High (large house) elec") .WithGroup("elecDetailedEstimate") .WithItem("houseType") .WithAcceptableValue("Value 2", "Name 2") .WithItem("numberOfBedrooms") .WithAcceptableValue("Value 4", "Name 4") .WithItem("mainCookingSource") .WithAcceptableValue("Value 6", "Name 6") .WithItem("cookingFrequency") .WithAcceptableValue("Value 8", "Name 8") .WithItem("centralHeating") .WithAcceptableValue("Value 10", "Name 10") .WithItem("numberOfOccupants") .WithAcceptableValue("Value 12", "Name 12") .WithItem("insulation") .WithAcceptableValue("Value 14", "Name 14") .WithItem("energyUsage") .WithAcceptableValue("Value 16", "Name 16"); _apiClient = Substitute.For <IApiClient>(); StubSwitchResource(); var modelLoader = new ModelRepository(_apiClient, Substitute.For <IConfiguration>()); _sut = new SwitchController(modelLoader); }
public Macro(SwitchController controller) { m_controller = controller; }
// Start is called before the first frame update void Start() { switchController = Switch.GetComponent <SwitchController>(); playerController = GameObject.Find("Player").GetComponent <PlayerController>(); Smokes = GameObject.Find("Smokes"); }
void Start() { switchControllerScript = GameObject.FindGameObjectWithTag("SwitchController").GetComponent<SwitchController>(); buttonSwitchAudioSource = GameObject.FindGameObjectWithTag("SwitchAudio").GetComponent<AudioSource>(); }
// Start is called before the first frame update void Start() { switchController = GameObject.FindWithTag("Switch").GetComponent <SwitchController>(); switchController.switchPressed += TurnLight; }
public static SwitchController Fixture() { SwitchController controller = new SwitchController(new SwitchRepository(), "", new LoginView()); return(controller); }
void Start() { // Pega o Switch Controller switchControllerScript = GameObject.FindGameObjectWithTag("SwitchController").GetComponent<SwitchController>(); // Pega o objeto do player player = GameObject.FindGameObjectWithTag("Player"); // Pega o objeto do playerLaserControllerScript playerLaserContollerScript = player.GetComponent<PlayerLaserController>(); // Pega a força do tiro laserForce = playerLaserContollerScript.laserForce; // Pega o objeto do Renderer do player playerRenderer = player.GetComponent<Renderer>(); // Muda a cor do tiro se necessário CorDoTiro(); // Atira Atira(); }
public static SwitchController Fixture() { SwitchController controller = new SwitchController(new SwitchRepository(), "", new LoginView()); return controller; }
// Start is called before the first frame update void Start() { switchParent = transform.root.gameObject; switchController = switchParent.GetComponent <SwitchController>(); }