本文整理汇总了C#中Tool类的典型用法代码示例。如果您正苦于以下问题:C# Tool类的具体用法?C# Tool怎么用?C# Tool使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
Tool类属于命名空间,在下文中一共展示了Tool类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C#代码示例。
示例1: OnInteraction
public void OnInteraction( Tool tool )
{
if( tool.GetType() == typeof(HandTool) )
{
Talk( tool.transform.root.gameObject );
}
}
开发者ID:LogicalDragonGames,项目名称:Star_Bloom,代码行数:7,代码来源:NPC.cs
示例2: Init
public void Init()
{
player1Observer = new MockObserver("Player1 Observer");
fullPlayerObserver = new MockObserver("FullPlayer Observer");
player1InventoryObserver = new MockObserver("Player 1 Inventory Observer");
fullPlayerInventoryObserver = new MockObserver("FullPlayer Inventory Observer");
player1 = new Player ("Player1", Gender.FEMALE, "Eve2", new Vector2 (0, 0));
player1.AddObserver(player1Observer);
fullPlayer = new Player ("Ollie", Gender.MALE, "Evan1", Vector2.zero);
fullPlayer.InitialiseInventory (20);
fullPlayer.AddObserver(fullPlayerObserver);
fullPlayer.Inventory.AddObserver(fullPlayerInventoryObserver);
for (int i = 0; i < 20; i++) {
InventoryItem item = new InventoryItem();
item.ItemName = "Item" + i;
item.ItemId = i;
item.ItemType = ItemType.RUBBISH;
item.ItemDescription = string.Empty;
fullPlayer.AddItem(item);
}
tool1 = new MockTool("Tool1");
tool2 = new MockTool("Tool2");
tool3 = new MockTool("Tool3");
fullPlayer.AddTool(tool1);
fullPlayer.AddTool(tool2);
fullPlayer.AddTool(tool3);
}
开发者ID:ocoulson,项目名称:MScProjectUnity,代码行数:32,代码来源:PlayerTest.cs
示例3: ChangeTool
void ChangeTool( GameObject obj )
{
if( null == obj )
{
Debug.Log( "Cannot change tool to null object" );
return;
}
if( obj == m_EquippedTool )
{
Debug.Log( "Cannot change to tool - this tool is currently equipped" );
return;
}
Tool nextTool = GetToolScript( obj );
if( null == nextTool )
{
Debug.Log( "Cannot locate tool script on object" );
return;
}
m_PreviousTool = m_EquippedTool;
m_PreviousToolScript = m_EquippedToolScript;
m_EquippedTool = obj;
m_EquippedToolScript = nextTool;
m_EquippedToolScript.Attach();
if( m_PreviousToolScript )
m_PreviousToolScript.Detach();
}
开发者ID:LogicalDragonGames,项目名称:Star_Bloom,代码行数:31,代码来源:ToolFramework.cs
示例4: OnEnable
void OnEnable() {
if (paintButTexOn==null) paintButTexOn=AssetDatabase.LoadAssetAtPath("Assets/ReliefPack/Editor/ReliefTerrain/icons/icoPaintOn.png", typeof(Texture)) as Texture;
if (paintButTexOff==null) paintButTexOff=AssetDatabase.LoadAssetAtPath("Assets/ReliefPack/Editor/ReliefTerrain/icons/icoPaintOff.png", typeof(Texture)) as Texture;
prev_tool=UnityEditor.Tools.current;
GeometryVsTerrainBlend _target=(GeometryVsTerrainBlend)target;
if (_target.orig_mesh==null) {
MeshFilter mf=_target.GetComponent(typeof(MeshFilter)) as MeshFilter;
//if (AssetDatabase.GetAssetPath(mf.sharedMesh)!="") {
_target.orig_mesh = mf.sharedMesh;
//}
}
if (!_target.blendedObject) {
MeshFilter mf=_target.GetComponent(typeof(MeshFilter)) as MeshFilter;
RaycastHit[] hits;
hits=Physics.RaycastAll(_target.transform.position+_target.transform.up*20, -_target.transform.up, 100);
int o;
for(o=0; o<hits.Length; o++) {
bool ReliefTerrainBlended=hits[o].collider.gameObject.GetComponent(typeof(ReliefTerrain))!=null;
bool VoxelTerrainBlended=hits[o].collider.gameObject.GetComponent(typeof(ReliefTerrainVertexBlendTriplanar))!=null;
if (ReliefTerrainBlended || VoxelTerrainBlended) {
_target.VoxelBlendedObject=VoxelTerrainBlended;
_target.blendedObject=hits[o].collider.gameObject;
CheckShaderForBlendCapability();
_target.MakeMeshCopy();
_target.pmesh=mf.sharedMesh;
EditorUtility.SetDirty(target);
SceneView.RepaintAll();
break;
}
}
}
}
开发者ID:Quantarium-Studios,项目名称:FLARE_Prototype,代码行数:34,代码来源:GeometryVsTerrainBlendEditor.cs
示例5: OnEnable
//Tool manipulation is a way to prevent the transform handles from appearing
void OnEnable()
{
generatedMesh = target as MeshGen2D;
lastTool = Tools.current;
Tools.current = Tool.None;
}
开发者ID:matski53,项目名称:2DPolyGen,代码行数:8,代码来源:MeshGen2DEditor.cs
示例6: Convert
/// <summary>
/// Interface implementation that takes a Static Driver Verifier log stream and converts
/// its data to a SARIF json stream. Read in Static Driver Verifier data from an input
/// stream and write Result objects.
/// </summary>
/// <param name="input">Stream of a Static Driver Verifier log</param>
/// <param name="output">SARIF json stream of the converted Static Driver Verifier log</param>
public override void Convert(Stream input, IResultLogWriter output)
{
if (input == null)
{
throw new ArgumentNullException(nameof(input));
}
if (output == null)
{
throw new ArgumentNullException(nameof(output));
}
Result result = ProcessSdvDefectStream(input);
var results = new Result[] { result };
var tool = new Tool
{
Name = "StaticDriverVerifier",
};
var fileInfoFactory = new FileInfoFactory(null);
Dictionary<string, FileData> fileDictionary = fileInfoFactory.Create(results);
output.Initialize(id: null, correlationId: null);
output.WriteTool(tool);
if (fileDictionary != null && fileDictionary.Count > 0) { output.WriteFiles(fileDictionary); }
output.OpenResults();
output.WriteResults(results);
output.CloseResults();
}
开发者ID:Microsoft,项目名称:sarif-sdk,代码行数:39,代码来源:StaticDriverVerifierConverter.cs
示例7: OnInteraction
public override void OnInteraction(Tool tool)
{
if (tool is Hand)
{
numpad.OnNumPadButtonPressed(number);
}
}
开发者ID:somaVR6,项目名称:DefuseOrDie,代码行数:7,代码来源:NumPadButton.cs
示例8: PanTool
public PanTool(Level pointer, Tool prevTool, Point startPoint)
: base(pointer)
{
this.pointer = pointer;
this.prevTool = prevTool;
this.startPoint = startPoint;
}
开发者ID:gamemaker19,项目名称:StickShooterLevelEditor,代码行数:7,代码来源:PanTool.cs
示例9: Convert
/// <summary>
/// Converts a Semmle log file in CSV format to a SARIF log file.
/// </summary>
/// <param name="input">
/// Input stream from which to read the Semmle log.
/// </param>
/// <param name="output">
/// Output string to which to write the SARIF log.
/// </param>
/// <exception cref="ArgumentNullException">
/// Thrown when one or more required arguments are null.
/// </exception>
public override void Convert(Stream input, IResultLogWriter output)
{
if (input == null)
{
throw new ArgumentNullException(nameof(input));
}
if (output == null)
{
throw new ArgumentNullException(nameof(output));
}
_toolNotifications = new List<Notification>();
var results = GetResultsFromStream(input);
var tool = new Tool
{
Name = "Semmle"
};
output.Initialize(id: null, correlationId: null);
output.WriteTool(tool);
output.OpenResults();
output.WriteResults(results);
output.CloseResults();
if (_toolNotifications.Any())
{
output.WriteToolNotifications(_toolNotifications);
}
}
开发者ID:Microsoft,项目名称:sarif-sdk,代码行数:46,代码来源:SemmleConverter.cs
示例10: HashPassword
public string HashPassword(Tool tor, string password)
{
var process = new Process
{
StartInfo =
{
FileName = tor.ExecutablePath,
Arguments = $"--hash-password {password}",
RedirectStandardOutput = true,
UseShellExecute = false
}
};
var sb = new StringBuilder();
process.OutputDataReceived += (sender, args) => sb.AppendLine(args.Data);
process.Start();
process.BeginOutputReadLine();
process.WaitForExit();
return sb
.ToString()
.Split('\n')
.Select(l => l.Trim())
.Last(l => l.Length > 0);
}
开发者ID:ramedey,项目名称:TorSharp,代码行数:26,代码来源:TorPasswordHasher.cs
示例11: OnInteraction
public override void OnInteraction(Tool tool)
{
if (tool is Hand)
{
rgbMachine.OnRGBButtonPressed(rgbValue);
}
}
开发者ID:somaVR6,项目名称:DefuseOrDie,代码行数:7,代码来源:RGBButton.cs
示例12: SetToolBlock
/// <summary>
/// Sets the tool to block with a specific block
/// </summary>
/// <param name="name">Name of block</param>
public void SetToolBlock(string name) {
tool = Tool.Block;
BlockCursor.SetBlock(new Block[,,] { { { BlockManager.GetBlock(name) } } });
BlockCursor.offset = Vector3.zero;
VRCursor.SetBlock(new Block[,,] { { { BlockManager.GetBlock(name) } } });
}
开发者ID:platformed,项目名称:Platformed-Game,代码行数:11,代码来源:DesignManager.cs
示例13: SolveInstance
protected override void SolveInstance(IGH_DataAccess DA)
{
string name = null;
GH_Plane tcp = null;
double weight = 0;
GH_Mesh mesh = null;
GH_Point centroid = null;
List<GH_Plane> planes = new List<GH_Plane>();
if (!DA.GetData(0, ref name)) { return; }
if (!DA.GetData(1, ref tcp)) { return; }
DA.GetDataList(2, planes);
if (!DA.GetData(3, ref weight)) { return; }
DA.GetData(4, ref centroid);
DA.GetData(5, ref mesh);
var tool = new Tool(tcp.Value, name, weight, centroid?.Value, mesh?.Value);
if (planes.Count > 0)
{
if (planes.Count != 4)
this.AddRuntimeMessage(GH_RuntimeMessageLevel.Error, " Calibration input must be 4 planes");
else
tool.FourPointCalibration(planes[0].Value, planes[1].Value, planes[2].Value, planes[3].Value);
}
DA.SetData(0, new GH_Tool(tool));
DA.SetData(1, tool.Tcp);
}
开发者ID:visose,项目名称:Robots,代码行数:29,代码来源:Machine.cs
示例14: IsToolSupported
/// <summary>
/// Returns true if this adorner provider supports the tool passed in.
/// By default this returns true for SelectionTool.
/// </summary>
/// <param name="tool">Tool to be checked.</param>
/// <returns>true if the tool passed in is supported.</returns>
public override bool IsToolSupported(Tool tool)
{
if (tool is SelectionTool || tool is CreationTool)
{
return true;
}
return false;
}
开发者ID:kvervo,项目名称:HorizontalLoopingSelector,代码行数:14,代码来源:TabItemAdornerProvider.cs
示例15: OnInteraction
void OnInteraction( Tool tool )
{
Console.Instance.addGameChatMessage( "Saving..." );
if( tool.GetType() == typeof( HandTool ) )
{
}
}
开发者ID:LogicalDragonGames,项目名称:Star_Bloom,代码行数:8,代码来源:Diary.cs
示例16: ToolTab
public ToolTab(Tool tool, AnchorStyles anchor, Orientation orientation)
{
if(tool == null) throw new ArgumentNullException("tool");
_tool = tool;
_anchor = anchor;
_orientation = orientation;
}
开发者ID:Kuzq,项目名称:gitter,代码行数:8,代码来源:ToolTab.cs
示例17: OnInteraction
public override void OnInteraction(Tool tool)
{
if (tool is ScrewDriver)
{
this.Defuse();
StartCoroutine(RemoveScrew());
}
}
开发者ID:somaVR6,项目名称:DefuseOrDie,代码行数:8,代码来源:Screw.cs
示例18: ResetToolSelection
private void ResetToolSelection( Tool tool ) {
if( tool != Tool.Select )
ChkArrow.Checked = false;
if( tool != Tool.Fill )
ChkFill.Checked = false;
if( tool != Tool.Unfill )
ChkBordering.Checked = false;
}
开发者ID:GodLesZ,项目名称:svn-dump,代码行数:8,代码来源:PaintTools.cs
示例19: CollectMaterial
public void CollectMaterial(CollectionMethod method, Tool tool)
{
var parameter = new Dictionary<byte, object> {
{ (byte)CollectMaterialParameterItem.CollectiontMethod, method},
{ (byte)CollectMaterialParameterItem.ToolID, (tool == null) ? ItemID.No : tool.id}
};
peer.OpCustom((byte)OperationType.CollectMaterial, parameter, true, 0, true);
}
开发者ID:DSobscure,项目名称:Resource-Emperor,代码行数:9,代码来源:PhotonServiceActions.cs
示例20: OnInteraction
public override void OnInteraction(Tool tool)
{
if ( tool is Hand)
{
this.Defuse();
StartCoroutine(MoveLever());
switchInner.SetLeverState(this.gameObject.name, leverUp);
}
}
开发者ID:somaVR6,项目名称:DefuseOrDie,代码行数:9,代码来源:Lever.cs
注:本文中的Tool类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论