예제 #1
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());
    }
 //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();
         }
     }
 }
    //Returns the blueprint node math add int 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(((int)BlueprintInstanceManager.GetBlueprintAt(blueprintID).GetBlueprintNodeAt(connections[0].connectionNodeID).GetAttribute()) +
                   ((int)BlueprintInstanceManager.GetBlueprintAt(blueprintID).GetBlueprintNodeAt(connections[1].connectionNodeID).GetAttribute()));
        }

        //Return default output attribute
        return(GetDefaultOutputAttribute());
    }
예제 #4
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());
    }
예제 #5
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();
    }
    //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);
            }
        }
    }
//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();
        }
    }
예제 #8
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();
    }
예제 #9
0
    //Executes the blueprint node set set position 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)
            {
                //Set the position of the transform input attribute to the vector3 position input attribute
                transformInputAttribute.position = (Vector3)BlueprintInstanceManager.GetBlueprintAt(blueprintID).GetBlueprintNodeAt(connections[1].connectionNodeID).GetAttribute();
            }
        }

        //Execute the output execution node
        ExecuteOutputExecutionNode();
    }
예제 #10
0
    //Executes the blueprint node set set audio clip instance
    public override void Execute()
    {
        //If dependent attribute connections are valid
        if (connections[0].connectionNodeID > -1 && connections[1].connectionNodeID > -1)
        {
            //Create reference to the audio source input attribute
            AudioSource audioSourceInputAttribute = (AudioSource)BlueprintInstanceManager.GetBlueprintAt(blueprintID).GetBlueprintNodeAt(connections[0].connectionNodeID).GetAttribute();

            //If the audio source input attribute is valid
            if (audioSourceInputAttribute != null)
            {
                //Set the audio source input attributes audio clip to the audio clip input attribute
                audioSourceInputAttribute.clip = (AudioClip)BlueprintInstanceManager.GetBlueprintAt(blueprintID).GetBlueprintNodeAt(connections[1].connectionNodeID).GetAttribute();
            }
        }

        //Execute the output execution node
        ExecuteOutputExecutionNode();
    }
예제 #11
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)
        {
            //Create reference to the text input attribute
            Text textInputAttribute = (Text)BlueprintInstanceManager.GetBlueprintAt(blueprintID).GetBlueprintNodeAt(connections[0].connectionNodeID).GetAttribute();

            //If the text input attribute is valid
            if (textInputAttribute != null)
            {
                //Set the text input attributes text value to the string input attribute
                textInputAttribute.text = (string)BlueprintInstanceManager.GetBlueprintAt(blueprintID).GetBlueprintNodeAt(connections[1].connectionNodeID).GetAttribute();
            }
        }

        //Execute the output execution node
        ExecuteOutputExecutionNode();
    }
    //Returns the blueprint node get get transform output attribute
    public override object GetAttribute()
    {
        //If dependent attribute connections are valid
        if (connections[0].connectionNodeID > -1)
        {
            //Create reference to the input attribute
            GameObject inputAttribute = BlueprintInstanceManager.GetBlueprintAt(blueprintID).GetBlueprintNodeAt(connections[0].connectionNodeID).GetAttribute() as GameObject;

            //If the input attribute is valid
            if (inputAttribute != null)
            {
                //Return output attribute
                return(inputAttribute.transform);
            }
        }

        //Return default output attribute
        return(GetDefaultOutputAttribute());
    }
    //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();
    }
예제 #14
0
	//Executes the blueprint node function play instance
	public override void Execute()
	{
		//If dependent attribute connections are valid
		if (connections[0].connectionNodeID > -1)
		{
			//Create reference to the audio source input attribute
			AudioSource audioSourceInputAttribute = (AudioSource)BlueprintInstanceManager.GetBlueprintAt(blueprintID).GetBlueprintNodeAt(connections[0].connectionNodeID).GetAttribute();

			//If the audio source input attribute is valid
			if (audioSourceInputAttribute != null)
			{
				//Play the audio source input attribute
				audioSourceInputAttribute.Play();
			}
		}

		//Perform base execution
		base.Execute();
	}
예제 #15
0
    //Executes the blueprint node set set bool instance
    public override void Execute()
    {
        //If dependent attribute connections are valid
        if (connections[0].connectionNodeID > -1 && connections[1].connectionNodeID > -1)
        {
            //Create reference to the animator input attribute
            Animator animatorInputAttribute = (Animator)BlueprintInstanceManager.GetBlueprintAt(blueprintID).GetBlueprintNodeAt(connections[0].connectionNodeID).GetAttribute();

            //If the animator input attribute is valid
            if (animatorInputAttribute != null)
            {
                //Set the animator input attribute
                animatorInputAttribute.SetBool((string)BlueprintInstanceManager.GetBlueprintAt(blueprintID).GetBlueprintNodeAt(connections[1].connectionNodeID).GetAttribute(),
                                               (bool)BlueprintInstanceManager.GetBlueprintAt(blueprintID).GetBlueprintNodeAt(connections[2].connectionNodeID).GetAttribute());
            }
        }

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

            //If the transform input attribute is valid
            if (transformInputAttribute != null)
            {
                //Scale the transform input attribute by the vector3 input attribute translation
                transformInputAttribute.localScale = new Vector3(transformInputAttribute.localScale.x * scale.x, transformInputAttribute.localScale.y * scale.y, transformInputAttribute.localScale.z * scale.z);
            }
        }

        //Perform base execution
        base.Execute();
    }
 //Executes the blueprint node compare instance
 public override void Execute()
 {
     //If the result is true
     if (result)
     {
         //If the true output execution connection is valid
         if (connections[0].connectionNodeID > -1)
         {
             //Execute the true output execution node
             BlueprintInstanceManager.GetBlueprintAt(blueprintID).GetBlueprintNodeAt(connections[0].connectionNodeID).Execute();
         }
     }
     //Otherwise
     else
     {
         //If the false output execution connection is valid
         if (connections[1].connectionNodeID > -1)
         {
             //Execute the false output execution node
             BlueprintInstanceManager.GetBlueprintAt(blueprintID).GetBlueprintNodeAt(connections[1].connectionNodeID).Execute();
         }
     }
 }
    //Called on start
    private void Start()
    {
        //If the blueprint is valid
        if (blueprintID > -1)
        {
            //For each blueprint node
            for (int nodeIndex = 0; nodeIndex < BlueprintInstanceManager.GetBlueprintAt(blueprintID).GetBlueprintNodeCount(); nodeIndex++)
            {
                //Start initialize the blueprint node
                BlueprintInstanceManager.GetBlueprintAt(blueprintID).GetBlueprintNodeAt(nodeIndex).StartInitialize();
            }

            //For each blueprint node
            for (int nodeIndex = 0; nodeIndex < BlueprintInstanceManager.GetBlueprintAt(blueprintID).GetBlueprintNodeCount(); nodeIndex++)
            {
                //If the blueprint node is a event start node
                if (BlueprintInstanceManager.GetBlueprintAt(blueprintID).GetBlueprintNodeAt(nodeIndex) as BlueprintNodeEventStart != null)
                {
                    //Execute the blueprint node
                    BlueprintInstanceManager.GetBlueprintAt(blueprintID).GetBlueprintNodeAt(nodeIndex).Execute();
                }
            }
        }
    }
    //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();
    }
예제 #20
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();
    }
예제 #21
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();
    }
    //Executes the blueprint node set set variable instance
    public override void Execute()
    {
        //If dependent attribute connections are valid
        if (connections[0].connectionNodeID > -1 && connections[1].connectionNodeID > -1 && connections[2].connectionNodeID > -1)
        {
            //Create reference to the blueprint input attribute
            Blueprint blueprintInputAttribute = BlueprintInstanceManager.GetBlueprintAt((int)BlueprintInstanceManager.GetBlueprintAt(blueprintID).GetBlueprintNodeAt(connections[0].connectionNodeID).GetAttribute());

            //If the blueprint input attribute is valid
            if (blueprintInputAttribute != null)
            {
                //Flag indicating whether the blueprint variable has been found
                bool foundBlueprintVariable = false;

                //For each node in the blueprint input attribute
                for (int nodeIndex = 0; nodeIndex < blueprintInputAttribute.GetBlueprintNodeCount(); nodeIndex++)
                {
                    //If the blueprint node is a variable
                    if (blueprintInputAttribute.GetBlueprintNodeAt(nodeIndex) as BlueprintNodeVariable != null)
                    {
                        //If the blueprint node variable has a matching variable name
                        if (((BlueprintNodeVariable)blueprintInputAttribute.GetBlueprintNodeAt(nodeIndex)).variableName == (string)BlueprintInstanceManager.GetBlueprintAt(blueprintID).GetBlueprintNodeAt(connections[1].connectionNodeID).GetAttribute())
                        {
                            //Depending on the selected type
                            switch (selectedType)
                            {
                            //Bool
                            case 0:
                            {
                                //If the blueprint node is a variable bool
                                if (blueprintInputAttribute.GetBlueprintNodeAt(nodeIndex) as BlueprintNodeVariableBool != null)
                                {
                                    //Set the found blueprint variable flag to true
                                    foundBlueprintVariable = true;
                                }

                                break;
                            }

                            //Float
                            case 1:
                            {
                                //If the blueprint node is a variable float
                                if (blueprintInputAttribute.GetBlueprintNodeAt(nodeIndex) as BlueprintNodeVariableFloat != null)
                                {
                                    //Set the found blueprint variable flag to true
                                    foundBlueprintVariable = true;
                                }

                                break;
                            }

                            //GameObject
                            case 2:
                            {
                                //If the blueprint node is a variable GameObject
                                if (blueprintInputAttribute.GetBlueprintNodeAt(nodeIndex) as BlueprintNodeVariableGameObject != null)
                                {
                                    //Set the found blueprint variable flag to true
                                    foundBlueprintVariable = true;
                                }

                                break;
                            }

                            //Int
                            case 3:
                            {
                                //If the blueprint node is a variable int
                                if (blueprintInputAttribute.GetBlueprintNodeAt(nodeIndex) as BlueprintNodeVariableInt != null)
                                {
                                    //Set the found blueprint variable flag to true
                                    foundBlueprintVariable = true;
                                }

                                break;
                            }

                            //Quaternion
                            case 4:
                            {
                                //If the blueprint node is a variable Quaternion
                                if (blueprintInputAttribute.GetBlueprintNodeAt(nodeIndex) as BlueprintNodeVariableQuaternion != null)
                                {
                                    //Set the found blueprint variable flag to true
                                    foundBlueprintVariable = true;
                                }

                                break;
                            }

                            //String
                            case 5:
                            {
                                //If the blueprint node is a variable string
                                if (blueprintInputAttribute.GetBlueprintNodeAt(nodeIndex) as BlueprintNodeVariableString != null)
                                {
                                    //Set the found blueprint variable flag to true
                                    foundBlueprintVariable = true;
                                }

                                break;
                            }

                            //Vector2
                            case 6:
                            {
                                //If the blueprint node is a variable Vector2
                                if (blueprintInputAttribute.GetBlueprintNodeAt(nodeIndex) as BlueprintNodeVariableVector2 != null)
                                {
                                    //Set the found blueprint variable flag to true
                                    foundBlueprintVariable = true;
                                }

                                break;
                            }

                            //Vector3
                            case 7:
                            {
                                //If the blueprint node is a variable Vector3
                                if (blueprintInputAttribute.GetBlueprintNodeAt(nodeIndex) as BlueprintNodeVariableVector3 != null)
                                {
                                    //Set the found blueprint variable flag to true
                                    foundBlueprintVariable = true;
                                }

                                break;
                            }

                            //Vector4
                            case 8:
                            {
                                //If the blueprint node is a variable Vector4
                                if (blueprintInputAttribute.GetBlueprintNodeAt(nodeIndex) as BlueprintNodeVariableVector4 != null)
                                {
                                    //Set the found blueprint variable flag to true
                                    foundBlueprintVariable = true;
                                }

                                break;
                            }
                            }

                            //If the blueprint variable is found
                            if (foundBlueprintVariable)
                            {
                                //Set the blueprint nodes output attribute to the input attribute
                                blueprintInputAttribute.GetBlueprintNodeAt(nodeIndex).SetAttribute(BlueprintInstanceManager.GetBlueprintAt(blueprintID).GetBlueprintNodeAt(connections[2].connectionNodeID).GetAttribute());
                                break;
                            }
                        }
                    }
                }
            }
        }

        //Execute the output execution node
        ExecuteOutputExecutionNode();
    }
예제 #23
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();
    }
예제 #24
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 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();
    }
    //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 compare float 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 more than attribute b
                result = (float)BlueprintInstanceManager.GetBlueprintAt(blueprintID).GetBlueprintNodeAt(connections[2].connectionNodeID).GetAttribute() > (float)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 less than attribute b
                result = (float)BlueprintInstanceManager.GetBlueprintAt(blueprintID).GetBlueprintNodeAt(connections[2].connectionNodeID).GetAttribute() < (float)BlueprintInstanceManager.GetBlueprintAt(blueprintID).GetBlueprintNodeAt(connections[3].connectionNodeID).GetAttribute();
                break;
            }

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

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

            //a <= b
            case 4:
            {
                //Set the result to the condition result of if attribute a is less or equal to attribute b
                result = (float)BlueprintInstanceManager.GetBlueprintAt(blueprintID).GetBlueprintNodeAt(connections[2].connectionNodeID).GetAttribute() <= (float)BlueprintInstanceManager.GetBlueprintAt(blueprintID).GetBlueprintNodeAt(connections[3].connectionNodeID).GetAttribute();
                break;
            }

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

        //Perform base execution
        base.Execute();
    }
예제 #28
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();
    }
    //Returns the blueprint node get get blueprint variable output attribute
    public override object GetAttribute()
    {
        //If dependent attribute connections are valid
        if (connections[0].connectionNodeID > -1 && connections[1].connectionNodeID > -1)
        {
            //Create reference to the blueprint input attribute
            Blueprint blueprintInputAttribute = BlueprintInstanceManager.GetBlueprintAt((int)BlueprintInstanceManager.GetBlueprintAt(blueprintID).GetBlueprintNodeAt(connections[0].connectionNodeID).GetAttribute());

            //If the blueprint input attribute is valid
            if (blueprintInputAttribute != null)
            {
                //For each node in the blueprint input attribute
                for (int nodeIndex = 0; nodeIndex < blueprintInputAttribute.GetBlueprintNodeCount(); nodeIndex++)
                {
                    //If the blueprint node is a variable
                    if (blueprintInputAttribute.GetBlueprintNodeAt(nodeIndex) as BlueprintNodeVariable != null)
                    {
                        //If the blueprint node variable has a matching variable name
                        if (((BlueprintNodeVariable)blueprintInputAttribute.GetBlueprintNodeAt(nodeIndex)).variableName == (string)BlueprintInstanceManager.GetBlueprintAt(blueprintID).GetBlueprintNodeAt(connections[1].connectionNodeID).GetAttribute())
                        {
                            //Depending on the selected type
                            switch (selectedType)
                            {
                            //Bool
                            case 0:
                            {
                                //If the blueprint node is a variable bool
                                if (blueprintInputAttribute.GetBlueprintNodeAt(nodeIndex) as BlueprintNodeVariableBool != null)
                                {
                                    //Return output attribute
                                    return(blueprintInputAttribute.GetBlueprintNodeAt(nodeIndex).GetAttribute());
                                }
                                break;
                            }

                            //Float
                            case 1:
                            {
                                //If the blueprint node is a variable float
                                if (blueprintInputAttribute.GetBlueprintNodeAt(nodeIndex) as BlueprintNodeVariableFloat != null)
                                {
                                    //Return output attribute
                                    return(blueprintInputAttribute.GetBlueprintNodeAt(nodeIndex).GetAttribute());
                                }
                                break;
                            }

                            //GameObject
                            case 2:
                            {
                                //If the blueprint node is a variable GameObject
                                if (blueprintInputAttribute.GetBlueprintNodeAt(nodeIndex) as BlueprintNodeVariableGameObject != null)
                                {
                                    //Return output attribute
                                    return(blueprintInputAttribute.GetBlueprintNodeAt(nodeIndex).GetAttribute());
                                }
                                break;
                            }

                            //Int
                            case 3:
                            {
                                //If the blueprint node is a variable int
                                if (blueprintInputAttribute.GetBlueprintNodeAt(nodeIndex) as BlueprintNodeVariableInt != null)
                                {
                                    //Return output attribute
                                    return(blueprintInputAttribute.GetBlueprintNodeAt(nodeIndex).GetAttribute());
                                }
                                break;
                            }

                            //Quaternion
                            case 4:
                            {
                                //If the blueprint node is a variable Quaternion
                                if (blueprintInputAttribute.GetBlueprintNodeAt(nodeIndex) as BlueprintNodeVariableQuaternion != null)
                                {
                                    //Return output attribute
                                    return(blueprintInputAttribute.GetBlueprintNodeAt(nodeIndex).GetAttribute());
                                }
                                break;
                            }

                            //String
                            case 5:
                            {
                                //If the blueprint node is a variable string
                                if (blueprintInputAttribute.GetBlueprintNodeAt(nodeIndex) as BlueprintNodeVariableString != null)
                                {
                                    //Return output attribute
                                    return(blueprintInputAttribute.GetBlueprintNodeAt(nodeIndex).GetAttribute());
                                }
                                break;
                            }

                            //Vector2
                            case 6:
                            {
                                //If the blueprint node is a variable Vector2
                                if (blueprintInputAttribute.GetBlueprintNodeAt(nodeIndex) as BlueprintNodeVariableVector2 != null)
                                {
                                    //Return output attribute
                                    return(blueprintInputAttribute.GetBlueprintNodeAt(nodeIndex).GetAttribute());
                                }
                                break;
                            }

                            //Vector3
                            case 7:
                            {
                                //If the blueprint node is a variable Vector3
                                if (blueprintInputAttribute.GetBlueprintNodeAt(nodeIndex) as BlueprintNodeVariableVector3 != null)
                                {
                                    //Return output attribute
                                    return(blueprintInputAttribute.GetBlueprintNodeAt(nodeIndex).GetAttribute());
                                }
                                break;
                            }

                            //Vector4
                            case 8:
                            {
                                //If the blueprint node is a variable Vector4
                                if (blueprintInputAttribute.GetBlueprintNodeAt(nodeIndex) as BlueprintNodeVariableVector4 != null)
                                {
                                    //Return output attribute
                                    return(blueprintInputAttribute.GetBlueprintNodeAt(nodeIndex).GetAttribute());
                                }
                                break;
                            }
                            }
                        }
                    }
                }
            }
        }

        //Return the default output attribute
        return(GetDefaultOutputAttribute());
    }