当前位置: 首页>>代码示例>>C#>>正文


C# Vector3.Plus方法代码示例

本文整理汇总了C#中Vector3.Plus方法的典型用法代码示例。如果您正苦于以下问题:C# Vector3.Plus方法的具体用法?C# Vector3.Plus怎么用?C# Vector3.Plus使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Vector3的用法示例。


在下文中一共展示了Vector3.Plus方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: mod_Start

		private void mod_Start() {

            //NEW CODE HERE
			var exampleCheckbox =
				this.ComponentsInDescendants<UIOptionsTag>(true).Single(
					opt => opt.Checkbox && opt.BoolSuboption == GameOption.BoolOption.SCREEN_EDGE_SCROLLING)
					.transform;

			Prefabs.QuickCheckbox = exampleCheckbox.Component<UIOptionsTag>();
			Prefabs.QuickDropdown = ResolutionDropdown.transform.parent.gameObject;
			Prefabs.QuickButton = UIOptionsManager.Instance.PageButtonPrefab.gameObject;
			Prefabs.QuickPage = Pages[5];

			var pageParent = Pages[5].transform.parent;

			var ieModOptions = new QuickPage(pageParent, "IEModOptions_Settings_Page");
			var ieModDisposition = new QuickPage(pageParent, "IEModOptions_Disposition_Page");
			Pages = Pages.Concat(new[] {
				ieModOptions.GameObject,
				ieModDisposition.GameObject
			}).ToArray();

			//ORIGINAL CODE
			this.SetMenuLayout(OptionsMenuLayout.InGame);
			this.QuitButton.onClick = (UIEventListener.VoidDelegate) Delegate.Combine(this.QuitButton.onClick, new UIEventListener.VoidDelegate(this.OnQuitClicked));
			this.SaveButton.onClick = (UIEventListener.VoidDelegate) Delegate.Combine(this.SaveButton.onClick, new UIEventListener.VoidDelegate(this.OnSaveClicked));
			this.LoadButton.onClick = (UIEventListener.VoidDelegate) Delegate.Combine(this.LoadButton.onClick, new UIEventListener.VoidDelegate(this.OnLoadClicked));
        
			this.m_Options = this.ComponentsInDescendants<UIOptionsTag>(true);

            //NEW CODE
			var quickFactory = new QuickFactory() {
				CurrentParent = Pages[7].transform
			};

			//File.WriteAllText("ComboboxDump.txt", UnityObjectDumper.PrintUnityGameObject(exampleDropdown.gameObject, null, x => false));
			quickFactory.CurrentParent = Pages[7].transform;

			var column1Top = new Vector3(-210, 330, 0);

			//The following are the controls that appear in the GUI of the mod.
			_oneTooltip = quickFactory.Checkbox(() => IEModOptions.OneTooltip);
			_oneTooltip.Transform.localPosition = column1Top;

			_disableEngagement = quickFactory.Checkbox(() => IEModOptions.DisableEngagement);
			_disableEngagement.LocalPosition = column1Top.Plus(y:-30);

			_blueCircles = quickFactory.Checkbox(() => IEModOptions.BlueCircles);
			_blueCircles.Transform.localPosition = column1Top.Plus(y:-60);

			_blueCirclesBg = quickFactory.Checkbox(() => IEModOptions.BlueCirclesBG);
			_blueCirclesBg.Transform.localPosition = column1Top.Plus(x:+30, y:-90);

			_blueCircles.IsChecked.HasChanged += x => {
				if (x.Value) {
					_blueCirclesBg.OptionsTagComponent.Enable();
				} else {
					_blueCirclesBg.IsChecked.Value = false;
					_blueCirclesBg.OptionsTagComponent.Disable();
				}
			};
			_blueCircles.IsChecked.NotifyChange();

			_alwaysShowCircles = quickFactory.Checkbox(() => IEModOptions.AlwaysShowCircles);
			_alwaysShowCircles.Transform.localPosition = column1Top.Plus(y:-120);

			_unlockCombatInv = quickFactory.Checkbox(() => IEModOptions.UnlockCombatInv);
			_unlockCombatInv.Transform.localPosition = column1Top.Plus(y:-150);

			_npcDispositionFix = quickFactory.Checkbox(() => IEModOptions.NPCDispositionFix);
			_npcDispositionFix.Transform.localPosition = column1Top.Plus(y:-180);

			_removeMovingRecovery = quickFactory.Checkbox(() => IEModOptions.RemoveMovingRecovery);
			_removeMovingRecovery.Transform.localPosition = column1Top.Plus(y:-210);

			//_fastSneak = quickFactory.Checkbox(() => IEModOptions.FastSneak);
			//_fastSneak.Transform.localPosition = column1Top.Plus(y:-240);

            /* * * TJH 8/28/2015. Improved AI Excluded from v2.0 
			_improvedAi = quickFactory.Checkbox(() => IEModOptions.ImprovedAI);
			_improvedAi.Transform.localPosition = column1Top.Plus(y: -270);
            * * */

            
			_disableFriendlyFire = quickFactory.Checkbox(() => IEModOptions.DisableFriendlyFire);
			/* * * TJH 8/28/2015. Moved up since Improved AI and Fast Sneak are no longer present here * * */
			_disableFriendlyFire.Transform.localPosition = column1Top.Plus(y: -240);

           

            var column2Top = column1Top.Plus(x: +420);

			_lootShuffler = quickFactory.Checkbox(() => IEModOptions.LootShuffler);
			_lootShuffler.Transform.localPosition = column2Top;

			_gameSpeed = quickFactory.Checkbox(() => IEModOptions.GameSpeedMod);
			_gameSpeed.Transform.localPosition = column2Top.Plus(y:-30);

			_combatOnly = quickFactory.Checkbox(() => IEModOptions.CombatOnlyMod);
			_combatOnly.Transform.localPosition = column2Top.Plus(y:-60);
//.........这里部分代码省略.........
开发者ID:tjayharvey,项目名称:IEMod.pw,代码行数:101,代码来源:mod_UIOptionsManager.cs

示例2: CreateInterface

		private static void CreateInterface() {
		
			var quickFactory = new QuickFactory(UIPartyPortraitBar.Instance.transform.parent);
			Action<QuickButton, GameObject> addDragObject = (o, target) => {
				var collider = o.Collider;
				collider.AddComponent<UIDragObject>().target = target.transform;
			};

			var initialPos = new Vector3(905, 487, -6);
			DragPartyBar = quickFactory.Button("Drag Party Bar", localPos: initialPos);

			addDragObject(DragPartyBar, UIPartyPortraitBar.Instance.gameObject);
			addDragObject(DragPartyBar, PartySolidHud);

			var choices =
				Directory.GetFiles(@"PillarsOfEternity_Data\Managed\iemod\frames",
					string.Format("*{0}x{1}.png", Screen.width, Screen.height)).Select(
						path => new DropdownChoice<string>(GetFrameNameFromPath(path), path)).ToList();

			choices.Insert(0, new DropdownChoice<string>("(none)",""));

			var controlFactory = quickFactory;
			var layer = 14;
			FrameDropdown =  new QuickDropdown<string>(quickFactory.CurrentParent) {
				Layer = layer,
				LocalPosition = new Vector3(392.6f, 622.7f, -6.0f),
				LabelText = "Custom Frame:",
				LabelWidth = 150,
				Width = 300,
				Options = choices
			};
			FrameDropdown.SelectedValue.Bind(SelectedFrame);

			BlockClicking.Apply(FrameDropdown);

			DragHugBgr = controlFactory.Button("Drag Hud Bgr", localPos: initialPos.Plus(y: 50f));
			DragHugBgr.LocalPosition = initialPos.Plus(y: 50f);
			
			DragHugBgr.Layer = layer;
			addDragObject(DragHugBgr, ActionBarTrimB);

			DragLog = controlFactory.Button("Drag Log", localPos: initialPos.Plus(y: 100f));
			DragLog.Layer = layer;
			addDragObject(DragLog, ConsoleWindow);

			DragAbilitiesBar = controlFactory.Button("Drag Abilities", localPos: initialPos.Plus(y: -50f));
			DragAbilitiesBar.Layer = layer;
			addDragObject(DragAbilitiesBar, AbilitiesBar);

			ToggleLogButtons = controlFactory.Button("T. Log Buttons Side", localPos: initialPos.Plus(x:400f, y:-50f));
			ToggleLogButtons.Layer = layer;
			ToggleLogButtons.Click +=
				x => SetLogButtonsAlignment(RadioGroup.Component<UIAnchor>().side != UIAnchor.Side.TopLeft);

			ToggleHudOrientation = controlFactory.Button("T. Hud Horiz/Vert", localPos: initialPos.Plus(400f));
			ToggleHudOrientation.Layer = layer;
			ToggleHudOrientation.Click +=
				x => SetHudOrientation(ButtonsLeft.Component<UIGrid>().arrangement == UIGrid.Arrangement.Vertical);

			DragHudPanelLeft = controlFactory.Button("Drag Hud Panel 1", localPos: initialPos.Plus(y: -150f));
			DragHudPanelLeft.Layer = layer;
			addDragObject(DragHudPanelLeft, ButtonsLeft);

			DragHudPanelRight = controlFactory.Button("Drag Hud Panel 2", localPos: initialPos.Plus(y: -200f));
			DragHudPanelRight.Layer = layer;
			addDragObject(DragHudPanelRight, ButtonsRight);

			DragClock = controlFactory.Button("Drag Clock", localPos: initialPos.Plus(y: -100f));
			DragClock.Layer = layer;
			addDragObject(DragClock, TimeWidget);

			ToggleHudBgr = controlFactory.Button("T. Hud Background", localPos: initialPos.Plus(400f, 50f));
			ToggleHudBgr.Layer = layer;
			ToggleHudBgr.Click += x => ActionBarTrimB.SetActive(!ActionBarTrimB.gameObject.activeSelf);

			TooltipOffsetCheckbox = new QuickCheckbox("TooltipOffsetChbox", controlFactory.CurrentParent) {
				Label = "Tooltip Offset",
				Layer = layer,
				LocalPosition = FrameDropdown.LocalPosition.Plus(x:-110, y:-50)
			};
			
			//UnityPrinter.HierarchyPrinter.Print(TooltipOffsetCheckbox.GameObject);
			TooltipOffsetCheckbox.IsChecked.Bind(TooltipOffset);

			TogglePartyOrientation = controlFactory.Button("T. Party Horiz/Vert", localPos: initialPos.Plus(400f, 100f));
			TogglePartyOrientation.Layer = layer;
			TogglePartyOrientation.Click += _ => mod_UIPartyPortrait.IsVertical = !mod_UIPartyPortrait.IsVertical;

			ToggleBuffsSide = controlFactory.Button("Toggle Buffs Side", localPos: initialPos.Plus(400f, 150f));
			ToggleBuffsSide.Layer = layer;
			ToggleBuffsSide.Click += x => SetBuffSide();

			DragFormationBar = controlFactory.Button("Drag Formation Bar", localPos: initialPos.Plus(y: -250f));
			DragFormationBar.Layer = layer;
			addDragObject(DragFormationBar, FormationButtonSet);

			ToggleButtonsBgr = controlFactory.Button("T. Buttons Background", localPos: initialPos.Plus(400f, -100f));
			ToggleButtonsBgr.Click += x => SetButtonsBackgroundActive();
			ToggleButtonsBgr.Layer = layer;

//.........这里部分代码省略.........
开发者ID:Empyrial,项目名称:IEMod.pw,代码行数:101,代码来源:UICustomizer.cs


注:本文中的Vector3.Plus方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。