public BridgeController CreateBridgeController() { var sessionId = NextSessionId(); BridgeController ret = new BridgeController(sessionId, SessionLayer.CreateClient(), FrameLayer.CreateClient(), TransportLayer.CreateClient(sessionId)); return(ret); }
public void Open(string url, string protocol, IDictionary <string, string> headers) { try { _controller = new BridgeController(); _controller.Proxy = this; _controller.Open(url, protocol, headers); } catch (Exception ex) { OnError(ex.Message); } }
void Start() { animLaser = this.gameObject.GetComponent <Animator> (); FPC = GameObject.Find("FPSController").GetComponent <FirstPersonController>(); FPcam = GameObject.Find("FirstPersonCharacter").GetComponent <Camera> (); Lasercam = this.gameObject.GetComponentInChildren <Camera> (); TriHUD = GameObject.Find("TricorderHUD").GetComponent <TricorderHUD> (); ui = GameObject.Find("ObjectivesUI").GetComponent <ObjectivesUI> (); lppc = GameObject.Find("LaserPartsHunt").GetComponent <LaserPartsPickupController> (); bc = GameObject.Find("BridgeController").GetComponent <BridgeController> (); mcs = GameObject.Find("DontDestroyonLoad").GetComponent <MasterControlScript> (); pauseMenu = GameObject.Find("PauseMenu").GetComponent <PauseMenu> (); }
public void Open(string url, string protocol = null, string authToken = null) { try { _controller = new BridgeController(); _controller.Proxy = this; _controller.Proxy = this; _controller.Proxy = this; _controller.Open(url, protocol, authToken); } catch (Exception ex) { OnError(ex.Message); } }
public void Open(string url, string protocol, IDictionary <string, string> headers) { try { var ssl = SSLContext.GetInstance("TLS"); ssl.Init(null, null, null); _controller = new BridgeController(ssl); _controller.Proxy = this; _controller.Open(url, protocol, headers); } catch (Exception ex) { OnError(ex.Message); } }
public void Open(string url, string protocol = null) { try { _controller = new BridgeController(); _controller.Proxy = this; _controller.Proxy = this; _controller.Proxy = this; _controller.Open(url, protocol); } catch (Exception ex) { OnError(ex.Message); } }
public void Open(string url, string protocol, IDictionary <string, string> headers) { try { _controller = new BridgeController { Proxy = this }; if (_isAllTrusted) { _controller.SetIsAllTrusted(); } _controller.Open(url, protocol, headers); } catch (Exception ex) { OnError(ex); } }
private void Awake() { foreach (Transform ap in transform.Find("ap")) { apImages.Add(ap.GetComponent <Image>()); } arrow = transform.Find("image_clock-arrow").GetComponent <Image>(); for (int i = 0; i < apImages.Count; i++) { apImages[i].color = ServiceLocator.State.CurrentAP > (9 - i) ? Color.green : Color.red; } arrow.transform.rotation = Quaternion.Euler(0, 0, (ServiceLocator.State.MaxAP - ServiceLocator.State.CurrentAP) * -36); endDayButton = GetComponentInChildren <Button>(); endDayButton.OnClick(() => BridgeController.EndDay()); dateText = transform.Find("text_date").GetComponent <Text>(); year = Random.Range(2330, 7777); }
private void createBridge(BridgeElement bridge) { Vector2 position = bridge.position; GameObject obj = Instantiate(bridgePrefab, this.transform); BridgeController controller = obj.GetComponent <BridgeController>(); obj.gameObject.transform.position = new Vector3(-this.mapModel.Width / 2f + position.x + 0.5f, 0, -this.mapModel.Height / 2f + position.y + 0.5f); // initial status controller.setInitialStatus(bridge.Closed); // Length if (bridge.Length > 1) { obj.gameObject.transform.localScale = new Vector3(bridge.Length, bridge.Length, obj.gameObject.transform.localScale.z); Vector3 old_position = obj.gameObject.transform.position; obj.gameObject.transform.position = new Vector3(old_position.x + (bridge.VerticalOrientation?0f:bridge.Length / 2f - 0.5f), old_position.y, old_position.z - (!bridge.VerticalOrientation?0f:bridge.Length / 2f - 0.5f)); } // Orientation if (bridge.VerticalOrientation) { obj.gameObject.transform.rotation = Quaternion.Euler(0, 90, 0); } bridges.Add(controller); }
/// <summary> /// Creates a new instance of this class with the specific Javascript code and one <see cref="BridgeController" /> to /// target /// </summary> /// <param name="script">The Javascript code to be pushed</param> /// <param name="target">The <see cref="BridgeController" /> class to target</param> public FireJavascriptEventArgs(string script, BridgeController target) : base(script, target) { FireAway = true; }
void OnTriggerEnter2D(Collider2D other) { if (other.tag == "switch" && PC.player == PlayerControler.playerType.Ed) { CollisionFlag = true; SwitchFlag = true; obj = other.gameObject; } //Gareki if (other.tag == "switch_Gareki" && PC.player == PlayerControler.playerType.Dola) { CollisionFlag = true; Switch_GarekiFlag = true; obj = other.gameObject; } if (other.tag == "Bridge" && PC.player == PlayerControler.playerType.Dola) { BridgeController Bridge = other.gameObject.GetComponent <BridgeController>(); if (Bridge.BridgeActionFlag == false) { CollisionFlag = true; BridgeFlag = true; obj = other.gameObject; } } if (other.tag == "rock" && PC.player == PlayerControler.playerType.Dola) { CollisionFlag = true; RockFlag = true; obj = other.gameObject; } if (other.gameObject.name == "PlayerChange") { CollisionFlag = true; PCFlag = true; } if (other.gameObject.name == "Lift") { LiftController LC = other.GetComponent <LiftController>(); if (LC.lifttype == LiftController.LiftType.Pressure) { plessureFlag = true; Debug.Log("plessureON"); } } if (other.gameObject.name == "waterController" && PC.player == PlayerControler.playerType.Ed) { CollisionFlag = true; waterFlag = true; } if (other.gameObject.name == "key" && PC.player == PlayerControler.playerType.Ed) { CollisionFlag = true; KC = other.GetComponent <KeyContoller>(); keyFlag = true; } if (other.gameObject.tag == "door") { CollisionFlag = true; doorFlag = true; obj = other.gameObject; } }
public void addBridge(BridgeController action) { this.bridges.Add(action); }
// 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); } }
// Update is called once per frame void Update() { if(IsReadKey() && !copyGG.IsOnGUI(new Vector2(Input.mousePosition.x, Screen.height - Input.mousePosition.y))) { ray = Camera.main.ScreenPointToRay(Input.mousePosition); if(selectorMode == 0 || selectorMode == 1 || selectorMode == 2) { if (Physics.Raycast(ray, out hit, 100, 1 << 9)) { if (Input.GetMouseButtonDown(0)) {//press button on the gizmo axis if (hit.collider.tag == "gizmoCenter") { ((GameObject)gizmoObject).GetComponent<GizmoManipulatorCintroller>().PressMoveCenter(selectedVertices); isGizmoAction = true; } else if (hit.collider.tag == "gizmoX") { ((GameObject)gizmoObject).GetComponent<GizmoManipulatorCintroller>().PressMoveX(selectedVertices); isGizmoAction = true; } else if (hit.collider.tag == "gizmoY") { ((GameObject)gizmoObject).GetComponent<GizmoManipulatorCintroller>().PressMoveY(selectedVertices); isGizmoAction = true; } else if (hit.collider.tag == "gizmoZ") { ((GameObject)gizmoObject).GetComponent<GizmoManipulatorCintroller>().PressMoveZ(selectedVertices); isGizmoAction = true; } else if (hit.collider.tag == "gizmoRX") { ((GameObject)gizmoObject).GetComponent<GizmoManipulatorCintroller>().PressRotatorX(selectedVertices); isGizmoAction = true; } else if (hit.collider.tag == "gizmoRY") { ((GameObject)gizmoObject).GetComponent<GizmoManipulatorCintroller>().PressRotatorY(selectedVertices); isGizmoAction = true; } else if (hit.collider.tag == "gizmoRZ") { ((GameObject)gizmoObject).GetComponent<GizmoManipulatorCintroller>().PressRotatorZ(selectedVertices); isGizmoAction = true; } else if (hit.collider.tag == "rotatorCenter") { ((GameObject)gizmoObject).GetComponent<GizmoManipulatorCintroller>().PressRotatorCenter(selectedVertices); isGizmoAction = true; } if(isGizmoAction) { //remove bridges from active vertices copyVS.ResetBridgesFromMovedVertices(selectedVertices); } } copyVS.NeutralizeSelectVertices(); } else if (Physics.Raycast(ray, out hit, 100, 1 << 8)) { if (hit.collider.tag == "vertex" && !isGizmoAction) { int vertexIndex = copyVS.GetVertexIndex(hit.transform.gameObject); if (Input.GetMouseButton(0)) { copyVS.ClickOnVertex(vertexIndex); } else if (Input.GetMouseButtonUp(0)) { if (Input.GetKey(KeyCode.LeftControl) || Input.GetKey(KeyCode.RightControl)) {//deselect DeselectVertex(vertexIndex); } else { if (Input.GetKey(KeyCode.LeftShift) || Input.GetKey(KeyCode.RightShift)) {//add to selection SelectVertex(vertexIndex, true); } else { //make vertex selected SelectVertex(vertexIndex, false); } } } else { copyVS.SetMouseOverVertex(vertexIndex); } } } else { if (selectorMode == 0 && Input.GetMouseButtonDown(0)) { //deselect all vertices DeselectAll(); } copyVS.NeutralizeSelectVertices(); } } else if(selectorMode == 3) {//bridge tool if (Physics.Raycast(ray, out hit, 100, 1 << 10)) { if (hit.collider.tag == "Triod01" || hit.collider.tag == "Triod02" || hit.collider.tag == "Triod03" || hit.collider.tag == "Triod04") { if(Input.GetMouseButtonDown(0)) { if(Input.GetKey(KeyCode.LeftControl) || Input.GetKey(KeyCode.RightControl)) { //unselect triod copyVS.UnClickTriod(copyVS.GetVertexIndex(hit.transform.parent.gameObject), hit.collider.tag); } else { copyVS.ClickTriod(copyVS.GetVertexIndex(hit.transform.parent.gameObject), hit.collider.tag); } } else { ((GameObject)hit.transform.parent.gameObject).GetComponent<VertexController>().SetTriodOverMouse(hit.collider.tag); } } else { } } else if (Physics.Raycast(ray, out hit, 100, 1 << 11)) { if (hit.collider.tag == "bridge") { if(Input.GetMouseButtonDown(1)) {//right click on the bridge //rotate the gluing ((GameObject)hit.transform.gameObject).GetComponent<BridgeController>().ChangeGluing(); } if(Input.GetMouseButtonDown(2)) { //save click position clickPosition = Input.mousePosition; bridgeObj = ((GameObject)hit.transform.gameObject); copyBC = bridgeObj.GetComponent<BridgeController>(); copyBC.FixTangentValue(); isBridgeActive = true; } if(Input.GetMouseButtonDown(0)) {//save click position for calculating bridge middle point clickPosition = Input.mousePosition; bridgeObj = ((GameObject)hit.transform.gameObject); copyBC = bridgeObj.GetComponent<BridgeController>(); copyBC.FixMiddlePoint(); isBridgeActive = true; } } copyVS.NeutralizeAllTriods(); } else { copyVS.NeutralizeAllTriods(); } } } if(isBridgeActive && Input.GetMouseButton(2)) { //bridgeObj.GetComponent<BridgeController>().SetTangentLength(clickPosition, Input.mousePosition); copyBC.SetTangentLength(clickPosition, Input.mousePosition); } if (isBridgeActive && Input.GetMouseButton(0)) {//change the position of the bridge middle point copyBC.SetMiddlePoint(clickPosition, Input.mousePosition); } if(Input.GetMouseButtonUp(0)) { if(isGizmoExist) { ((GameObject)gizmoObject).GetComponent<GizmoManipulatorCintroller>().ReleaseButton(copyVS.GetAllVertices()); if(isGizmoAction) { copyVS.RebuildHidenBridges(); } isGizmoAction = false; } } if ((Input.GetMouseButtonUp(2) || Input.GetMouseButtonUp(0)) && copyBC != null && selectorMode == 3) { isBridgeActive = false; copyBC.ReBuildBridge(); } copyGG.SaySelectorMode(selectorMode); }
private void UpdateJournal() { journalText.text = BridgeController.GetJournalTextForDay(currentJournalDay); }
public BridgeController CreateBridgeController(IApplicationClient client) { BridgeController ret = new BridgeController(client.SessionId, client.SessionClient, client.FrameClient, client.TransportClient); return(ret); }
private void OnGUI() { GUILayout.BeginArea(new Rect(Screen.width / 2 - width / 2, Screen.height / 2 - Screen.height / 2, width, Screen.height)); scrollPosition = GUILayout.BeginScrollView(scrollPosition, GUILayout.Width(width), GUILayout.Height(Screen.height - 35)); GUILayout.BeginHorizontal(); if (!inFlightMode && QuestController.GetCurrentQuest() == null) { if (GUILayout.Button(selectedPage == SimpleViewPage.Bridge ? "<b>❖ Bridge</b>" : "Bridge")) { selectedPage = SimpleViewPage.Bridge; } if (GUILayout.Button(selectedPage == SimpleViewPage.Workshop ? "<b>❖ Workshop</b>" : "Workshop")) { selectedPage = SimpleViewPage.Workshop; } if (GUILayout.Button(selectedPage == SimpleViewPage.Map ? "<b>❖ Map</b>" : "Map")) { selectedPage = SimpleViewPage.Map; } if (GUILayout.Button(selectedPage == SimpleViewPage.Horizon ? "<b>❖ Horizon</b>" : "Horizon")) { selectedPage = SimpleViewPage.Horizon; } } GUILayout.EndHorizontal(); GUILayout.Box(string.Format("Day: {0}/{1} {2} AP: {3}/{4}", State.CurrentDay, State.TotalDays, QuestController.GetCurrentQuest() != null ? string.Format("● In quest mode. Quest name: {0}. Quest progress: {1} ●", QuestController.GetCurrentQuest().ID, QuestController.GetCurrentQuest().CurrentBlock) : inFlightMode ? string.Format("● In flight mode. Minerals: A{0} B{1} C{2}. Loot charges: {3}/{4} ●", State.MineralA, State.MineralB, State.MineralC, lootCharges, State.LootCharges) : "●", State.CurrentAP, State.MaxAP)); if (State.GameStatus == GameStatus.InProgress) { if (inFlightMode) { for (int i = 0; i < sectorLoot.Count; i++) { if (GUILayout.Button(string.Format("Loot spot of {0}", sectorLoot[i].LootType))) { FlightController.RecieveLoot(sectorLoot[i]); sectorLoot.Remove(sectorLoot[i]); lootCharges--; if (lootCharges <= 0) { inFlightMode = false; } } } if (GUILayout.Button("Recall dron")) { inFlightMode = false; } } else if (QuestController.GetCurrentQuest() != null) { GUILayout.Label(XDocument.Parse(Text.Get(QuestController.GetCurrentQuest().CurrentBlock)).Root.Value, GUILayout.Width(width - 10)); var choises = XDocument.Parse(Text.Get(QuestController.GetCurrentQuest().CurrentBlock)).Root.Elements("choise"); if (choises.Count() == 0) { if (GUILayout.Button("End quest")) { QuestController.EndQuest(); } } else { foreach (var choise in choises) { if (GUILayout.Button(choise.Value, GUILayout.Width(width - 10))) { QuestController.MakeChoise(choise.Value); } } } } else { if (selectedPage == SimpleViewPage.Bridge) { for (int i = 1; i <= State.CurrentDay; i++) { foreach (var record in State.JournalRecords.Where(r => r.AssignedDay == i)) { GUILayout.Label(Text.Get(record.ID)); } } if (GUILayout.Button(string.Format("End day [AP = {0}]", State.MaxAP))) { BridgeController.EndDay(); } } if (selectedPage == SimpleViewPage.Workshop) { GUILayout.BeginHorizontal(); GUILayout.Label(string.Format("Fuel tank: <b>{0}</b>", State.FuelSynthed ? "FULL" : "EMPTY")); GUILayout.Label(string.Format("Breakage: <b>{0}</b>", State.EngineFixed ? "FIXED" : State.BreakageType.ToString())); GUILayout.EndHorizontal(); GUILayout.BeginHorizontal(); GUILayout.Label(string.Format("Resources: W{0} A{1} C{2}", State.Wiring, State.Alloy, State.Chips), GUILayout.Width(width / 2)); GUILayout.Label(string.Format("Fix engine requirments: W{0} A{1} C{2}", State.FixEngineRequirements[State.BreakageType][0], State.FixEngineRequirements[State.BreakageType][1], State.FixEngineRequirements[State.BreakageType][2])); GUILayout.EndHorizontal(); GUILayout.BeginHorizontal(); GUILayout.Label(string.Format("Minerals: A{0} B{1} C{2}", State.MineralA, State.MineralB, State.MineralC), GUILayout.Width(width / 2)); showSynthFormula = GUILayout.Toggle(showSynthFormula, "show sync formula"); if (showSynthFormula) { GUILayout.Label(string.Format("A{0} B{1} C{2}", State.FuelSynthFormula[0], State.FuelSynthFormula[1], State.FuelSynthFormula[2])); } GUILayout.EndHorizontal(); GUILayout.BeginHorizontal(); GUILayout.BeginVertical(GUILayout.Width(width / 2)); GUILayout.Label(string.Format("Analyzed artifacts ({0}):", State.Artifacts.FindAll(x => x.Status == ArtifactStatus.Analyzed).Count)); showArtifacts = GUILayout.Toggle(showArtifacts, "show all analyzed artifacts"); if (showArtifacts) { foreach (var artifact in State.Artifacts.FindAll(x => x.Status == ArtifactStatus.Analyzed)) { GUILayout.Label(string.Format("[{0}] {1} ScanInfo: {2}", artifact.ID, artifact.Name, artifact.ScanInfo)); } } GUILayout.EndVertical(); GUILayout.BeginVertical(GUILayout.Width(width / 2 - 30)); GUILayout.Label(string.Format("Fuel synth probes ({0}):", State.FuelSynthProbes.Count)); showProbes = GUILayout.Toggle(showProbes, "show all the probes"); if (showProbes) { foreach (var probe in State.FuelSynthProbes) { GUILayout.BeginHorizontal(); GUILayout.Label(string.Format("Probe №{0} [A: {1}, B: {2}, C: {3}] is {4}.", State.FuelSynthProbes.FindIndex(x => x == probe), probe[0], probe[1], probe[2], WorkshopController.MeasureProbe(probe))); GUILayout.EndHorizontal(); } } GUILayout.EndVertical(); GUILayout.EndHorizontal(); if (WorkshopController.CanFixEngine() && GUILayout.Button(string.Format("Fix engine [-{0}AP]", State.FixEngineAPCost))) { WorkshopController.FixEngine(); } if (!State.FuelSynthed) { GUILayout.BeginHorizontal(); if (GUILayout.Button(string.Format("Synth fuel [-{0}AP] (A + B + C must be {1})", State.FuelSynthAPCost, State.FuelSynthSumm))) { WorkshopController.SynthFuel(synthProbe); synthProbe = new int[3]; } synthProbe[0] = int.Parse(GUILayout.TextField(synthProbe[0].ToString())); synthProbe[1] = int.Parse(GUILayout.TextField(synthProbe[1].ToString())); synthProbe[2] = int.Parse(GUILayout.TextField(synthProbe[2].ToString())); GUILayout.EndHorizontal(); } foreach (var artifact in State.Artifacts.FindAll(x => x.Status == ArtifactStatus.Found)) { if (GUILayout.Button(string.Format("Start analyzing {0} [-{1}AP]", artifact.ID, State.AnalyzeArtifactAPCost))) { WorkshopController.AnalyzeArtifact(artifact); } } } if (selectedPage == SimpleViewPage.Map) { loadSectors = GUILayout.Toggle(loadSectors, " Load sector scenes"); if (GUILayout.Button(string.Format("Enter 1st sector [-{0}AP]", State.EnterSectorAPCost))) { InitFlightMode(1); } if (GUILayout.Button(string.Format("Enter 2nt sector [-{0}AP]", State.EnterSectorAPCost))) { InitFlightMode(2); } if (GUILayout.Button(string.Format("Enter 3rd sector [-{0}AP]", State.EnterSectorAPCost))) { InitFlightMode(3); } if (GUILayout.Button(string.Format("Enter 4th sector [-{0}AP]", State.EnterSectorAPCost))) { InitFlightMode(4); } } if (selectedPage == SimpleViewPage.Horizon) { foreach (var phrase in HorizonController.GetPhrases()) { string phraseText = string.Format("[{0}] {1}", phrase.ID, Text.Get(phrase.ID)); if (phrase.AssociatedQuest != string.Empty) { if (GUILayout.Button(phraseText)) { phrase.StartAssociatedQuest(); } } else { GUILayout.Label(string.Format("[{0}] {1}", phrase.ID, Text.Get(phrase.ID))); } } } } } else { GUILayout.Box(State.GameStatus.ToString()); } GUILayout.EndScrollView(); GUILayout.BeginHorizontal(); if (GUILayout.Button("Return to menu", GUILayout.Height(30))) { SwitchView(ViewType.MainMenu); } if (GUILayout.Button("Reset and start new game", GUILayout.Height(30))) { State.Reset(); State.GameStatus = GameStatus.InProgress; } GUILayout.EndHorizontal(); GUILayout.EndArea(); }
BridgeController() { Instance = this; }
void Start() { bc = pont.GetComponent <BridgeController>(); sr = GetComponent <SpriteRenderer>(); }