本文整理汇总了C#中TargetMode类的典型用法代码示例。如果您正苦于以下问题:C# TargetMode类的具体用法?C# TargetMode怎么用?C# TargetMode使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
TargetMode类属于命名空间,在下文中一共展示了TargetMode类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的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
示例16: OnGUI
protected void OnGUI()
{
EditorGUIUtility.labelWidth = 100f;
GUILayout.BeginVertical();
GUILayout.Space((float)SPReferenceReplacerWindow.padding.top);
GUILayout.BeginHorizontal();
GUILayout.Space((float)SPReferenceReplacerWindow.padding.left);
GUILayout.BeginVertical();
GUI.changed = false;
this.m_Instance = EditorGUILayout.ObjectField("Sprite Packer", this.m_Instance, typeof(SPInstance), false) as SPInstance;
if (GUI.changed)
{
// Save the instance id
EditorPrefs.SetInt(SPTools.Settings_SavedInstanceIDKey, (this.m_Instance == null) ? 0 : this.m_Instance.GetInstanceID());
}
GUILayout.Space(6f);
GUILayout.BeginVertical(GUI.skin.box);
GUILayout.Space(6f);
GUILayout.BeginHorizontal();
GUILayout.Space(6f);
EditorGUILayout.LabelField("Replace mode", GUILayout.Width(130f));
this.m_ReplaceMode = (ReplaceMode)EditorGUILayout.EnumPopup(this.m_ReplaceMode);
GUILayout.Space(6f);
GUILayout.EndHorizontal();
GUILayout.BeginHorizontal();
GUILayout.Space(6f);
EditorGUI.BeginChangeCheck();
EditorGUILayout.LabelField("Replace references in", GUILayout.Width(130f));
this.m_TargetMode = (TargetMode)EditorGUILayout.EnumPopup(this.m_TargetMode);
if (EditorGUI.EndChangeCheck())
{
EditorPrefs.SetInt(SPReferenceReplacerWindow.PrefsKey_TargetMode, (int)this.m_TargetMode);
}
GUILayout.Space(6f);
GUILayout.EndHorizontal();
GUILayout.BeginHorizontal();
GUILayout.Space(6f);
GUI.changed = false;
bool spriteRenderersOnly = GUILayout.Toggle(EditorPrefs.GetBool(SPReferenceReplacerWindow.PrefsKey_SpriteRenderersOnly), " Replace references in Sprite Renderers only ?");
if (GUI.changed)
{
EditorPrefs.SetBool(SPReferenceReplacerWindow.PrefsKey_SpriteRenderersOnly, spriteRenderersOnly);
}
GUILayout.Space(6f);
GUILayout.EndHorizontal();
GUILayout.Space(6f);
GUILayout.EndVertical();
GUILayout.Space(6f);
if (this.m_Instance == null)
{
EditorGUILayout.HelpBox("Please set the sprite packer instance reference in order to use this feature.", MessageType.Info);
}
else
{
if (GUILayout.Button("Replace"))
{
int replacedCount = 0;
switch (this.m_TargetMode)
{
case TargetMode.CurrentScene:
{
replacedCount += SPTools.ReplaceReferencesInScene(this.m_Instance.copyOfSprites, this.m_ReplaceMode, spriteRenderersOnly);
break;
}
case TargetMode.ProjectOnly:
{
replacedCount += SPTools.ReplaceReferencesInProject(this.m_Instance.copyOfSprites, this.m_ReplaceMode, spriteRenderersOnly);
break;
}
case TargetMode.CurrentSceneAndProject:
{
replacedCount += SPTools.ReplaceReferencesInProject(this.m_Instance.copyOfSprites, this.m_ReplaceMode, spriteRenderersOnly);
replacedCount += SPTools.ReplaceReferencesInScene(this.m_Instance.copyOfSprites, this.m_ReplaceMode, spriteRenderersOnly);
break;
}
case TargetMode.AllScenes:
{
replacedCount += SPTools.ReplaceReferencesInAllScenes(this.m_Instance.copyOfSprites, this.m_ReplaceMode, spriteRenderersOnly, false);
break;
}
case TargetMode.AllScenesAndProject:
{
replacedCount += SPTools.ReplaceReferencesInProject(this.m_Instance.copyOfSprites, this.m_ReplaceMode, spriteRenderersOnly);
replacedCount += SPTools.ReplaceReferencesInScene(this.m_Instance.copyOfSprites, this.m_ReplaceMode, spriteRenderersOnly);
EditorApplication.SaveScene();
//.........这里部分代码省略.........
开发者ID:Crashdowne,项目名称:2DBallTest,代码行数:101,代码来源:SPReferenceReplacerWindow.cs
示例17: PackageRelationship
//------------------------------------------------------
//
// Public Methods
//
//------------------------------------------------------
// None
//------------------------------------------------------
//
// Public Events
//
//------------------------------------------------------
// None
//------------------------------------------------------
//
// Internal Constructors
//
//------------------------------------------------------
#region Internal Constructor
/// <summary>
/// PackageRelationship constructor
/// </summary>
/// <param name="package">Owning Package object for this relationship</param>
/// <param name="sourcePart">owning part - will be null if the owner is the container</param>
/// <param name="targetUri">target of relationship</param>
/// <param name="targetMode">enum specifying the interpretation of the base uri for the target uri</param>
/// <param name="relationshipType">type name</param>
/// <param name="id">unique identifier</param>
internal PackageRelationship(Package package, PackagePart sourcePart, Uri targetUri, TargetMode targetMode, string relationshipType, string id)
{
//sourcePart can be null to represent that the relationships are at the package level
if (package == null)
throw new ArgumentNullException("package");
if (targetUri == null)
throw new ArgumentNullException("targetUri");
if (relationshipType == null)
throw new ArgumentNullException("relationshipType");
if (id == null)
throw new ArgumentNullException("id");
// The ID is guaranteed to be an XML ID by the caller (InternalRelationshipCollection).
// The following check is a precaution against future bug introductions.
#if DEBUG
try
{
// An XSD ID is an NCName that is unique. We can't check uniqueness at this level.
XmlConvert.VerifyNCName(id);
}
catch (XmlException exception)
{
throw new XmlException(Formatter.Format(Resources.NotAValidXmlIdString, id), exception);
}
#endif
// Additional check - don't accept absolute Uri's if targetMode is Internal.
Debug.Assert((targetMode == TargetMode.External || !targetUri.IsAbsoluteUri),
"PackageRelationship target must be relative if the TargetMode is Internal");
// Additional check - Verify if the Enum value is valid
Debug.Assert((targetMode >= TargetMode.Internal || targetMode <= TargetMode.External),
"TargetMode enum value is out of Range");
// Look for empty string or string with just spaces
Debug.Assert(relationshipType.Trim() != String.Empty,
"RelationshipType cannot be empty string or a string with just spaces");
_package = package;
_source = sourcePart;
_targetUri = targetUri;
_relationshipType = relationshipType;
_targetMode = targetMode;
_id = id;
}
开发者ID:eriawan,项目名称:Open-XML-SDK,代码行数:77,代码来源:PackageRelationship.cs
示例18: Sweep
public void Sweep(Vector3 target)
{
targetMode = TargetMode.SWEEP;
sweepStart = transform.position;
sweepStart.y = minY;
sweepTarget = target;
sweepTarget.y = minY;
hasTarget = true;
progress = 0.01f;
}
开发者ID:CliffordSix,项目名称:2.5Platformer,代码行数:10,代码来源:AtlasFist.cs
示例19: CleanProject
public void CleanProject(TargetMode target)
{
MainForm mainForm = FindForm() as MainForm;
if (mainForm == null || mainForm.SettingsModel == null || mainForm.ProjectModel == null)
return;
if (m_runningProcess != null && !m_runningProcess.HasExited)
{
MetroMessageBox.Show(mainForm, "Cannot clean " + target.ToString() + " " + " because another operation is running!", "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
return;
}
string path = Path.Combine(Path.GetFullPath(mainForm.ProjectModel.WorkingDirectory), "bin", target.ToString());
if (Directory.Exists(path))
{
Directory.Delete(path, true);
MetroMessageBox.Show(mainForm, target.ToString() + " build cleaned!", "Operation Complete!", MessageBoxButtons.OK, MessageBoxIcon.Information);
}
else
MetroMessageBox.Show(mainForm, target.ToString() + " build does not exists!", "Operation Error!", MessageBoxButtons.OK, MessageBoxIcon.Error);
}
开发者ID:PsichiX,项目名称:PlayGate,代码行数:21,代码来源:BuildPageControl.cs
示例20: CreateRelationship
private PackageRelationship CreateRelationship (Uri targetUri, TargetMode targetMode, string relationshipType, string id, bool loading)
{
Package.CheckIsReadOnly ();
Check.TargetUri (targetUri);
Check.RelationshipTypeIsValid (relationshipType);
Check.IdIsValid (id);
if (id == null)
id = NextId ();
if (Relationships.ContainsKey (id))
throw new XmlException ("A relationship with this ID already exists");
PackageRelationship r = new PackageRelationship (id, Package, relationshipType, Uri, targetMode, targetUri);
Relationships.Add (r.Id, r);
if (!loading)
WriteRelationships ();
return r;
}
开发者ID:rabink,项目名称:mono,代码行数:20,代码来源:PackagePart.cs
注:本文中的TargetMode类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论