public void Targetted (UseData ud) { counter++; if (counter == countToTrigger) { Target (); } }
public Query(SceneControl bd_sceneControl, UseData bd_usedata, DataGridView bd_DataGridView) { this.mSceneControl = bd_sceneControl; this.mUseData = bd_usedata; this.mDataGridView = bd_DataGridView; mPoint3Ds = new Point3Ds(); }
/// <summary> /// PipeNetworkAnalysis构造函数 /// </summary> public PipeNetworkAnalysis(SceneControl sceneControl, UseData UseData, InformationBubble informationBubble) { mSceneControl = sceneControl; mUseData = UseData; mInformationBubble = informationBubble; Initialize(); }
void Use(UseData ud) { if (LevelManager.a.GetCurrentLevelSecurity() < minSecurityLevel) { if (!broken) { give = ud.owner.GetComponent <PlayerReferenceManager>().playerCapsule.GetComponent <PlayerHealth>().hm.health + amount; if (give > 255f) { give = 255f; } ud.owner.GetComponent <PlayerReferenceManager>().playerCapsule.GetComponent <PlayerHealth>().hm.health = give; Const.sprint("Automatic healing process activated.", ud.owner); if (healingFXFlash != null) { healingFXFlash.SetActive(true); } SFXSource.PlayOneShot(SFX); } else { Const.sprint("Healing bed is broken beyond repair", ud.owner); } } }
public void Use(UseData ud) { if (LevelManager.a.levelSecurity[LevelManager.a.currentLevel] > securityThreshhold) { Const.sprint(blockedBySecurityText, ud.owner); MFDManager.a.BlockedBySecurity(); return; } padInUse = true; SFXSource.PlayOneShot(SFX); dataTabResetter.Reset(); elevatorControl.SetActive(true); playerCapsule = ud.owner.GetComponent <PlayerReferenceManager>().playerCapsule; // Get player capsule of player using this pad playerCamera = ud.owner.GetComponent <PlayerReferenceManager>().playerCapsuleMainCamera; for (int i = defIndex; i < maxIndex; i++) { elevatorControl.GetComponent <ElevatorKeypad>().buttonsEnabled[i] = buttonsEnabled[i]; elevatorControl.GetComponent <ElevatorKeypad>().buttonsDarkened[i] = buttonsDarkened[i]; elevatorControl.GetComponent <ElevatorKeypad>().buttonText[i] = buttonText[i]; elevatorControl.GetComponent <ElevatorKeypad>().targetDestination[i] = targetDestination[i]; } elevatorControl.GetComponent <ElevatorKeypad>().currentFloor = currentFloor; elevatorControl.GetComponent <ElevatorKeypad>().activeKeypad = gameObject; if (playerCamera.GetComponent <MouseLookScript>().inventoryMode == false) { playerCamera.GetComponent <MouseLookScript>().ToggleInventoryMode(); } MFDManager.a.OpenTab(four, true, MFDManager.TabMSG.Elevator, defIndex, MFDManager.handedness.LeftHand); }
public PathAnalysis(Workspace workspace, SceneControl sceneControl, UseData usedata) { mWorkspace = workspace; mSceneControl = sceneControl; mSceneControl.Scene.Workspace = workspace; mUseData = usedata; Initialize(); }
void Targetted(UseData ud) { if (locked) { locked = false; } if (!targettingOnlyUnlocks) { Use(ud); } }
/// <summary> /// 构造净距分析函数 /// </summary> /// <param name="sceneControl"></param> /// <param name="formMain"></param> /// <param name="useData"></param> /// <param name="flag"></param> /// <param name="m_index"></param> public PureDistance(SceneControl sceneControl, FrmMain formMain, UseData useData, int flag, int m_index) { mSceneControl = sceneControl; mFormMain = formMain; mUseData = useData; mFlag = flag; mIndex = m_index; Initialize(); if (mSceneControl.Scene.Layers.Contains("[email protected]_UnderPipeLine")) { mSceneControl.Scene.Layers["[email protected]_UnderPipeLine"].IsVisible = false; } }
public void Targetted(UseData ud) { ista.enabled = false; // disable automatic texture changing if (ud.mainIndex != -1) { selectedDigit = ud.mainIndex; selectedTexture = newTextureRandom[selectedDigit]; } gameObject.GetComponent <MeshRenderer> ().material.mainTexture = selectedTexture; // set texture to new texture if (linkSelectedDigit) { if (target != null) { ud.mainIndex = selectedDigit; target.SendMessageUpwards("Targetted", ud); } } if (sendSelectedDigit) { switch (LevelManager.a.currentLevel) { case 1: Const.a.questData.lev1SecCode = selectedDigit; break; case 2: Const.a.questData.lev2SecCode = selectedDigit; break; case 3: Const.a.questData.lev3SecCode = selectedDigit; break; case 4: Const.a.questData.lev4SecCode = selectedDigit; break; case 5: Const.a.questData.lev5SecCode = selectedDigit; break; case 6: Const.a.questData.lev6SecCode = selectedDigit; break; } } }
public List <tbl_Branch> GetBranches(string companyCode) { List <tbl_Branch> branches; using (var useData = new UseData <tbl_Branch>(User, "")) { //useData.Db.Configuration.LazyLoadingEnabled = false; //branches = useData.List(b => b.CompanyCode == companyCode).ToList(); return(useData.Db.tbl_Branch.Where(b => b.CompanyCode == companyCode).ToList()); //useData.Db.Configuration.LazyLoadingEnabled = false; } //return branches; }
void Update () { for (int i = 0; i < target.Length; i++) { if (delayStarted [i]) { if (delayFinished[i] < Time.time) { UseData ud = new UseData(); ud.owner = Const.a.allPlayers; // TODO: should we have a different Const.a.nullPlayer? delayStarted [i] = false; // reset bit so we don't keep triggering every frame if (target[i] != null) { target[i].SendMessageUpwards ("Targetted", ud); // fire in the hole } } } } }
void Target() { if (!dontReset) counter = 0; UseData ud = new UseData(); ud.owner = Const.a.allPlayers; // TODO: should we have a different Const.a.nullPlayer? for (int i = 0; i < target.Length; i++) { if (delay [i] > 0) { delayStarted [i] = true; // tell Update() to check the timekeeper to see if we are past the delay delayFinished[i] = Time.time + delay [i]; // set delay timekeeper } else { if (target [i] != null) { target [i].SendMessageUpwards ("Targetted", ud); } } } }
public void Use(UseData ud) { if (LevelManager.a.GetCurrentLevelSecurity() <= minSecurityLevel) { if (!broken) { ud.owner.GetComponent <PlayerReferenceManager>().playerCapsule.GetComponent <PlayerHealth>().HealingBed(amount); Const.sprint("Automatic healing process activated.", ud.owner); SFXSource.PlayOneShot(SFX); } else { Const.sprint("Healing bed is broken beyond repair", ud.owner); } } }
public void Use(UseData ud) { if (dead) { Const.sprint("Can't use broken panel", ud.owner); return; } if (LevelManager.a.levelSecurity[LevelManager.a.currentLevel] > securityThreshhold) { MFDManager.a.BlockedBySecurity(); return; } Const.sprint("Puzzle interface accessed", ud.owner); //(bool[] states, CellType[] types, GridType gtype, int start, int end, GridColorTheme colors, UseData ud) MFDManager.a.SendGridPuzzleToDataTab(grid, cellType, gridType, sourceIndex, outputIndex, width, height, theme, target, target1, target2, target3, ud); }
public void UseTargets(UseData ud) { if (target != null) { target.SendMessageUpwards("Targetted", ud); } if (target1 != null) { target1.SendMessageUpwards("Targetted", ud); } if (target2 != null) { target2.SendMessageUpwards("Targetted", ud); } if (target3 != null) { target3.SendMessageUpwards("Targetted", ud); } }
public SQLQuery(Workspace workspace, SceneControl scenecontrol, UseData useData, DataGridView datagridview) { InitializeComponent(); mUseData = useData; mDataGridView = datagridview; mScenecontrol = scenecontrol; //layer3DsTree1.Scene = scenecontrol.Scene; mWorkspace = workspace; //layer3DsTree1.SimpleMode = true; //移除屏幕图层和地形图层节点 // layer3DsTree1.TerrainLayersNode.Remove(); // layer3DsTree1.ScreenLayer3DNode.Remove(); // layer3DsTree1.Icons = TreeIconTypes.None | TreeIconTypes.TypeIcon; // layer3DsTree1.MultiSelect = false; GetTreeNode(); Datasources m_datasources = mScenecontrol.Scene.Workspace.Datasources; mDataSourceName = m_datasources[0].Alias; }
// was GameObject owner as arguments, now UseData to hold more info void Use(UseData ud) { tex = Const.a.useableItemsFrobIcons[useableItemIndex]; if (tex != null) { ud.owner.GetComponent <PlayerReferenceManager>().playerCursor.GetComponent <MouseCursor>().cursorImage = tex; // set cursor to this object } mlook = ud.owner.GetComponent <PlayerReferenceManager>().playerCapsuleMainCamera.GetComponent <MouseLookScript>(); mlook.ForceInventoryMode(); // inventory mode is turned on when picking something up mlook.holdingObject = true; mlook.heldObjectIndex = useableItemIndex; mlook.heldObjectCustomIndex = customIndex; mlook.heldObjectAmmo = ammo; mlook.heldObjectAmmoIsSecondary = ammoIsSecondary; // should I assign mlook to null at this point so that I don't accidentally have a bug in multiplayer where the wrong player reference gets an object picked up // nah, I trust GetComponent to work for the owner who sent the Use command // well ok sure... mlook = null; this.gameObject.SetActive(false); //we've been picked up, quick hide like you are actually in the player's hand }
void Use(UseData ud) { if (LevelManager.a.levelSecurity[LevelManager.a.currentLevel] > securityThreshhold) { Const.sprint("Blocked by SHODAN level Security.", ud.owner); MFDManager.a.BlockedBySecurity(); return; } padInUse = true; SFXSource.PlayOneShot(SFX); dataTabResetter.Reset(); keypadControl.SetActive(true); keypadControl.GetComponent <KeypadKeycodeButtons>().keycode = keycode; keypadControl.GetComponent <KeypadKeycodeButtons>().keypad = this; playerCamera = ud.owner.GetComponent <PlayerReferenceManager>().playerCapsuleMainCamera; playerCapsule = ud.owner.GetComponent <PlayerReferenceManager>().playerCapsule; // Get player capsule of player using this pad playerCamera.GetComponent <MouseLookScript>().ForceInventoryMode(); MFDManager.a.OpenTab(4, true, MFDManager.TabMSG.Keypad, 0, MFDManager.handedness.LeftHand); }
public void Targetted(UseData ud) { if (useOnlyActivatesTrigger) { trigger.SetActive(true); useOnlyActivatesTrigger = false; return; } switch (currentState) { case FuncStates.Start: MoveTarget(); break; case FuncStates.Target: MoveStart(); break; case FuncStates.MovingStart: MoveTarget(); break; case FuncStates.MovingTarget: MoveStart(); break; case FuncStates.AjarMovingStart: MoveStart(); break; case FuncStates.AjarMovingTarget: MoveTarget(); break; } SFXSource.clip = SFXMoving; SFXSource.loop = true; SFXSource.Play(); stopSoundPlayed = false; movedToLocation = false; }
public void UseTargets() { UseData ud = new UseData(); ud.owner = player; if (target != null) { target.SendMessageUpwards("Targetted", ud); } if (target1 != null) { target1.SendMessageUpwards("Targetted", ud); } if (target2 != null) { target2.SendMessageUpwards("Targetted", ud); } if (target3 != null) { target3.SendMessageUpwards("Targetted", ud); } active = !active; alternateOn = active; if (changeMatOnActive) { if (blinkWhenActive) { ToggleMaterial(); if (active) { tickFinished = Time.time + tickTime; } } else { ToggleMaterial(); } } }
public TransactionResult Delete(tbl_Company company, List <tbl_Branch> branches) { using (var scope = new TransactionScope()) { try { TransactionResult result; using (var useData = new UseData <tbl_Branch>(User, "")) { foreach (var tblBranch in branches) { result = useData.Delete(tblBranch, useLog: false); if (result != TransactionResult.DeleteSuccess) { return(result); } } } using (var useData = new UseData <tbl_Company>(User, "")) { result = useData.Delete(company, useLog: false); if (result != TransactionResult.DeleteSuccess) { return(result); } } scope.Complete(); return(TransactionResult.DeleteSuccess); } catch (Exception) { return(TransactionResult.DeleteFailed); } finally { scope.Dispose(); } } }
void Use(UseData ud) { if (LevelManager.a.GetCurrentLevelSecurity() > minSecurityLevel) { MFDManager.a.BlockedBySecurity(); return; } if (nextthink < Time.time) { ud.owner.GetComponent <PlayerReferenceManager>().playerCapsule.GetComponent <PlayerEnergy>().GiveEnergy(amount, 1); Const.sprint("Energy drawn from Power Station.", ud.owner); if (requireReset) { nextthink = Time.time + resetTime; } } else { Const.sprint("Power Station is recharging\n", ud.owner); } }
// Use this to attach an item such as isotope-x22, isolinear chipset, interface demodulator, or a plastique public void Use(UseData ud) { if (ud.mainIndex != 56 || ud.mainIndex != 57 || ud.mainIndex != 61 || ud.mainIndex != 64) { return; } switch (ud.mainIndex) { case 56: // Z-44 Plastique Explosive activated = true; targettedObject.SendMessageUpwards("Use", ud); timerFinished = Time.time + timeTillPlastiqueExplode; break; case 57: // Interface Demodulator activated = true; targettedObject.SendMessageUpwards("Use", ud); simpleActivationIndicator.SetActive(true); break; case 61: // Isotope-X22 activated = true; targettedObject.SendMessageUpwards("Use", ud); simpleActivationIndicator.SetActive(true); break; case 64: // Isolinear Chipset activated = true; targettedObject.SendMessageUpwards("Use", ud); simpleActivationIndicator.SetActive(true); break; } }
public void UseTargets() { UseData ud = new UseData(); ud.owner = playerCamera; if (target != null) { target.SendMessageUpwards("Targetted", ud); } if (target1 != null) { target1.SendMessageUpwards("Targetted", ud); } if (target2 != null) { target2.SendMessageUpwards("Targetted", ud); } if (target3 != null) { target3.SendMessageUpwards("Targetted", ud); } }
public void UseTargets(GameObject activator) { UseData ud = new UseData(); ud.owner = activator; if (target != null) { target.SendMessageUpwards("Targetted", ud); } if (target1 != null) { target1.SendMessageUpwards("Targetted", ud); } if (target2 != null) { target2.SendMessageUpwards("Targetted", ud); } if (target3 != null) { target3.SendMessageUpwards("Targetted", ud); } }
public void Use(UseData ud) { if (LevelManager.a.levelSecurity[LevelManager.a.currentLevel] > securityThreshhold) { MFDManager.a.BlockedBySecurity(); return; } player = ud.owner; // set playerCamera to owner of the input (always should be the player camera) SFXSource.PlayOneShot(SFX); if (message != null && message != "") { Const.sprint(message, ud.owner); } if (delay > 0) { delayFinished = Time.time + delay; } else { UseTargets(); } }
public void SendPuzzleData(bool[] sentWiresOn, bool[] sentNodeRowsActive, int[] sentCurrentPositionsLeft, int[] sentCurrentPositionsRight, int[] sentTargetsLeft, int[] sentTargetsRight, UseData udSent) { wireIsActive = sentWiresOn; nodeRowIsActive = sentNodeRowsActive; wire1LHPosition = sentCurrentPositionsLeft[0]; wire2LHPosition = sentCurrentPositionsLeft[1]; wire3LHPosition = sentCurrentPositionsLeft[2]; wire4LHPosition = sentCurrentPositionsLeft[3]; wire5LHPosition = sentCurrentPositionsLeft[4]; wire6LHPosition = sentCurrentPositionsLeft[5]; wire7LHPosition = sentCurrentPositionsLeft[6]; wire1RHPosition = sentCurrentPositionsRight[0]; wire2RHPosition = sentCurrentPositionsRight[1]; wire3RHPosition = sentCurrentPositionsRight[2]; wire4RHPosition = sentCurrentPositionsRight[3]; wire5RHPosition = sentCurrentPositionsRight[4]; wire6RHPosition = sentCurrentPositionsRight[5]; wire7RHPosition = sentCurrentPositionsRight[6]; wire1LHTarget = sentTargetsLeft[0]; wire2LHTarget = sentTargetsLeft[1]; wire3LHTarget = sentTargetsLeft[2]; wire4LHTarget = sentTargetsLeft[3]; wire5LHTarget = sentTargetsLeft[4]; wire6LHTarget = sentTargetsLeft[5]; wire7LHTarget = sentTargetsLeft[6]; wire1RHTarget = sentTargetsRight[0]; wire2RHTarget = sentTargetsRight[1]; wire3RHTarget = sentTargetsRight[2]; wire4RHTarget = sentTargetsRight[3]; wire5RHTarget = sentTargetsRight[4]; wire6RHTarget = sentTargetsRight[5]; wire7RHTarget = sentTargetsRight[6]; udSender = udSent; CheckEnabledNodes(); ChangeAppearance(); }
public void SendGrid(bool[] states, CellType[] types, GridType gtype, int start, int end, int w, int h, GridColorTheme colors, GameObject senttarget, GameObject senttarget1, GameObject senttarget2, GameObject senttarget3, UseData ud) { grid = states; cellType = types; gridType = gtype; sourceIndex = start; outputIndex = end; width = w; height = h; theme = colors; targets[0] = senttarget; targets[1] = senttarget1; targets[2] = senttarget2; targets[3] = senttarget3; udSender = ud; EvaluatePuzzle(); if (udSender.mainIndex == 54) { PuzzleSolved(); } UpdateCellImages(); }
public TransactionResult Save(tbl_Company company, List <tbl_Branch> branches) { using (var scope = new TransactionScope()) { try { TransactionResult result; using (var useData = new UseData <tbl_Company>(User, "")) { result = useData.Save(company, true, useLog: false); if (result != TransactionResult.SaveSuccess) { return(result); } } using (var useData = new UseData <tbl_Branch>(User, "")) { result = useData.SaveList(b => b.CompanyCode == company.CompanyCode, branches, useLog: false); if (result != TransactionResult.SaveSuccess) { return(result); } } scope.Complete(); return(TransactionResult.SaveSuccess); } catch (Exception) { return(TransactionResult.SaveFailed); } finally { scope.Dispose(); } } }
// Check all active and existing scripts on this gameObject that can be used and use them // Called by MouseLookScript.cs from a Use() raycast public void Use(UseData ud) { // ButtonSwitch - used by static switches and button panels bs = GetComponent <ButtonSwitch>(); if (useButtonSwitch && bs != null) { bs.Use(ud); } cs = GetComponent <ChargeStation>(); if (useChargeStation && cs != null) { cs.Use(ud); } dr = GetComponent <Door>(); if (useDoor && dr != null) { dr.Use(ud); } hb = GetComponent <HealingBed>(); if (useHealingBed && hb != null) { hb.Use(ud); } ke = GetComponent <KeypadElevator>(); if (useKeypadElevator && ke != null) { ke.Use(ud); } kk = GetComponent <KeypadKeycode>(); if (useKeypadKeycode && kk != null) { kk.Use(ud); } pl = GetComponent <PaperLog>(); if (usePaperLog && pl != null) { pl.Use(ud); } pgp = GetComponent <PuzzleGridPuzzle>(); if (usePuzzleGridPuzzle && pgp != null) { pgp.Use(ud); } uou = GetComponent <UseableObjectUse>(); if (useUseableObjectUse && uou != null) { uou.Use(ud); } ua = GetComponent <UseableAttachment>(); if (useUseableAttachment && ua != null) { ua.Use(ud); } }