Exemplo n.º 1
0
    private static void addParameter(Instruction instruction, int childIndex, ParameterReader paramData, GameObject parent)
    {
        string type = paramData.readWord().ToLower();

        if (type.Equals("boolean"))
        {
            BooleanParameter boolean = (BooleanParameter)instruction.addBooleanChild();
            boolean.Valeur = paramData.readBoolean();
        }
        else if (type.Equals("integer"))
        {
            IntegerParameter integer = (IntegerParameter)instruction.addIntegerChild();
            integer.Valeur = paramData.readInt();
            if (paramData.hasNextWord())
            {
                addIntegerMethod(integer, paramData.readWord(), instruction.gameObject);
            }
            if (paramData.hasNextWord())
            {
                integer.autoCompile = paramData.readBoolean();
            }
        }
        else
        {
            Debug.LogError("MAPLOADER - ERROR : Unknown parameter type for " + type);
        }
    }