本文整理汇总了C#中Action.DrawOutWires方法的典型用法代码示例。如果您正苦于以下问题:C# Action.DrawOutWires方法的具体用法?C# Action.DrawOutWires怎么用?C# Action.DrawOutWires使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Action
的用法示例。
在下文中一共展示了Action.DrawOutWires方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: DrawSockets
private void DrawSockets(Action action, bool isAsset)
{
List<Action> actionList = new List<Action>();
if (isAsset)
{
actionList = windowData.targetAsset.actions;
}
else
{
actionList = windowData.target.actions;
}
int i = actionList.IndexOf (action);
Event e = Event.current;
if (action.numSockets == 0)
{
return;
}
if (!action.isDisplayed && (action is ActionCheck || action is ActionCheckMultiple || action is ActionParallel))
{
action.DrawOutWires (actionList, i, 0);
return;
}
int offset = 0;
if (action is ActionCheck)
{
ActionCheck actionCheck = (ActionCheck) action;
if (actionCheck.resultActionFail != ResultAction.RunCutscene)
{
Rect buttonRect = new Rect (action.nodeRect.x + action.nodeRect.width - 2, action.nodeRect.y - 22 + action.nodeRect.height, 16, 16);
if (e.isMouse && actionChanging == null && e.type == EventType.MouseDown && action.isEnabled && buttonRect.Contains(e.mousePosition))
{
offsetChanging = 10;
resultType = false;
actionChanging = action;
}
GUI.Button (buttonRect, "", nodeSkin.customStyles[10]);
if (actionCheck.resultActionFail == ResultAction.Skip)
{
offset = 17;
}
}
if (actionCheck.resultActionTrue != ResultAction.RunCutscene)
{
Rect buttonRect = new Rect (action.nodeRect.x + action.nodeRect.width - 2, action.nodeRect.y - 40 - offset + action.nodeRect.height, 16, 16);
if (e.isMouse && actionChanging == null && e.type == EventType.MouseDown && action.isEnabled && buttonRect.Contains(e.mousePosition))
{
offsetChanging = 30 + offset;
resultType = true;
actionChanging = action;
}
GUI.Button (buttonRect, "", nodeSkin.customStyles[10]);
}
}
else if (action is ActionCheckMultiple)
{
ActionCheckMultiple actionCheckMultiple = (ActionCheckMultiple) action;
int totalHeight = 20;
for (int j = actionCheckMultiple.endings.Count-1; j>=0; j--)
{
ActionEnd ending = actionCheckMultiple.endings [j];
if (ending.resultAction != ResultAction.RunCutscene)
{
Rect buttonRect = new Rect (action.nodeRect.x + action.nodeRect.width - 2,
action.nodeRect.y + action.nodeRect.height
- totalHeight,
16, 16);
if (e.isMouse && actionChanging == null && e.type == EventType.MouseDown && action.isEnabled && buttonRect.Contains(e.mousePosition))
{
offsetChanging = totalHeight - 10;
multipleResultType = actionCheckMultiple.endings.IndexOf (ending);
actionChanging = action;
}
GUI.Button (buttonRect, "", nodeSkin.customStyles[10]);
}
if (ending.resultAction == ResultAction.Skip)
{
totalHeight += 44;
}
else
{
totalHeight += 26;
}
}
}
else if (action is ActionParallel)
//.........这里部分代码省略.........
示例2: DrawSockets
//.........这里部分代码省略.........
{
Rect buttonRect = new Rect (action.nodeRect.x + action.nodeRect.width, action.nodeRect.y - 22 + action.nodeRect.height, 20, 20);
if (e.isMouse && actionChanging == null && e.type == EventType.MouseDown && action.isEnabled && buttonRect.Contains(e.mousePosition))
{
offsetChanging = 10;
resultType = false;
actionChanging = action;
}
if (actionChanging == null && action.isEnabled && buttonRect.Contains (e.mousePosition))
{
GUI.Button (buttonRect, socketIn, "Label");
}
else
{
GUI.Button (buttonRect, socketOut, "Label");
}
if (actionCheck.resultActionFail == ResultAction.Skip)
{
offset = 17;
}
}
if (actionCheck.resultActionTrue != ResultAction.RunCutscene)
{
Rect buttonRect = new Rect (action.nodeRect.x + action.nodeRect.width, action.nodeRect.y - 40 - offset + action.nodeRect.height, 20, 20);
if (e.isMouse && actionChanging == null && e.type == EventType.MouseDown && action.isEnabled && buttonRect.Contains(e.mousePosition))
{
offsetChanging = 30 + offset;
resultType = true;
actionChanging = action;
}
if (actionChanging == null && action.isEnabled && buttonRect.Contains (e.mousePosition))
{
GUI.Button (buttonRect, socketIn, "Label");
}
else
{
GUI.Button (buttonRect, socketOut, "Label");
}
}
}
else if (action is ActionCheckMultiple)
{
ActionCheckMultiple actionCheckMultiple = (ActionCheckMultiple) action;
foreach (ActionEnd ending in actionCheckMultiple.endings)
{
int j = actionCheckMultiple.endings.IndexOf (ending);
if (ending.resultAction != ResultAction.RunCutscene)
{
Rect buttonRect = new Rect (action.nodeRect.x + action.nodeRect.width, action.nodeRect.y + (j * 43) - (actionCheckMultiple.endings.Count * 43) + action.nodeRect.height, 20, 20);
if (e.isMouse && actionChanging == null && e.type == EventType.MouseDown && action.isEnabled && buttonRect.Contains(e.mousePosition))
{
offsetChanging = (actionCheckMultiple.endings.Count - j) * 43 - 13;
multipleResultType = actionCheckMultiple.endings.IndexOf (ending);
actionChanging = action;
}
if (actionChanging == null && action.isEnabled && buttonRect.Contains (e.mousePosition))
{
GUI.Button (buttonRect, socketIn, "Label");
}
else
{
GUI.Button (buttonRect, socketOut, "Label");
}
}
}
}
else
{
if (action.endAction != ResultAction.RunCutscene)
{
Rect buttonRect = new Rect (action.nodeRect.x + action.nodeRect.width, action.nodeRect.y - 22 + action.nodeRect.height, 20, 20);
if (e.isMouse && actionChanging == null && e.type == EventType.MouseDown && action.isEnabled && buttonRect.Contains(e.mousePosition))
{
offsetChanging = 10;
actionChanging = action;
}
if (actionChanging == null && action.isEnabled && buttonRect.Contains (e.mousePosition))
{
GUI.Button (buttonRect, socketIn, "Label");
}
else
{
GUI.Button (buttonRect, socketOut, "Label");
}
}
}
action.DrawOutWires (actionList, i, offset);
}