コード例 #1
0
ファイル: FunctionNode.cs プロジェクト: EGSP/Flappy-Bird
        void OutputPortSwitchRestriction(WirePort port)
        {
            switch (port.DataType)
            {
            case WirePortDataType.OBJECT:
                break;

            case WirePortDataType.FLOAT:
            case WirePortDataType.FLOAT2:
            case WirePortDataType.FLOAT3:
            case WirePortDataType.FLOAT4:
            case WirePortDataType.COLOR:
            case WirePortDataType.INT:
            case WirePortDataType.FLOAT3x3:
            case WirePortDataType.FLOAT4x4:
            {
                port.AddPortForbiddenTypes(WirePortDataType.SAMPLER1D, WirePortDataType.SAMPLER2D, WirePortDataType.SAMPLER3D, WirePortDataType.SAMPLERCUBE);
            }
            break;

            case WirePortDataType.SAMPLER1D:
            case WirePortDataType.SAMPLER2D:
            case WirePortDataType.SAMPLER3D:
            case WirePortDataType.SAMPLERCUBE:
            {
                port.CreatePortRestrictions(WirePortDataType.SAMPLER1D, WirePortDataType.SAMPLER2D, WirePortDataType.SAMPLER3D, WirePortDataType.SAMPLERCUBE, WirePortDataType.OBJECT);
            }
            break;

            default:
                break;
            }
        }
コード例 #2
0
		void InputPortSwitchRestriction( WirePort port )
		{
			switch( port.DataType )
			{
				case WirePortDataType.OBJECT:
				break;
				case WirePortDataType.FLOAT:
				case WirePortDataType.FLOAT2:
				case WirePortDataType.FLOAT3:
				case WirePortDataType.FLOAT4:
				case WirePortDataType.COLOR:
				case WirePortDataType.INT:
				{
					port.CreatePortRestrictions( WirePortDataType.FLOAT, WirePortDataType.FLOAT2, WirePortDataType.FLOAT3, WirePortDataType.FLOAT4, WirePortDataType.COLOR, WirePortDataType.INT, WirePortDataType.OBJECT );
				}
				break;
				case WirePortDataType.FLOAT3x3:
				case WirePortDataType.FLOAT4x4:
				{
					port.CreatePortRestrictions( WirePortDataType.FLOAT3x3, WirePortDataType.FLOAT4x4, WirePortDataType.OBJECT );
				}
				break;
				case WirePortDataType.SAMPLER1D:
				case WirePortDataType.SAMPLER2D:
				case WirePortDataType.SAMPLER3D:
				case WirePortDataType.SAMPLERCUBE:
				{
					port.CreatePortRestrictions( WirePortDataType.SAMPLER1D, WirePortDataType.SAMPLER2D, WirePortDataType.SAMPLER3D, WirePortDataType.SAMPLERCUBE, WirePortDataType.OBJECT );
				}
				break;
				default:
				break;
			}
		}
コード例 #3
0
 public void ActivateSnap(Vector2 position, WirePort port)
 {
     SnapPort.SetReference(port);
     SnapEnabled  = true;
     SnapPosition = position;
 }
コード例 #4
0
 public void SetReference(WirePort port)
 {
     m_nodeId   = port.NodeId;
     m_portId   = port.PortId;
     m_dataType = port.DataType;
 }