static void Compute_CallFunctionNode(ActionNode actionNode, Rect placeRect, bool isActive, bool haveWarning, bool haveError) { CallFunctionNode runFunctionNode = (CallFunctionNode)actionNode; string typeName = "call "; int tmpCommentIndex = 120; string detailsText = runFunctionNode.FunctionToRun != null ? (runFunctionNode.FunctionToRun.FunctionName.Length > 30 ? runFunctionNode.FunctionToRun.FunctionName.Substring(0, 30) + "..." : runFunctionNode.FunctionToRun.FunctionName + "()") : "null"; #region show stuff ShowInformations_DefultStyle(actionNode, isActive, haveWarning, haveError, typeName, detailsText, placeRect, tmpCommentIndex, COLOR_SpacialNode); #endregion }
static string GetGameObjectNameFromUnityEventTarget(ActionNode actionNode, Object eventTarget) { if (eventTarget == null) { return(""); } string gameObjectName = eventTarget.name; bool checkTargetIsThisNode = false;// Show excute node and that target are the same. if (eventTarget is MonoBehaviour) { if (((MonoBehaviour)eventTarget).gameObject.Equals(actionNode.gameObject)) { checkTargetIsThisNode = true; } } else if (eventTarget is Component) { if (((Component)eventTarget).gameObject.Equals(actionNode.gameObject)) { checkTargetIsThisNode = true; } } else if (eventTarget is GameObject) { if (((GameObject)eventTarget).gameObject.Equals(actionNode.gameObject)) { checkTargetIsThisNode = true; } } if (checkTargetIsThisNode)// Check excute node and that target are the same or not. { gameObjectName = "*"; } return(gameObjectName); }
static void ShowInformations_DefultStyle(ActionNode actionNode, bool isActive, bool haveWarning, bool haveError, string typeName, string detailsText, Rect placeRect, int tmpCommentIndex, Color color = default(Color)) { // set Name SetNodeName(actionNode, typeName, detailsText, isActive); // show head and highlight Color highlightColor = color; if (color != default(Color)) { highlightColor = ChangeAlphaColor(color, 0.2f); } ShowHeaders(actionNode, isActive, haveWarning, haveError, placeRect, color); ShowHighlights(actionNode, isActive, haveWarning, haveError, placeRect, highlightColor); // show comment if (!actionNode.GetComponentInParent <FunctionNode>().HideComments&& !string.IsNullOrEmpty(actionNode.Comment)) { ShowComment(actionNode, detailsText.ToCharArray().Length, isActive, placeRect, tmpCommentIndex); } // show icon ShowIcons(actionNode, isActive, haveWarning, haveError, placeRect, color); }
public void ExcuteScript(ActionNode sender) { print(str); print(sender.gameObject.name); }
static bool IsRuntime(ActionNode actionNode) { return(!((actionNode.IsDone && actionNode.IsDetected) || (!actionNode.IsDetected && !actionNode.IsDone))); }
static Texture2D GetTexture2DFromActionNode(ActionNode actionNode) { Texture2D tmpTexture = AssetDatabase.LoadAssetAtPath("Assets/PashmakCore/Sprites/circle_One.png", typeof(Texture2D)) as Texture2D; return(tmpTexture); }