示例#1
0
 public override System.CodeDom.CodeExpression GCode_CodeDom_GetValue(CodeGenerateSystem.Base.LinkPinControl element, CodeGenerateSystem.Base.GenerateCodeContext_Method context, CodeGenerateSystem.Base.GenerateCodeContext_PreNode preNodeContext = null)
 {
     return(new System.CodeDom.CodeSnippetExpression("System.Math.Sin((System.DateTime.Now.Millisecond*0.001)*2*System.Math.PI)"));
 }
示例#2
0
 public override System.CodeDom.CodeExpression GCode_CodeDom_GetValue(CodeGenerateSystem.Base.LinkPinControl element, CodeGenerateSystem.Base.GenerateCodeContext_Method context, CodeGenerateSystem.Base.GenerateCodeContext_PreNode preNodeContext = null)
 {
     return(null);
 }
示例#3
0
        public override CodeExpression GCode_CodeDom_GetValue(CodeGenerateSystem.Base.LinkPinControl element, CodeGenerateSystem.Base.GenerateCodeContext_Method context, CodeGenerateSystem.Base.GenerateCodeContext_PreNode preNodeContext = null)
        {
            string current = "";

            if (preNodeContext?.NeedDereferencePoint == true && ElementType.IsPointer)
            {
                current = $"(*current_{EngineNS.Editor.Assist.GetValuedGUIDString(this.Id)})";
            }
            else
            {
                current = "current_" + EngineNS.Editor.Assist.GetValuedGUIDString(this.Id);
            }
            if (element == mCtrlArrayElement)
            {
                return(new CodeSnippetExpression(current));
            }
            else if (element == mCtrlArrayIndex)
            {
                return(new CodeSnippetExpression($"index_{EngineNS.Editor.Assist.GetValuedGUIDString(this.Id)}"));
            }
            else if (element == mCtrlDicKey)
            {
                current += ".Key";
                return(new CodeSnippetExpression(current));
            }
            else if (element == mCtrlDicValue)
            {
                current += ".Value";
                return(new CodeSnippetExpression(current));
            }
            return(base.GCode_CodeDom_GetValue(element, context));
        }
示例#4
0
        public override CodeExpression GCode_CodeDom_GetValue(CodeGenerateSystem.Base.LinkPinControl element, CodeGenerateSystem.Base.GenerateCodeContext_Method context, CodeGenerateSystem.Base.GenerateCodeContext_PreNode preNodeContext = null)
        {
            if (element == mCtrlvalue_VectorOut)
            {
                return(new System.CodeDom.CodeVariableReferenceExpression(GCode_GetValueName(null, context)));
            }
            else
            {
                foreach (var data in mLinkOutDic)
                {
                    if (data.Element == element)
                    {
                        return(new System.CodeDom.CodeVariableReferenceExpression(GCode_GetValueName(null, context) + "." + data.KeyName));
                    }
                }
            }

            return(base.GCode_CodeDom_GetValue(element, context));
        }
示例#5
0
 public override System.CodeDom.CodeExpression GCode_CodeDom_GetValue(CodeGenerateSystem.Base.LinkPinControl element, CodeGenerateSystem.Base.GenerateCodeContext_Method context, CodeGenerateSystem.Base.GenerateCodeContext_PreNode preNodeContext = null)
 {
     return(new CodeMethodInvokeExpression(new CodeMethodReferenceExpression(new CodeThisReferenceExpression(), "GetAnimationSequenceRemainingTime"), new CodeExpression[] { new CodePrimitiveExpression(context.AnimStateMachineReferenceExpression.VariableName), new CodePrimitiveExpression(context.AminStateReferenceExpression.VariableName), new CodePrimitiveExpression(NodeName) }));
 }
示例#6
0
        public override System.CodeDom.CodeExpression GCode_CodeDom_GetValue(CodeGenerateSystem.Base.LinkPinControl element, CodeGenerateSystem.Base.GenerateCodeContext_Method context, CodeGenerateSystem.Base.GenerateCodeContext_PreNode preNodeContext = null)
        {
            var param = CSParam as AnimationTimeRemainingConstructionParams;

            return(new CodeGenerateSystem.CodeDom.CodeMethodInvokeExpression(new CodeMethodReferenceExpression(new CodeThisReferenceExpression(), "GetAnimationSequenceRemainingTime"), new CodeExpression[] { new CodePrimitiveExpression(context.AnimStateMachineReferenceExpression.VariableName), new CodePrimitiveExpression(param.AnimAsset.AnimAssetLocationName), new CodePrimitiveExpression(param.AnimAsset.AnimAssetName) }));
        }
示例#7
0
        public override System.CodeDom.CodeExpression GCode_CodeDom_GetValue(CodeGenerateSystem.Base.LinkPinControl element, CodeGenerateSystem.Base.GenerateCodeContext_Method context, CodeGenerateSystem.Base.GenerateCodeContext_PreNode preNodeContext = null)
        {
            var param = CSParam as CommonValueConstructionParams;

            if (param == null)
            {
                throw new InvalidOperationException();
            }

            if (element == mCtrlValueLinkHandle)
            {
                if (param.IsCommon)
                {
#warning 通用数值处理
                    throw new InvalidOperationException();
                }
                else if (param.ValueType == typeof(string))
                {
                    return(new System.CodeDom.CodePrimitiveExpression(param.Value));
                }
                else if (param.ValueType == typeof(bool))
                {
                    return(new System.CodeDom.CodePrimitiveExpression(System.Convert.ToBoolean(param.Value)));
                }
                else if (param.ValueType == typeof(SByte))
                {
                    return(new System.CodeDom.CodePrimitiveExpression(System.Convert.ToSByte(param.Value)));
                }
                else if (param.ValueType == typeof(Int16))
                {
                    return(new System.CodeDom.CodePrimitiveExpression(System.Convert.ToInt16(param.Value)));
                }
                else if (param.ValueType == typeof(Int32))
                {
                    return(new System.CodeDom.CodePrimitiveExpression(System.Convert.ToInt32(param.Value)));
                }
                else if (param.ValueType == typeof(Int64))
                {
                    return(new System.CodeDom.CodePrimitiveExpression(System.Convert.ToInt64(param.Value)));
                }
                else if (param.ValueType == typeof(Byte))
                {
                    return(new System.CodeDom.CodePrimitiveExpression(System.Convert.ToByte(param.Value)));
                }
                else if (param.ValueType == typeof(UInt16))
                {
                    return(new System.CodeDom.CodePrimitiveExpression(System.Convert.ToUInt16(param.Value)));
                }
                else if (param.ValueType == typeof(UInt32))
                {
                    return(new System.CodeDom.CodePrimitiveExpression(System.Convert.ToUInt32(param.Value)));
                }
                else if (param.ValueType == typeof(UInt64))
                {
                    return(new System.CodeDom.CodePrimitiveExpression(System.Convert.ToUInt64(param.Value)));
                }
                else if (param.ValueType == typeof(Single))
                {
                    return(new System.CodeDom.CodePrimitiveExpression(System.Convert.ToSingle(param.Value)));
                }
                else if (param.ValueType == typeof(Double))
                {
                    return(new System.CodeDom.CodePrimitiveExpression(System.Convert.ToDouble(param.Value)));
                }
            }
            else
            {
                return(new System.CodeDom.CodeVariableReferenceExpression(GCode_GetValueName(element, context)));
            }

            return(base.GCode_CodeDom_GetValue(element, context));
        }