Example #1
0
 public virtual void WriteNativeVariableDeclarationOfType(CppCodeWriter writer, string variableName)
 {
     foreach (MarshaledType type in this.MarshaledTypes)
     {
         if (type.Name.EndsWith("*") || (type.Name == "Il2CppHString"))
         {
             object[] args = new object[] { type.Name, variableName + type.VariableName };
             writer.WriteLine("{0} {1} = NULL;", args);
         }
         else if ((this._typeRef.MetadataType == MetadataType.Class) && !this._typeRef.DerivesFromObject())
         {
             object[] objArray2 = new object[] { type.Name, variableName + type.VariableName };
             writer.WriteLine("{0} {1} = {0}();", objArray2);
         }
         else if (this._typeRef.MetadataType.IsPrimitiveType())
         {
             object[] objArray3 = new object[] { type.Name, variableName + type.VariableName, CppCodeWriter.InitializerStringForPrimitiveType(this._typeRef.MetadataType) };
             writer.WriteLine("{0} {1} = {2};", objArray3);
         }
         else if (type.Name.IsPrimitiveCppType())
         {
             object[] objArray4 = new object[] { type.Name, variableName + type.VariableName, CppCodeWriter.InitializerStringForPrimitiveCppType(type.Name) };
             writer.WriteLine("{0} {1} = {2};", objArray4);
         }
         else
         {
             object[] objArray5 = new object[] { type.Name, variableName + type.VariableName };
             writer.WriteLine("{0} {1} = {{ }};", objArray5);
         }
     }
 }