コード例 #1
0
    //Executes the blueprint node compare strings instance
    public override void Execute()
    {
        //If dependent attribute connections are valid
        if (connections[2].connectionNodeID > -1 && connections[3].connectionNodeID > -1)
        {
            //Depending on the mode
            switch (mode)
            {
            //a == b
            case 0:
            {
                //Set the result to the condition result of if attribute a is equal to attribute b
                result = (string)BlueprintInstanceManager.GetBlueprintAt(blueprintID).GetBlueprintNodeAt(connections[2].connectionNodeID).GetAttribute() == (string)BlueprintInstanceManager.GetBlueprintAt(blueprintID).GetBlueprintNodeAt(connections[3].connectionNodeID).GetAttribute();
                break;
            }

            //a != b
            case 1:
            {
                //Set the result to the condition result of if attribute a is not equal to attribute b
                result = (string)BlueprintInstanceManager.GetBlueprintAt(blueprintID).GetBlueprintNodeAt(connections[2].connectionNodeID).GetAttribute() != (string)BlueprintInstanceManager.GetBlueprintAt(blueprintID).GetBlueprintNodeAt(connections[3].connectionNodeID).GetAttribute();
                break;
            }
            }
        }

        //Perform base initialization
        base.Execute();
    }
    //Start initializes the blueprint node event get mouse button instance
    public override void StartInitialize()
    {
        //If dependent attribute connections are valid
        if (connections[0].connectionNodeID > -1)
        {
            //Create reference to the GameObject input attribute
            GameObject gameObjectInputAttribute = (GameObject)BlueprintInstanceManager.GetBlueprintAt(blueprintID).GetBlueprintNodeAt(connections[0].connectionNodeID).GetAttribute();

            //If the GameObject input attribute is valid
            if (gameObjectInputAttribute != null)
            {
                //Create reference to the GameObject input attributes blueprint input event handler
                BlueprintInputEventHandler inputEventHandler = gameObjectInputAttribute.GetComponent <BlueprintInputEventHandler>();

                //If the collision input handler is not valid
                if (inputEventHandler == null)
                {
                    //Create blueprint input event handler for the GameObject input attribute
                    inputEventHandler = gameObjectInputAttribute.AddComponent <BlueprintInputEventHandler>();
                }

                //Setup the input event handler to call the execute function on collision enter
                inputEventHandler.onMouseOverEvent.AddListener(Execute);
            }
        }
    }
コード例 #3
0
    //Returns the blueprint node get get blueprint output attribute
    public override object GetAttribute()
    {
        //If dependent connection attributes are valid
        if (connections[0].connectionNodeID > -1 && connections[1].connectionNodeID > -1)
        {
            //Create reference to the GameObject input attribute
            GameObject gameObjectInputAttribute = (GameObject)BlueprintInstanceManager.GetBlueprintAt(blueprintID).GetBlueprintNodeAt(connections[0].connectionNodeID).GetAttribute();

            //If the GameObject input attribute is valid
            if (gameObjectInputAttribute != null)
            {
                //Create reference to the GameObject input attributes blueprint manager
                BlueprintManager blueprintManager = gameObjectInputAttribute.GetComponent <BlueprintManager>();

                //If the blueprint manager is valid
                if (blueprintManager != null)
                {
                    //Return output attribute
                    return(blueprintManager.GetBlueprintID());
                }
            }
        }

        //Return default output attribute
        return(GetDefaultOutputAttribute());
    }
コード例 #4
0
    //Called once per frame
    private void Update()
    {
        //If the blueprint is valid
        if (blueprintID > -1)
        {
            //For each blueprint node
            for (int nodeIndex = 0; nodeIndex < BlueprintInstanceManager.GetBlueprintAt(blueprintID).GetBlueprintNodeCount(); nodeIndex++)
            {
                //If the blueprint node is a event condition node
                if (BlueprintInstanceManager.GetBlueprintAt(blueprintID).GetBlueprintNodeAt(nodeIndex) as BlueprintNodeEventCondition != null)
                {
                    //If the blueprint nodes condition is being met
                    if (((BlueprintNodeEventCondition)BlueprintInstanceManager.GetBlueprintAt(blueprintID).GetBlueprintNodeAt(nodeIndex)).IsConditionMet())
                    {
                        //Execute the blueprint node
                        BlueprintInstanceManager.GetBlueprintAt(blueprintID).GetBlueprintNodeAt(nodeIndex).Execute();
                    }
                }
            }

            //For each blueprint node
            for (int nodeIndex = 0; nodeIndex < BlueprintInstanceManager.GetBlueprintAt(blueprintID).GetBlueprintNodeCount(); nodeIndex++)
            {
                //If the blueprint node is a event update node
                if (BlueprintInstanceManager.GetBlueprintAt(blueprintID).GetBlueprintNodeAt(nodeIndex) as BlueprintNodeEventUpdate != null)
                {
                    //Execute the blueprint node
                    BlueprintInstanceManager.GetBlueprintAt(blueprintID).GetBlueprintNodeAt(nodeIndex).Execute();
                }
            }
        }
    }
コード例 #5
0
    //Called on initialization
    private void Awake()
    {
        //Create blueprint
        blueprintID = BlueprintInstanceManager.CreateBlueprint(blueprintFilepath, blueprintJSON, gameObject);

        //TODO: Execute all awake events
        return;
    }
コード例 #6
0
 //Executes the blueprint node event instance
 public override void Execute()
 {
     //If the output execution connection connection node is valid
     if (outputExecutionConnection.connectionNodeID > -1)
     {
         //Execute the output execution node
         BlueprintInstanceManager.GetBlueprintAt(blueprintID).GetBlueprintNodeAt(outputExecutionConnection.connectionNodeID).Execute();
     }
 }
コード例 #7
0
 //Sets the blueprint node connections input attribute to the specified input attribute
 public override void SetAttribute(object inputAttribute)
 {
     //If the input connections connection node ID is valid
     if (connections[0].connectionNodeID > -1)
     {
         //Set the blueprint node connections input attribute to the specified input attribute
         BlueprintInstanceManager.GetBlueprintAt(blueprintID).GetBlueprintNodeAt(connections[0].connectionNodeID).SetAttribute(inputAttribute);
     }
 }
コード例 #8
0
 //Start initializes the blueprint node blueprint
 public override void StartInitialize()
 {
     //For each custom blueprint node
     for (int nodeIndex = 0; nodeIndex < BlueprintInstanceManager.GetBlueprintAt(customBlueprintID).GetBlueprintNodeCount(); nodeIndex++)
     {
         //Start initialize the blueprint node
         BlueprintInstanceManager.GetBlueprintAt(customBlueprintID).GetBlueprintNodeAt(nodeIndex).StartInitialize();
     }
 }
コード例 #9
0
    //Called on blueprint destruction
    private void OnDestroy()
    {
        //If the blueprint is valid
        if (blueprintID > -1)
        {
            //TODO: Execute all OnDestroy events

            //Remove the blueprint from the blueprint instance manager
            BlueprintInstanceManager.RemoveBlueprint(blueprintID);
        }
    }
コード例 #10
0
    //Executes the blueprint node function look at instance
    public override void Execute()
    {
        //If dependent attribute connections are valid
        if (connections[0].connectionNodeID > -1 && connections[1].connectionNodeID > -1)
        {
            //Rotate the input attribute transform to look at the input attribute Vector3 location
            ((Transform)BlueprintInstanceManager.GetBlueprintAt(blueprintID).GetBlueprintNodeAt(connections[0].connectionNodeID).GetAttribute()).LookAt((Vector3)BlueprintInstanceManager.GetBlueprintAt(blueprintID).GetBlueprintNodeAt(connections[1].connectionNodeID).GetAttribute());
        }

        //Perform base execution
        base.Execute();
    }
    //Executes the blueprint node function instantiate instance
    public override void Execute()
    {
        //If the dependent input attribute connections are valid
        if (connections[0].connectionNodeID > -1)
        {
            //Instantiate input gameobject attribute
            gameObject = GameObject.Instantiate((GameObject)BlueprintInstanceManager.GetBlueprintAt(blueprintID).GetBlueprintNodeAt(connections[0].connectionNodeID).GetAttribute());
        }

        //Perform base execution
        base.Execute();
    }
コード例 #12
0
    //Returns the blueprint node connections output attribute
    public override object GetAttribute()
    {
        //If the input connections connection node ID is valid
        if (connections[0].connectionNodeID > -1)
        {
            //Return the input connection nodes output attribute
            return(BlueprintInstanceManager.GetBlueprintAt(blueprintID).GetBlueprintNodeAt(connections[0].connectionNodeID).GetAttribute());
        }

        //Return the default output attribute
        return(GetDefaultOutputAttribute());
    }
コード例 #13
0
    //Executes the blueprint node function log instance
    public override void Execute()
    {
        //If dependent attribute connections are valid
        if (connections[0].connectionNodeID > -1)
        {
            //Log the attribute to the console
            Debug.Log(BlueprintInstanceManager.GetBlueprintAt(blueprintID).GetBlueprintNodeAt(connections[0].connectionNodeID).GetAttribute().ToString());
        }

        //Perform base execution
        base.Execute();
    }
コード例 #14
0
    //Executes the blueprint node set set local scale instance
    public override void Execute()
    {
        //If dependent attribute connections are valid
        if (connections[0].connectionNodeID > -1)
        {
            //Set the blueprints parents Gameobjects scale to the attribute Vector3 scale
            BlueprintInstanceManager.GetBlueprintParentAt(blueprintID).transform.localScale = (Vector3)BlueprintInstanceManager.GetBlueprintAt(blueprintID).GetBlueprintNodeAt(connections[0].connectionNodeID).GetAttribute();
        }

        //Execute the output execution node
        ExecuteOutputExecutionNode();
    }
    //Executes the blueprint node function rotate instance
    public override void Execute()
    {
        //If dependent attribute connections are valid
        if (connections[0].connectionNodeID > -1)
        {
            //Rotate the blueprints parents GameObject by the Vector3 input attribute rotation
            BlueprintInstanceManager.GetBlueprintParentAt(blueprintID).transform.rotation *= (Quaternion)BlueprintInstanceManager.GetBlueprintAt(blueprintID).GetBlueprintNodeAt(connections[0].connectionNodeID).GetAttribute();
        }

        //Perform base execution
        base.Execute();
    }
コード例 #16
0
    //Executes the blueprint node set set text instance
    public override void Execute()
    {
        //If dependent attribute connections are valid
        if (connections[0].connectionNodeID > -1 && connections[1].connectionNodeID > -1)
        {
            //Set the Quaternion input attribute to the Vector3 input attribute as a Quaternion
            BlueprintInstanceManager.GetBlueprintAt(blueprintID).GetBlueprintNodeAt(connections[0].connectionNodeID).SetAttribute(Quaternion.Euler((Vector3)BlueprintInstanceManager.GetBlueprintAt(blueprintID).GetBlueprintNodeAt(connections[1].connectionNodeID).GetAttribute()));
        }

        //Execute the output execution node
        ExecuteOutputExecutionNode();
    }
    //Executes the blueprint node function load scene instance
    public override void Execute()
    {
        //If dependent attribute connections are valid
        if (connections[0].connectionNodeID > -1)
        {
            //Load the scene with matching name to the input string text
            SceneManager.LoadScene((string)BlueprintInstanceManager.GetBlueprintAt(blueprintID).GetBlueprintNodeAt(connections[0].connectionNodeID).GetAttribute());
        }

        //Perform base execution
        base.Execute();
    }
コード例 #18
0
    //Executes the blueprint node set instance
    public override void Execute()
    {
        //If dependent attribute connections are valid
        if (connections[0].connectionNodeID > -1 && connections[1].connectionNodeID > -1)
        {
            //Set the output attribute to the input attribute
            BlueprintInstanceManager.GetBlueprintAt(blueprintID).GetBlueprintNodeAt(connections[1].connectionNodeID).SetAttribute(BlueprintInstanceManager.GetBlueprintAt(blueprintID).GetBlueprintNodeAt(connections[0].connectionNodeID).GetAttribute());
        }

        //Execute the output execution node
        ExecuteOutputExecutionNode();
    }
    //Executes the blueprint node function look at instance
    public override void Execute()
    {
        //If dependent attribute connections are valid
        if (connections[0].connectionNodeID > -1)
        {
            //Rotate the blueprint parents GameObject to look at the transform input attribute
            BlueprintInstanceManager.GetBlueprintParentAt(blueprintID).transform.LookAt((Transform)BlueprintInstanceManager.GetBlueprintAt(blueprintID).GetBlueprintNodeAt(connections[0].connectionNodeID).GetAttribute());
        }

        //Perform base execution
        base.Execute();
    }
コード例 #20
0
    //Executes the blueprint node set set local rotation instance
    public override void Execute()
    {
        //If dependent attribute connections are valid
        if (connections[0].connectionNodeID > -1)
        {
            //Set the blueprints parents GameObjects local rotation to the attribute Quaternion rotation
            BlueprintInstanceManager.GetBlueprintParentAt(blueprintID).transform.localRotation = (Quaternion)BlueprintInstanceManager.GetBlueprintAt(blueprintID).GetBlueprintNodeAt(connections[0].connectionNodeID).GetAttribute();
        }

        //Execute the output execution node
        ExecuteOutputExecutionNode();
    }
コード例 #21
0
    //Returns the blueprint node get get scale local output attribute
    public override object GetAttribute()
    {
        //If dependent attribute connections are valid
        if (connections[0].connectionNodeID > -1)
        {
            //Return output attribute
            return(((Transform)BlueprintInstanceManager.GetBlueprintAt(blueprintID).GetBlueprintNodeAt(connections[0].connectionNodeID).GetAttribute()).localScale);
        }

        //Return default output attribute
        return(GetDefaultOutputAttribute());
    }
コード例 #22
0
    //Returns the blueprint node math magnitude vector4 output attribute
    public override object GetAttribute()
    {
        //If dependent attribute connections are valid
        if (connections[0].connectionNodeID > -1)
        {
            //Return output attribute
            return(Vector4.Magnitude((Vector4)BlueprintInstanceManager.GetBlueprintAt(blueprintID).GetBlueprintNodeAt(connections[0].connectionNodeID).GetAttribute()));
        }

        //Return default output attribute
        return(GetDefaultOutputAttribute());
    }
 //Executes the blueprint node event get mouse button instance
 public override void Execute()
 {
     //If the selected mouse button is being pressed
     if (Input.GetMouseButton(selectedMouseButton))
     {
         //If the output execution connection is valid
         if (outputExecutionConnection.connectionNodeID > -1)
         {
             //Execute the output execution connection node
             BlueprintInstanceManager.GetBlueprintAt(blueprintID).GetBlueprintNodeAt(outputExecutionConnection.connectionNodeID).Execute();
         }
     }
 }
コード例 #24
0
    //Returns the blueprint node math atan2 output attribute
    public override object GetAttribute()
    {
        //If dependent attribute connections are valid
        if (connections[0].connectionNodeID > -1 && connections[1].connectionNodeID > -1)
        {
            //Return output attribute
            return(Mathf.Atan2((float)BlueprintInstanceManager.GetBlueprintAt(blueprintID).GetBlueprintNodeAt(connections[0].connectionNodeID).GetAttribute(),
                               (float)BlueprintInstanceManager.GetBlueprintAt(blueprintID).GetBlueprintNodeAt(connections[1].connectionNodeID).GetAttribute()));
        }

        //Return default output attribute
        return(GetDefaultOutputAttribute());
    }
コード例 #25
0
    //Start initializes the blueprint node event on button click instance
    public override void StartInitialize()
    {
        //If dependent attribute connections are valid
        if (connections[0].connectionNodeID > -1)
        {
            //Create reference to the button input attribute
            Button buttonInputAttribute = (Button)BlueprintInstanceManager.GetBlueprintAt(blueprintID).GetBlueprintNodeAt(connections[0].connectionNodeID).GetAttribute();

            //If the button input attribute is valid
            if (buttonInputAttribute != null)
            {
                //Setup the buttons on click event to call the execute function
                buttonInputAttribute.onClick.AddListener(Execute);
            }
        }
    }
コード例 #26
0
    //Returns the blueprint node math multiply vector3 output attribute
    public override object GetAttribute()
    {
        //If dependent attribute connections are valid
        if (connections[0].connectionNodeID > -1 && connections[1].connectionNodeID > -1)
        {
            //Create references to input attributes
            Vector3 a = (Vector3)BlueprintInstanceManager.GetBlueprintAt(blueprintID).GetBlueprintNodeAt(connections[0].connectionNodeID).GetAttribute();
            Vector3 b = (Vector3)BlueprintInstanceManager.GetBlueprintAt(blueprintID).GetBlueprintNodeAt(connections[1].connectionNodeID).GetAttribute();

            //Return output attribute
            return(new Vector3(a.x * b.x, a.y * b.y, a.z * b.z));
        }

        //Return default output attribute
        return(GetDefaultOutputAttribute());
    }
コード例 #27
0
    //Executes the blueprint node function scale instance
    public override void Execute()
    {
        //If dependent attribute connections are valid
        if (connections[0].connectionNodeID > -1)
        {
            //Create reference to input attributes
            GameObject gameObject = BlueprintInstanceManager.GetBlueprintParentAt(blueprintID);
            Vector3    scale      = (Vector3)BlueprintInstanceManager.GetBlueprintAt(blueprintID).GetBlueprintNodeAt(connections[0].connectionNodeID).GetAttribute();

            //Scale the blueprints parent GameObject by the Vector3 input attribute
            gameObject.transform.localScale = new Vector3(gameObject.transform.localScale.x * scale.x, gameObject.transform.localScale.y * scale.y, gameObject.transform.localScale.z * scale.z);
        }

        //Perform base execution
        base.Execute();
    }
コード例 #28
0
//Executes the blueprint node blueprint instance
    public override void Execute()
    {
        //If the custom blueprint is valid
        if (customBlueprintID > -1)
        {
            //Create intermediary attributes
            int attributeIndex = 0;

            //For each custom blueprint node
            for (int nodeIndex = 0; nodeIndex < BlueprintInstanceManager.GetBlueprintAt(customBlueprintID).GetBlueprintNodeCount(); nodeIndex++)
            {
                //If the custom blueprint node is a variable
                if (BlueprintInstanceManager.GetBlueprintAt(customBlueprintID).GetBlueprintNodeAt(nodeIndex) as BlueprintNodeVariable != null)
                {
                    //If the connection node ID is valid for the variable
                    if (connections.Count > attributeIndex && connections[attributeIndex].connectionNodeID > -1)
                    {
                        //Set the custom blueprint nodes output attribute to the linked input attribute
                        BlueprintInstanceManager.GetBlueprintAt(customBlueprintID).GetBlueprintNodeAt(nodeIndex).SetAttribute(BlueprintInstanceManager.GetBlueprintAt(blueprintID).GetBlueprintNodeAt(connections[attributeIndex].connectionNodeID).GetAttribute());
                    }

                    //Increment the attribute index
                    attributeIndex++;
                }
            }

            //For each custom blueprint node
            for (int nodeIndex = 0; nodeIndex < BlueprintInstanceManager.GetBlueprintAt(customBlueprintID).GetBlueprintNodeCount(); nodeIndex++)
            {
                //If the custom blueprint node is an event start node
                if (BlueprintInstanceManager.GetBlueprintAt(customBlueprintID).GetBlueprintNodeAt(nodeIndex) as BlueprintNodeEventStart != null)
                {
                    //Execute the custom blueprint event start node
                    BlueprintInstanceManager.GetBlueprintAt(customBlueprintID).GetBlueprintNodeAt(nodeIndex).Execute();
                }
            }
        }

        //If the output execution connection connection node is valid
        if (outputExecutionConnection.connectionNodeID > -1)
        {
            //Execute the output execution node
            BlueprintInstanceManager.GetBlueprintAt(blueprintID).GetBlueprintNodeAt(outputExecutionConnection.connectionNodeID).Execute();
        }
    }
コード例 #29
0
    //Executes the blueprint node set set y instance
    public override void Execute()
    {
        //If dependent attribute connections are valid
        if (connections[0].connectionNodeID > -1 && connections[1].connectionNodeID > -1)
        {
            //Create a copy of the input attribute
            Vector4 inputAttribute = (Vector4)BlueprintInstanceManager.GetBlueprintAt(blueprintID).GetBlueprintNodeAt(connections[0].connectionNodeID).GetAttribute();

            //Set the y coordinate of the input attribute to the float input attribute
            inputAttribute.y = (float)BlueprintInstanceManager.GetBlueprintAt(blueprintID).GetBlueprintNodeAt(connections[1].connectionNodeID).GetAttribute();

            //Set the input attribute to the modified input attribute
            BlueprintInstanceManager.GetBlueprintAt(blueprintID).GetBlueprintNodeAt(connections[0].connectionNodeID).SetAttribute(inputAttribute);
        }

        //Execute the output execution node
        ExecuteOutputExecutionNode();
    }
    //Executes the blueprint node function translate instance
    public override void Execute()
    {
        //If dependent attribute connections are valid
        if (connections[0].connectionNodeID > -1 && connections[1].connectionNodeID > -1)
        {
            //Create reference to the transform input attribute
            Transform transformInputAttribute = BlueprintInstanceManager.GetBlueprintAt(blueprintID).GetBlueprintNodeAt(connections[0].connectionNodeID).GetAttribute() as Transform;

            //If the transform input attribute is valid
            if (transformInputAttribute != null)
            {
                //Translate the transform input attribute by the Vector3 input attribute translation
                transformInputAttribute.Translate((Vector3)BlueprintInstanceManager.GetBlueprintAt(blueprintID).GetBlueprintNodeAt(connections[1].connectionNodeID).GetAttribute());
            }
        }

        //Perform base execution
        base.Execute();
    }