Example #1
0
bool Component::SaveJSON(JSONValue& dest) const
{
    // Write type and ID
    dest.Set("type", GetTypeName());
    dest.Set("id", (int) id_);

    // Write attributes
    return Animatable::SaveJSON(dest);
}
bool TypeScriptImporter::SaveSettingsInternal(JSONValue& jsonRoot)
{
    if (!AssetImporter::SaveSettingsInternal(jsonRoot))
        return false;

    JSONValue import;
    import.Set("IsComponentFile", JSONValue(isComponentFile_));
    jsonRoot.Set("TypeScriptImporter", import);

    return true;
}
void MacBuildSettings::Write(JSONValue& parent)
{
    JSONValue json;

    json.Set("appName", appName_);
    json.Set("packageName", packageName_);
    json.Set("companyName", companyName_);
    json.Set("productName", productName_);

    parent.Set("MacBuildSettings", json);
}
    bool NETAssemblyImporter::SaveSettingsInternal(JSONValue& jsonRoot)
    {
        if (!AssetImporter::SaveSettingsInternal(jsonRoot))
            return false;

        JSONValue import;
        import.SetType(JSON_OBJECT);
        import.Set("AssemblyJSON", assemblyJSON_);
        jsonRoot.Set("NETAssemblyImporter", import);

        return true;
    }
bool MaterialImporter::SaveSettingsInternal(JSONValue& jsonRoot)
{
    if (!AssetImporter::SaveSettingsInternal(jsonRoot))
        return false;

    JSONValue import(JSONValue::emptyObject);
    jsonRoot.Set("MaterialImporter", import);

    return true;
}
    bool CSharpImporter::SaveSettingsInternal(JSONValue& jsonRoot)
    {
        if (!AssetImporter::SaveSettingsInternal(jsonRoot))
            return false;

        JSONValue import;
        jsonRoot.Set("CSharpImporter", import);

        return true;
    }
bool TextureImporter::SaveSettingsInternal(JSONValue& jsonRoot)
{
    if (!AssetImporter::SaveSettingsInternal(jsonRoot))
        return false;

    JSONValue import(JSONValue::emptyObject);
	import.Set("compressionSize", compressedSize_);

    jsonRoot.Set("TextureImporter", import);

    return true;
}
bool UnknownComponent::SaveJSON(JSONValue& dest) const
{
    if (!useXML_)
        ATOMIC_LOGWARNING("UnknownComponent loaded in binary mode, attributes will be empty for JSON save");

    // Write type and ID
    dest.Set("type", GetTypeName());
    dest.Set("id", (int) id_);

    JSONArray attributesArray;
    attributesArray.Reserve(xmlAttributeInfos_.Size());
    for (unsigned i = 0; i < xmlAttributeInfos_.Size(); ++i)
    {
        JSONValue attrVal;
        attrVal.Set("name", xmlAttributeInfos_[i].name_);
        attrVal.Set("value", xmlAttributes_[i]);
        attributesArray.Push(attrVal);
    }
    dest.Set("attributes", attributesArray);

    return true;
}
Example #9
0
bool ObjectAnimation::SaveJSON(JSONValue& dest) const
{
    JSONValue attributeAnimationsValue;

    for (HashMap<String, SharedPtr<ValueAnimationInfo> >::ConstIterator i = attributeAnimationInfos_.Begin();
         i != attributeAnimationInfos_.End(); ++i)
    {
        JSONValue animValue;
        animValue.Set("name", i->first_);

        const ValueAnimationInfo* info = i->second_;
        if (!info->GetAnimation()->SaveJSON(animValue))
            return false;

        animValue.Set("wrapmode", wrapModeNames[info->GetWrapMode()]);
        animValue.Set("speed", (float) info->GetSpeed());

        attributeAnimationsValue.Set(i->first_, animValue);
    }

    dest.Set("attributeanimations", attributeAnimationsValue);
    return true;
}
Example #10
0
bool Animatable::SaveJSON(JSONValue& dest) const
{
    if (!Serializable::SaveJSON(dest))
        return false;

    // Object animation without name
    if (objectAnimation_ && objectAnimation_->GetName().Empty())
    {
        JSONValue objectAnimationValue;
        if (!objectAnimation_->SaveJSON(objectAnimationValue))
            return false;
        dest.Set("objectanimation", objectAnimationValue);
    }

    JSONValue attributeAnimationValue;

    for (HashMap<String, SharedPtr<AttributeAnimationInfo> >::ConstIterator i = attributeAnimationInfos_.Begin();
         i != attributeAnimationInfos_.End(); ++i)
    {
        ValueAnimation* attributeAnimation = i->second_->GetAnimation();
        if (attributeAnimation->GetOwner())
            continue;

        const AttributeInfo& attr = i->second_->GetAttributeInfo();
        JSONValue attributeValue;
        attributeValue.Set("name", attr.name_);
        if (!attributeAnimation->SaveJSON(attributeValue))
            return false;

        attributeValue.Set("wrapmode", wrapModeNames[i->second_->GetWrapMode()]);
        attributeValue.Set("speed", (float) i->second_->GetSpeed());

        attributeAnimationValue.Set(attr.name_, attributeValue);
    }

    return true;
}
void AndroidBuildSettings::Write(JSONValue& parent)
{
    JSONValue json;

    json.Set("appName", appName_);
    json.Set("packageName", packageName_);
    json.Set("companyName", companyName_);
    json.Set("productName", productName_);

    json.Set("targetSDKVersion", targetSDKVersion_);
    json.Set("minSDKVersion", minSDKVersion_);
    json.Set("activityName", activityName_);
    json.Set("iconPath", iconPath_);

    parent.Set("AndroidBuildSettings", json);


}
bool ValueAnimation::SaveJSON(JSONValue& dest) const
{
    dest.Set("interpolationmethod", interpMethodNames[interpolationMethod_]);
    if (interpolationMethod_ == IM_SPLINE)
        dest.Set("splinetension", (float) splineTension_);

    JSONArray keyFramesArray;
    keyFramesArray.Reserve(keyFrames_.Size());
    for (unsigned i = 0; i < keyFrames_.Size(); ++i)
    {
        const VAnimKeyFrame& keyFrame = keyFrames_[i];
        JSONValue keyFrameVal;
        keyFrameVal.Set("time", keyFrame.time_);
        JSONValue valueVal;
        valueVal.SetVariant(keyFrame.value_);
        keyFrameVal.Set("value", valueVal);
        keyFramesArray.Push(keyFrameVal);
    }
    dest.Set("keyframes", keyFramesArray);

    JSONArray eventFramesArray;
    eventFramesArray.Reserve(eventFrames_.Size());
    for (unsigned i = 0; i < eventFrames_.Size(); ++i)
    {
        const VAnimEventFrame& eventFrame = eventFrames_[i];
        JSONValue eventFrameVal;
        eventFrameVal.Set("time", eventFrame.time_);
        eventFrameVal.Set("eventtype", eventFrame.eventType_.Value());
        JSONValue eventDataVal;
        eventDataVal.SetVariantMap(eventFrame.eventData_);
        eventFrameVal.Set("eventdata", eventDataVal);

        eventFramesArray.Push(eventFrameVal);
    }
    dest.Set("eventframes", eventFramesArray);

    return true;
}
void IOSBuildSettings::Write(JSONValue& parent)
{
    JSONValue json;

    json.Set("appName", appName_);
    json.Set("packageName", packageName_);
    json.Set("companyName", companyName_);
    json.Set("productName", productName_);

    json.Set("provisionFile", provisionFile_);
    json.Set("appIDPrefix", appidPrefix_);

    parent.Set("IOSBuildSettings", json);

}