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


C# TargetMode类代码示例

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


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

示例1: CreateRelationship

        internal override ZipPackageRelationship CreateRelationship(Uri targetUri, TargetMode targetMode, string relationshipType)
        {

            var rel = base.CreateRelationship(targetUri, targetMode, relationshipType);
            rel.SourceUri = Uri;
            return rel;
        }
开发者ID:acinep,项目名称:epplus,代码行数:7,代码来源:ZipPackagePart.cs

示例2: OnEnable

		protected void OnEnable()
		{
#if UNITY_4_6 || UNITY_4_7 || UNITY_4_8 || UNITY_4_9 || UNITY_5_0
			this.title = "SP Reference Replacer";
#else
            this.titleContent = new GUIContent("SP Reference Replacer");
#endif
            if (EditorPrefs.HasKey(SPTools.Settings_SavedInstanceIDKey))
			{
				string instancePath = AssetDatabase.GetAssetPath(EditorPrefs.GetInt(SPTools.Settings_SavedInstanceIDKey, 0));
				
				if (!string.IsNullOrEmpty(instancePath))
				{
					this.m_Instance = AssetDatabase.LoadAssetAtPath(instancePath, typeof(SPInstance)) as SPInstance;
				}
			}
			
			// Default prefs
			if (!EditorPrefs.HasKey(SPReferenceReplacerWindow.PrefsKey_TargetMode))
			{
				EditorPrefs.SetInt(SPReferenceReplacerWindow.PrefsKey_TargetMode, (int)this.m_TargetMode);
			}
			
			// Load target mode setting
			this.m_TargetMode = (TargetMode)EditorPrefs.GetInt(SPReferenceReplacerWindow.PrefsKey_TargetMode);
		}
开发者ID:callumlawson,项目名称:HardChoices,代码行数:26,代码来源:SPReferenceReplacerWindow.cs

示例3: BottomRight

    private void BottomRight()
    {
        GUI.skin = leftRight;
        GUI.BeginGroup(new Rect(Screen.width - 300, Screen.height - 300, 300, 300));
        GUI.DrawTexture(new Rect(0, 0, 300, 300), bgImage, ScaleMode.StretchToFill);

        if (GameVars.selectedTurret != null)
        {
            Tower selectedTower = GameVars.selectedTurret.GetComponent<Tower>();
            targetMode = (TargetMode)GUI.SelectionGrid(new Rect(40, 40, 180, 50), (int)targetMode, selectionStrings, 2);
            damage = GUI.HorizontalSlider(new Rect(30, 100, 130, 30), selectedTower.Damage, 1.0f, selectedTower.maxPoints);
            speed = GUI.HorizontalSlider(new Rect(30, 130, 130, 30), selectedTower.Speed, 1.0f, selectedTower.maxPoints);
            range = GUI.HorizontalSlider(new Rect(30, 160, 130, 30), selectedTower.Range, 1.0f, selectedTower.maxPoints);
            GUI.Label(new Rect(170, 90, 200, 100), "Damage: " + (int)damage);
            GUI.Label(new Rect(170, 120, 200, 100), "Speed: " + (int)speed);
            GUI.Label(new Rect(170, 150, 200, 100), "Range: " + (int)range);

            //if anything has changed, update it
            if (damage != selectedTower.Damage) { GameVars.selectedTurret.GetComponent<Tower>().Damage = damage; }
            if (speed != selectedTower.Speed) { GameVars.selectedTurret.GetComponent<Tower>().Speed = speed; }
            if (range != selectedTower.Range) { GameVars.selectedTurret.GetComponent<Tower>().Range = range; }
            if (targetMode != selectedTower.targetingMode) { GameVars.selectedTurret.GetComponent<Tower>().targetingMode = targetMode; }
        }
        GUI.EndGroup();
    }
开发者ID:nallelcm,项目名称:TD,代码行数:25,代码来源:MainGUI.cs

示例4: Fire

    public void Fire(TargetMode mode, MagicSpawner magazine)
    {
        if (!isActive) return;

        if (magazine.IsLoaded) {
            magazine.Fire (GetTarget (mode));
        }
    }
开发者ID:n0mimono,项目名称:Book0,代码行数:8,代码来源:EnchantControl.cs

示例5: GetTarget

 public Transform GetTarget(TargetMode mode)
 {
     if (mode == TargetMode.Single) {
         return primaryTarget;
     } else {
         return targetList.RandomOrDefault ();
     }
 }
开发者ID:n0mimono,项目名称:Book0,代码行数:8,代码来源:EnchantControl.cs

示例6: CreateRelationship

 internal virtual ZipPackageRelationship CreateRelationship(Uri targetUri, TargetMode targetMode, string relationshipType)
 {
     var rel = new ZipPackageRelationship();
     rel.TargetUri = targetUri;
     rel.TargetMode = targetMode;
     rel.RelationshipType = relationshipType;
     rel.Id = "rId" + (maxRId++).ToString();
     _rels.Add(rel);
     return rel;
 }
开发者ID:GitOffice,项目名称:DataPie,代码行数:10,代码来源:ZipPackageRelationshipBase.cs

示例7: Start

    // Use this for initialization
    void Start()
    {
        if(targetMode==TargetMode.Transform&&targetTransform==null)targetMode = TargetMode.Point;
        trans = transform;

        #if UNITY_EDITOR
        curPosA = new Vector3[numPoints+1];
        firstAxisA = new Vector3[numPoints+1];
        secondAxisA = new Vector3[numPoints+1];
        #endif
    }
开发者ID:GameDesignGroup6,项目名称:RodPacers,代码行数:12,代码来源:P2PLightning.cs

示例8: PackageRelationship

        internal PackageRelationship(string id, Package package, string relationshipType,
                                      Uri sourceUri, TargetMode targetMode, Uri targetUri)
        {
            Check.IdIsValid(id);
            Check.Package(package);
            Check.RelationshipTypeIsValid(relationshipType);
            Check.SourceUri(sourceUri);
            Check.TargetUri(targetUri);

            Id = id;
            Package = package;
            RelationshipType = relationshipType;
            SourceUri = sourceUri;
            TargetMode = targetMode;
            TargetUri = targetUri;
        }
开发者ID:WordDocX,项目名称:DocX,代码行数:16,代码来源:PackageRelationship.cs

示例9: Slam

    public void Slam(Vector3 target)
    {
        if (hasTarget) return;

        targetMode = TargetMode.SLAM;
        Vector3 start = transform.position;
        start.x = Mathf.Clamp(start.x, transform.parent.position.x + minX, transform.parent.position.x + maxX);
        Vector3 end = target;
        end.x = Mathf.Clamp(end.x, transform.parent.position.x + minX, transform.parent.position.x + maxX);
        end.y = start.y;
        Vector3 b = new Vector3(start.x, start.y + maxHeight * 0.5f);
        Vector3 c = new Vector3(end.x, start.y + maxHeight);
        Vector3[] points = new Vector3[] { start, b, c, end };
        bezier = new CubicBezier(points);
        hasTarget = true;
        progress = 0.01f;
    }
开发者ID:CliffordSix,项目名称:2.5Platformer,代码行数:17,代码来源:AtlasFist.cs

示例10: PackageRelationship

        /**
         * Constructor.
         * 
         * @param pkg
         * @param sourcePart
         * @param targetUri
         * @param targetMode
         * @param relationshipType
         * @param id
         */
        public PackageRelationship(OPCPackage pkg, PackagePart sourcePart,
                Uri targetUri, TargetMode targetMode, String relationshipType,
                String id)
        {
            if (pkg == null)
                throw new ArgumentException("pkg");
            if (targetUri == null)
                throw new ArgumentException("targetUri");
            if (relationshipType == null)
                throw new ArgumentException("relationshipType");
            if (id == null)
                throw new ArgumentException("id");

            this.container = pkg;
            this.source = sourcePart;
            this.targetUri = targetUri;
            this.targetMode = targetMode;
            this.relationshipType = relationshipType;
            this.id = id;
        }
开发者ID:Reinakumiko,项目名称:npoi,代码行数:30,代码来源:PackageRelationship.cs

示例11: CreateRelationship

 /// <summary>
 /// Adds a relationship to this PackagePart with the Target PackagePart specified as the Uri
 /// Initial and trailing spaces in the name of the PackageRelationship are trimmed.
 /// </summary>
 /// <param name="targetUri"></param>
 /// <param name="targetMode">Enumeration indicating the base uri for the target uri</param>
 /// <param name="relationshipType">PackageRelationship type, having uri like syntax that is used to 
 /// uniquely identify the role of the relationship</param>
 /// <param name="id">String that conforms to the xsd:ID datatype. Unique across the source's
 /// relationships. Null is OK (ID will be generated). An empty string is an invalid XML ID.</param>
 /// <returns></returns>
 /// <exception cref="InvalidOperationException">If this part has been deleted</exception>
 /// <exception cref="InvalidOperationException">If the parent package has been closed or disposed</exception>
 /// <exception cref="IOException">If the package is readonly, it cannot be modified</exception>
 /// <exception cref="ArgumentNullException">If parameter "targetUri" is null</exception>
 /// <exception cref="ArgumentNullException">If parameter "relationshipType" is null</exception>
 /// <exception cref="ArgumentOutOfRangeException">If parameter "targetMode" enumeration does not have a valid value</exception>
 /// <exception cref="ArgumentException">If TargetMode is TargetMode.Internal and the targetUri is an absolute Uri </exception>
 /// <exception cref="ArgumentException">If relationship is being targeted to a relationship part</exception>
 /// <exception cref="System.Xml.XmlException">If parameter "id" is not a valid Xsd Id</exception>
 /// <exception cref="System.Xml.XmlException">If an id is provided in the method, and its not unique</exception>
 public PackageRelationship CreateRelationship(Uri targetUri, TargetMode targetMode, string relationshipType, String id)
 {
     CheckInvalidState();
     _container.ThrowIfReadOnly();
     EnsureRelationships();
     //All parameter validation is done in the following method
     return _relationships.Add(targetUri, targetMode, relationshipType, id);
 }
开发者ID:krytht,项目名称:DotNetReferenceSource,代码行数:29,代码来源:PackagePart.cs

示例12: RunProject

        public void RunProject(TargetMode target)
        {
            MainForm mainForm = FindForm() as MainForm;
            if (mainForm == null || mainForm.SettingsModel == null)
                return;

            Process.Start("http://localhost:" + mainForm.SettingsModel.RunnerHttpServerPort.ToString() + '/' + target.ToString());
        }
开发者ID:PsichiX,项目名称:PlayGate,代码行数:8,代码来源:BuildPageControl.cs

示例13: AddRelationship

        /**
         * Add a relationship to a part (except relationships part).
         * <p>
         * Check rule M1.25: The Relationships part shall not have relationships to
         * any other part. Package implementers shall enforce this requirement upon
         * the attempt to create such a relationship and shall treat any such
         * relationship as invalid.
         * </p>
         * @param targetURI
         *            URI of the target part. Must be relative to the source root
         *            directory of the part.
         * @param targetMode
         *            Mode [Internal|External].
         * @param relationshipType
         *            Type of relationship.
         * @param id
         *            Relationship unique id.
         * @return The newly created and added relationship
         * 
         * @throws InvalidFormatException
         *             If the URI point to a relationship part URI.
         * @see org.apache.poi.OpenXml4Net.opc.RelationshipSource#AddRelationship(org.apache.poi.OpenXml4Net.opc.PackagePartName,
         *      org.apache.poi.OpenXml4Net.opc.TargetMode, java.lang.String, java.lang.String)
         */
        public PackageRelationship AddRelationship(Uri targetURI,
                TargetMode targetMode, String relationshipType, String id)
        {
            container.ThrowExceptionIfReadOnly();

            if (targetURI == null)
            {
                throw new ArgumentException("targetPartName");
            }
            //if (targetMode == null)
            //{
            //    throw new ArgumentException("targetMode");
            //}
            if (relationshipType == null)
            {
                throw new ArgumentException("relationshipType");
            }

            // Try to retrieve the target part

            if (this.IsRelationshipPart
                    || PackagingUriHelper.IsRelationshipPartURI(targetURI))
            {
                throw new InvalidOperationException(
                        "Rule M1.25: The Relationships part shall not have relationships to any other part.");
            }

            if (relationships == null)
            {
                relationships = new PackageRelationshipCollection();
            }

            return relationships.AddRelationship(targetURI,
                    targetMode, relationshipType, id);
        }
开发者ID:ctddjyds,项目名称:npoi,代码行数:59,代码来源:PackagePart.cs

示例14: CreateRelationship

		internal PackageRelationship CreateRelationship (Uri targetUri, TargetMode targetMode, string relationshipType, string id, bool loading)
		{
			if (!loading)
				CheckIsReadOnly ();
			
			Check.TargetUri (targetUri);
			if (targetUri.IsAbsoluteUri && targetMode == TargetMode.Internal)
				throw new ArgumentException ("TargetUri cannot be absolute for an internal relationship");
			
			Check.RelationshipTypeIsValid (relationshipType);
			Check.IdIsValid (id);

			if (id == null)
				id = NextId ();

			PackageRelationship r = new PackageRelationship (id, this, relationshipType, Uri, targetMode, targetUri);

			if (!PartExists (RelationshipUri))
				CreatePartCore (RelationshipUri, RelationshipContentType, CompressionOption.NotCompressed).IsRelationship = true;
			
			Relationships.Add (r.Id, r);
			relationshipsCollection.Relationships.Add (r);

			if (!loading) {
				using (Stream s = GetPart (RelationshipUri).GetStream ())
					WriteRelationships (relationships, s);
			}
			
			return r;
		}
开发者ID:calumjiao,项目名称:Mono-Class-Libraries,代码行数:30,代码来源:Package.cs

示例15: CreateRelationship

 /// <summary>
 /// Creates a relationship at the Package level with the Target PackagePart specified as the Uri
 /// </summary>
 /// <param name="targetUri">Target's URI</param>
 /// <param name="targetMode">Enumeration indicating the base uri for the target uri</param>
 /// <param name="relationshipType">PackageRelationship type, having uri like syntax that is used to
 /// uniquely identify the role of the relationship</param>
 /// <param name="id">String that conforms to the xsd:ID datatype. Unique across the source's
 /// relationships. Null is OK (ID will be generated). An empty string is an invalid XML ID.</param>
 /// <returns></returns>
 /// <exception cref="ObjectDisposedException">If this Package object has been disposed</exception>
 /// <exception cref="IOException">If the package is readonly, it cannot be modified</exception>
 /// <exception cref="ArgumentNullException">If parameter "targetUri" is null</exception>
 /// <exception cref="ArgumentNullException">If parameter "relationshipType" is null</exception>
 /// <exception cref="ArgumentOutOfRangeException">If parameter "targetMode" enumeration does not have a valid value</exception>
 /// <exception cref="ArgumentException">If TargetMode is TargetMode.Internal and the targetUri is an absolute Uri </exception>
 /// <exception cref="ArgumentException">If relationship is being targeted to a relationship part</exception>
 /// <exception cref="System.Xml.XmlException">If parameter "id" is not a valid Xsd Id</exception>
 /// <exception cref="System.Xml.XmlException">If an id is provided in the method, and its not unique</exception>
 public PackageRelationship CreateRelationship(Uri targetUri, TargetMode targetMode, string relationshipType, String id)
 {
     ThrowIfObjectDisposed();
     ThrowIfReadOnly();
     EnsureRelationships();
     //All parameter validation is done in the following call
     return _relationships.Add(targetUri, targetMode, relationshipType, id);
 }
开发者ID:ChuangYang,项目名称:corefx,代码行数:27,代码来源:Package.cs


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