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


C# ControlCopyFlags类代码示例

本文整理汇总了C#中ControlCopyFlags的典型用法代码示例。如果您正苦于以下问题:C# ControlCopyFlags类的具体用法?C# ControlCopyFlags怎么用?C# ControlCopyFlags使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。


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

示例1: Copy

	public override void Copy(SpriteRoot s, ControlCopyFlags flags)
	{
		base.Copy(s, flags);

		if (!(s is UIBtnWWW))
			return;

		UIBtnWWW b = (UIBtnWWW)s;

		if ((flags & ControlCopyFlags.Settings) == ControlCopyFlags.Settings)
		{
			URL = b.URL;
		}
	}
开发者ID:jordan1818,项目名称:JumpsterProject,代码行数:14,代码来源:UIBtnWWW.cs

示例2: Copy

	public override void Copy(SpriteRoot s, ControlCopyFlags flags)
	{
		base.Copy(s, flags);

		if (!(s is UIBtnLoadScene))
			return;

		UIBtnLoadScene b = (UIBtnLoadScene)s;

		if ((flags & ControlCopyFlags.Settings) == ControlCopyFlags.Settings)
		{
			scene = b.scene;
			loadingPanel = b.loadingPanel;
		}
	}
开发者ID:jordan1818,项目名称:JumpsterProject,代码行数:15,代码来源:UIBtnLoadScene.cs

示例3: Copy

	/// <summary>
	/// Copies all of the specified control's settings
	/// to this control, provided they are of the same
	/// type.  One exception is that layers are not
	/// copied as this would require a new allocation
	/// and could negatively impact performance at
	/// runtime.
	/// </summary>
	/// <param name="s">Reference to the control whose settings are to be copied to this control.</param>
	public virtual void Copy(SpriteRoot s, ControlCopyFlags flags)
	{
		if ((flags & ControlCopyFlags.Appearance) == ControlCopyFlags.Appearance)
		{
			if (Application.isPlaying && s.Started)
				base.Copy(s);
			else // If we're in-editor, copy the TextureAnims too
				base.CopyAll(s);

			if (!(s is AutoSpriteControlBase))
			{
				if (autoResize || pixelPerfect)
					CalcSize();
				else
					SetSize(s.width, s.height);

				SetBleedCompensation();

				return;
			}
		}



		AutoSpriteControlBase c = (AutoSpriteControlBase)s;

		// Copy transitions:
		if ((flags & ControlCopyFlags.Transitions) == ControlCopyFlags.Transitions)
		{
			if (c is UIStateToggleBtn || !Application.isPlaying)
			{
				if (c.Transitions != null)
				{
					Transitions = new EZTransitionList[c.Transitions.Length];
					for (int i = 0; i < Transitions.Length; ++i)
					{
						Transitions[i] = new EZTransitionList();
						c.Transitions[i].CopyToNew(Transitions[i], true);
					}
				}
			}
			else
			{
				if (Transitions != null && c.Transitions != null)
					for (int i = 0; i < Transitions.Length && i < c.Transitions.Length; ++i)
						c.Transitions[i].CopyTo(Transitions[i], true);
			}
		}


		if ((flags & ControlCopyFlags.Text) == ControlCopyFlags.Text)
		{
			// See if we want to clone the other
			// control's text mesh:
			if (spriteText == null && c.spriteText != null)
			{
				GameObject newText = (GameObject)Instantiate(c.spriteText.gameObject);
				newText.transform.parent = transform;
				newText.transform.localPosition = c.spriteText.transform.localPosition;
				newText.transform.localScale = c.spriteText.transform.localScale;
				newText.transform.localRotation = c.spriteText.transform.localRotation;
			}

			if (spriteText != null)
				spriteText.Copy(c.spriteText);

			text = c.text;
			textOffsetZ = c.textOffsetZ;
			includeTextInAutoCollider = c.includeTextInAutoCollider;
		}

		if ((flags & ControlCopyFlags.Data) == ControlCopyFlags.Data)
		{
			data = c.data;
		}

		if ((flags & ControlCopyFlags.Appearance) == ControlCopyFlags.Appearance)
		{
			// See if we can copy the other control's collider's settings:
			if (c.collider != null)
			{
				// See if we don't already have a collider, in which case,
				// duplicate the one of the control being copied:
				if (collider == null)
				{
					gameObject.AddComponent(c.collider.GetType());
					customCollider = c.customCollider;
				}

				if (collider.GetType() == c.collider.GetType())
				{
//.........这里部分代码省略.........
开发者ID:juliancruz87,项目名称:transpp,代码行数:101,代码来源:AutoSpriteControlBase.cs

示例4: Copy

	public override void Copy(SpriteRoot s, ControlCopyFlags flags)
	{
		base.Copy(s, flags);

		if (!(s is UIProgressBar))
			return;

		if (Application.isPlaying)
		{
			UIProgressBar b = (UIProgressBar)s;


			if ((flags & ControlCopyFlags.Appearance) == ControlCopyFlags.Appearance)
			{
				if (emptySprite != null)
					emptySprite.Copy(b.emptySprite);
			}
		}
	}
开发者ID:uptopgames,项目名称:rhythm,代码行数:19,代码来源:UIProgressBar.cs

示例5: Copy

	public override void Copy(SpriteRoot s, ControlCopyFlags flags)
	{
		base.Copy(s, flags);

		if (!(s is UIRadioBtn))
			return;

		UIRadioBtn b = (UIRadioBtn)s;

		if ((flags & ControlCopyFlags.State) == ControlCopyFlags.State)
		{
			state = b.state;
			prevTransition = b.prevTransition;
			if (Application.isPlaying)
				Value = b.Value;
		}

		if ((flags & ControlCopyFlags.Settings) == ControlCopyFlags.Settings)
		{
			group = b.group;
			defaultValue = b.defaultValue;
		}

		if ((flags & ControlCopyFlags.Invocation) == ControlCopyFlags.Invocation)
		{
			scriptWithMethodToInvoke = b.scriptWithMethodToInvoke;
			methodToInvoke = b.methodToInvoke;
			whenToInvoke = b.whenToInvoke;
			delay = b.delay;
		}

		if ((flags & ControlCopyFlags.Sound) == ControlCopyFlags.Sound)
		{
			soundToPlay = b.soundToPlay;
		}
	}
开发者ID:MtvnGames,项目名称:marblemadness,代码行数:36,代码来源:UIRadioBtn.cs

示例6: Copy

	public override void Copy(SpriteRoot s, ControlCopyFlags flags)
	{
		base.Copy(s, flags);

		if (!(s is UIBtnChangePanel))
			return;

		UIBtnChangePanel b = (UIBtnChangePanel)s;

		if ((flags & ControlCopyFlags.Settings) == ControlCopyFlags.Settings)
		{
			panelManager = b.panelManager;
			changeType = b.changeType;
			panel = b.panel;
		}
	}
开发者ID:robert-irribarren,项目名称:TraumaOR,代码行数:16,代码来源:UIBtnChangePanel.cs

示例7: Copy

	public override void Copy(SpriteRoot s, ControlCopyFlags flags)
	{
		base.Copy(s, flags);

		if (!(s is UISlider))
			return;

		UISlider b = (UISlider)s;


		if ((flags & ControlCopyFlags.Invocation) == ControlCopyFlags.Invocation)
		{
			scriptWithMethodToInvoke = b.scriptWithMethodToInvoke;
			methodToInvoke = b.methodToInvoke;
		}

		if ((flags & ControlCopyFlags.Settings) == ControlCopyFlags.Settings)
		{
			defaultValue = b.defaultValue;
			stopKnobFromEdge = b.stopKnobFromEdge;
			knobOffset = b.knobOffset;
			knobSize = b.knobSize;
			knobColliderSizeFactor = b.knobColliderSizeFactor;
		}

		if ((flags & ControlCopyFlags.Appearance) == ControlCopyFlags.Appearance)
		{
			if (Application.isPlaying)
			{
				if (emptySprite != null)
					emptySprite.Copy(b.emptySprite);

				if (knob != null)
					knob.Copy(b.knob);

				truncFloor = b.truncFloor;
				truncRange = b.truncRange;
			}
		}

		if ((flags & ControlCopyFlags.State) == ControlCopyFlags.State)
		{
			CalcKnobStartPos();
			Value = b.Value;
		}
	}
开发者ID:nbolabs,项目名称:KnifeLi,代码行数:46,代码来源:UISlider.cs

示例8: Copy

	public override void Copy(SpriteRoot s, ControlCopyFlags flags)
	{
		base.Copy(s, flags);

		if (!(s is UIPanelTab))
			return;

		UIPanelTab b = (UIPanelTab)s;

		if ((flags & ControlCopyFlags.Settings) == ControlCopyFlags.Settings)
		{
			toggle = b.toggle;
			panelManager = b.panelManager;
			panel = b.panel;
			panelShowingAtStart = b.panelShowingAtStart;
		}

		if ((flags & ControlCopyFlags.State) == ControlCopyFlags.State)
		{
			Value = b.Value;
		}
	}
开发者ID:stevesolomon,项目名称:MicroDungeonPrototype,代码行数:22,代码来源:UIPanelTab.cs

示例9: Copy

	public override void Copy(IControl c, ControlCopyFlags flags)
	{
		if (!(c is UIRadioBtn3D))
			return;

		base.Copy(c);

		UIRadioBtn3D b = (UIRadioBtn3D)c;

		if ((flags & ControlCopyFlags.Settings) == ControlCopyFlags.Settings)
		{
			group = b.group;
			defaultValue = b.defaultValue;
		}

		if ((flags & ControlCopyFlags.State) == ControlCopyFlags.State)
		{
			prevTransition = b.prevTransition;

			if (Application.isPlaying)
				Value = b.Value;
		}

		if ((flags & ControlCopyFlags.Invocation) == ControlCopyFlags.Invocation)
		{
			scriptWithMethodToInvoke = b.scriptWithMethodToInvoke;
			methodToInvoke = b.methodToInvoke;
			whenToInvoke = b.whenToInvoke;
			delay = b.delay;
		}

		if ((flags & ControlCopyFlags.Sound) == ControlCopyFlags.Sound)
		{
			soundToPlay = b.soundToPlay;
		}
	}
开发者ID:juliancruz87,项目名称:Ataraxia,代码行数:36,代码来源:UIRadioBtn3D.cs

示例10: Copy

	public override void Copy(SpriteRoot s, ControlCopyFlags flags)
	{
		base.Copy(s, flags);

		if (!(s is UIScrollKnob))
			return;

		UIScrollKnob b = (UIScrollKnob)s;


		if ((flags & ControlCopyFlags.State) == ControlCopyFlags.State)
		{
			origPos = b.origPos;
			ctrlPlane = b.ctrlPlane;
			slider = b.slider;
		}

		if ((flags & ControlCopyFlags.Settings) == ControlCopyFlags.Settings)
		{
			maxScrollPos = b.maxScrollPos;
			colliderSizeFactor = b.colliderSizeFactor;
		}
	}
开发者ID:juliancruz87,项目名称:Ataraxia,代码行数:23,代码来源:UIScrollKnob.cs

示例11: Copy

	public override void Copy(SpriteRoot s, ControlCopyFlags flags)
	{
		base.Copy(s, flags);

		if (!(s is UITextField))
			return;

		UITextField b = (UITextField)s;


		if ((flags & ControlCopyFlags.Settings) == ControlCopyFlags.Settings)
		{
			maxLength = b.maxLength;

#if UNITY_IPHONE || UNITY_ANDROID
			type = b.type;
			autoCorrect = b.autoCorrect;
			secure = b.secure;
			alert = b.alert;
#endif
			typingSoundEffect = b.typingSoundEffect;
			fieldFullSound = b.fieldFullSound;
		}

		if ((flags & ControlCopyFlags.Appearance) == ControlCopyFlags.Appearance)
		{
			caret.Copy(b.caret);
		}

		if ((flags & ControlCopyFlags.State) == ControlCopyFlags.State)
		{
			insert = b.insert;
			Text = b.Text;
		}
	}
开发者ID:Nilesh410451,项目名称:archery-master,代码行数:35,代码来源:UITextField.cs

示例12: Copy

	public override void Copy(SpriteRoot s, ControlCopyFlags flags)
	{
		base.Copy(s, flags);

		if (!(s is UIButton))
			return;

		UIButton btn = (UIButton)s;

		if ((flags & ControlCopyFlags.State) == ControlCopyFlags.State)
		{
			prevTransition = btn.prevTransition;

			if (Application.isPlaying)
				SetControlState(btn.controlState);
		}

		if ((flags & ControlCopyFlags.Invocation) == ControlCopyFlags.Invocation)
		{
			scriptWithMethodToInvoke = btn.scriptWithMethodToInvoke;
			methodToInvoke = btn.methodToInvoke;
			whenToInvoke = btn.whenToInvoke;
			delay = btn.delay;
		}

		if ((flags & ControlCopyFlags.Sound) == ControlCopyFlags.Sound)
		{
			soundOnOver = btn.soundOnOver;
			soundOnClick = btn.soundOnClick;
		}

		if ((flags & ControlCopyFlags.Settings) == ControlCopyFlags.Settings)
		{
			repeat = btn.repeat;
		}
	}
开发者ID:amutnick,项目名称:CrackTheCode_Repo,代码行数:36,代码来源:UIButton.cs

示例13: Copy

	public override void Copy(IControl c, ControlCopyFlags flags)
	{
		base.Copy(c, flags);

		if (!(c is UIButton3D))
			return;

		UIButton3D b = (UIButton3D)c;

		if ((flags & ControlCopyFlags.State) == ControlCopyFlags.State)
		{
			prevTransition = b.prevTransition;

			if (Application.isPlaying)
				SetControlState(b.controlState);
		}

		if ((flags & ControlCopyFlags.Invocation) == ControlCopyFlags.Invocation)
		{
			scriptWithMethodToInvoke = b.scriptWithMethodToInvoke;
			methodToInvoke = b.methodToInvoke;
			whenToInvoke = b.whenToInvoke;
			delay = b.delay;
		}

		if ((flags & ControlCopyFlags.Sound) == ControlCopyFlags.Sound)
		{
			soundOnOver = b.soundOnOver;
			soundOnClick = b.soundOnClick;
		}

		if ((flags & ControlCopyFlags.Settings) == ControlCopyFlags.Settings)
		{
			repeat = b.repeat;
		}
	}
开发者ID:robert-irribarren,项目名称:TraumaOR,代码行数:36,代码来源:UIButton3D.cs

示例14: Copy

	public virtual void Copy(IControl ctl, ControlCopyFlags flags)
	{
		if (!(ctl is ControlBase))
			return;

		ControlBase c = (ControlBase)ctl;


		// Copy transitions:
		if ((flags & ControlCopyFlags.Transitions) == ControlCopyFlags.Transitions)
		{
			if (c is UIStateToggleBtn3D)
			{
				if (c.Transitions != null)
				{
					((UIStateToggleBtn3D)this).transitions = new EZTransitionList[c.Transitions.Length];
					for (int i = 0; i < Transitions.Length; ++i)
						c.Transitions[i].CopyToNew(Transitions[i], true);
				}
			}
			else
			{
				if (Transitions != null && c.Transitions != null)
					for (int i = 0; i < Transitions.Length && i < c.Transitions.Length; ++i)
						c.Transitions[i].CopyTo(Transitions[i], true);
			}
		}


		if ((flags & ControlCopyFlags.Text) == ControlCopyFlags.Text)
		{
			// See if we want to clone the other
			// control's text mesh:
			if (spriteText == null && c.spriteText != null)
			{
				GameObject newText = (GameObject)Instantiate(c.spriteText.gameObject);
				newText.transform.parent = transform;
				newText.transform.localPosition = c.spriteText.transform.localPosition;
				newText.transform.localScale = c.spriteText.transform.localScale;
				newText.transform.localRotation = c.spriteText.transform.localRotation;
			}

			Text = c.Text;
		}

		if ((flags & ControlCopyFlags.Appearance) == ControlCopyFlags.Appearance)
		{
			// See if we can copy the other control's collider's settings:
			if (collider.GetType() == c.collider.GetType())
			{
				if (collider is BoxCollider)
				{
					BoxCollider bc1 = (BoxCollider)collider;
					BoxCollider bc2 = (BoxCollider)c.collider;
					bc1.center = bc2.center;
					bc1.size = bc2.size;
				}
				else if (collider is SphereCollider)
				{
					SphereCollider sc1 = (SphereCollider)collider;
					SphereCollider sc2 = (SphereCollider)c.collider;
					sc1.center = sc2.center;
					sc1.radius = sc2.radius;
				}
				else if (collider is CapsuleCollider)
				{
					CapsuleCollider cc1 = (CapsuleCollider)collider;
					CapsuleCollider cc2 = (CapsuleCollider)c.collider;
					cc1.center = cc2.center;
					cc1.radius = cc2.radius;
					cc1.height = cc2.height;
					cc1.direction = cc2.direction;
				}
				else if (collider is MeshCollider)
				{
					MeshCollider mc1 = (MeshCollider)collider;
					MeshCollider mc2 = (MeshCollider)c.collider;
					mc1.smoothSphereCollisions = mc2.smoothSphereCollisions;
					mc1.convex = mc2.convex;
					mc1.sharedMesh = mc2.sharedMesh;
				}

				collider.isTrigger = c.collider.isTrigger;
			}
		}

		if ((flags & ControlCopyFlags.Invocation) == ControlCopyFlags.Invocation)
		{
			changeDelegate = c.changeDelegate;
			inputDelegate = c.inputDelegate;
		}

		if ((flags & ControlCopyFlags.State) == ControlCopyFlags.State)
		{
			Container = c.Container;

			if (Application.isPlaying)
				controlIsEnabled = c.controlIsEnabled;
		}
	}
开发者ID:psaykham,项目名称:ARPandaBox,代码行数:100,代码来源:ControlBase.cs

示例15: Copy

	public override void Copy(SpriteRoot s, ControlCopyFlags flags)
	{
		base.Copy(s, flags);

		if (!(s is UIStateToggleBtn))
			return;

		UIStateToggleBtn b = (UIStateToggleBtn)s;

		if ((flags & ControlCopyFlags.Settings) == ControlCopyFlags.Settings)
		{
			defaultState = b.defaultState;
		}

		if ((flags & ControlCopyFlags.State) == ControlCopyFlags.State)
		{
			prevTransition = b.prevTransition;

			if (Application.isPlaying)
				SetToggleState(b.StateNum);
		}

		if ((flags & ControlCopyFlags.Invocation) == ControlCopyFlags.Invocation)
		{
			scriptWithMethodToInvoke = b.scriptWithMethodToInvoke;
			methodToInvoke = b.methodToInvoke;
			whenToInvoke = b.whenToInvoke;
			delay = b.delay;
		}

		if ((flags & ControlCopyFlags.Sound) == ControlCopyFlags.Sound)
		{
			soundToPlay = b.soundToPlay;
		}
	}
开发者ID:juliancruz87,项目名称:transpp,代码行数:35,代码来源:UIStateToggleBtn.cs


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