mirror of https://github.com/axmolengine/axmol.git
To reconstruct object extension data.
This commit is contained in:
parent
773eedcaa5
commit
c72c8e865d
|
@ -1266,6 +1266,10 @@
|
|||
382384451A25915C002C4610 /* SpriteReader.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 382384421A25915C002C4610 /* SpriteReader.cpp */; };
|
||||
382384461A25915C002C4610 /* SpriteReader.h in Headers */ = {isa = PBXBuildFile; fileRef = 382384431A25915C002C4610 /* SpriteReader.h */; };
|
||||
382384471A25915C002C4610 /* SpriteReader.h in Headers */ = {isa = PBXBuildFile; fileRef = 382384431A25915C002C4610 /* SpriteReader.h */; };
|
||||
382F7ADC1AB1292A002EBECF /* CCObjectExtensionData.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 382F7ADA1AB1292A002EBECF /* CCObjectExtensionData.cpp */; };
|
||||
382F7ADD1AB1292A002EBECF /* CCObjectExtensionData.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 382F7ADA1AB1292A002EBECF /* CCObjectExtensionData.cpp */; };
|
||||
382F7ADE1AB1292A002EBECF /* CCObjectExtensionData.h in Headers */ = {isa = PBXBuildFile; fileRef = 382F7ADB1AB1292A002EBECF /* CCObjectExtensionData.h */; };
|
||||
382F7ADF1AB1292A002EBECF /* CCObjectExtensionData.h in Headers */ = {isa = PBXBuildFile; fileRef = 382F7ADB1AB1292A002EBECF /* CCObjectExtensionData.h */; };
|
||||
38ACD1FC1A27111900C3093D /* WidgetCallBackHandlerProtocol.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 38ACD1FA1A27111900C3093D /* WidgetCallBackHandlerProtocol.cpp */; };
|
||||
38ACD1FD1A27111900C3093D /* WidgetCallBackHandlerProtocol.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 38ACD1FA1A27111900C3093D /* WidgetCallBackHandlerProtocol.cpp */; };
|
||||
38ACD1FE1A27111900C3093D /* WidgetCallBackHandlerProtocol.h in Headers */ = {isa = PBXBuildFile; fileRef = 38ACD1FB1A27111900C3093D /* WidgetCallBackHandlerProtocol.h */; };
|
||||
|
@ -3089,6 +3093,8 @@
|
|||
3823843C1A259140002C4610 /* SingleNodeReader.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SingleNodeReader.h; sourceTree = "<group>"; };
|
||||
382384421A25915C002C4610 /* SpriteReader.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = SpriteReader.cpp; sourceTree = "<group>"; };
|
||||
382384431A25915C002C4610 /* SpriteReader.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SpriteReader.h; sourceTree = "<group>"; };
|
||||
382F7ADA1AB1292A002EBECF /* CCObjectExtensionData.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = CCObjectExtensionData.cpp; sourceTree = "<group>"; };
|
||||
382F7ADB1AB1292A002EBECF /* CCObjectExtensionData.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CCObjectExtensionData.h; sourceTree = "<group>"; };
|
||||
38ACD1FA1A27111900C3093D /* WidgetCallBackHandlerProtocol.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = WidgetCallBackHandlerProtocol.cpp; sourceTree = "<group>"; };
|
||||
38ACD1FB1A27111900C3093D /* WidgetCallBackHandlerProtocol.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WidgetCallBackHandlerProtocol.h; sourceTree = "<group>"; };
|
||||
38B8E2D319E66581002D7CE7 /* CSLoader.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = CSLoader.cpp; sourceTree = "<group>"; };
|
||||
|
@ -4772,6 +4778,8 @@
|
|||
382384061A25900F002C4610 /* FlatBuffersSerialize.h */,
|
||||
38ACD1FA1A27111900C3093D /* WidgetCallBackHandlerProtocol.cpp */,
|
||||
38ACD1FB1A27111900C3093D /* WidgetCallBackHandlerProtocol.h */,
|
||||
382F7ADA1AB1292A002EBECF /* CCObjectExtensionData.cpp */,
|
||||
382F7ADB1AB1292A002EBECF /* CCObjectExtensionData.h */,
|
||||
29E99D1C1957BA7000046604 /* CocoLoader.cpp */,
|
||||
29E99D1D1957BA7000046604 /* CocoLoader.h */,
|
||||
0634A4C4194B19E400E608AF /* ActionTimeline */,
|
||||
|
@ -7014,6 +7022,7 @@
|
|||
15AE1BA219AADFDF00C27E9E /* UILayoutParameter.h in Headers */,
|
||||
50ABBE331925AB6F00A911A9 /* CCConfiguration.h in Headers */,
|
||||
B665E2101AA80A6500DDB1C5 /* CCPUBaseForceAffector.h in Headers */,
|
||||
382F7ADE1AB1292A002EBECF /* CCObjectExtensionData.h in Headers */,
|
||||
15AE199519AAD39600C27E9E /* LayoutReader.h in Headers */,
|
||||
15AE183219AAD2F700C27E9E /* CCOBB.h in Headers */,
|
||||
15AE1BE319AAE01E00C27E9E /* CCScrollView.h in Headers */,
|
||||
|
@ -7667,6 +7676,7 @@
|
|||
B665E3751AA80A6500DDB1C5 /* CCPUParticleFollower.h in Headers */,
|
||||
15AE185D19AAD31200C27E9E /* CocosDenshion.h in Headers */,
|
||||
15AE194319AAD35100C27E9E /* CCColliderDetector.h in Headers */,
|
||||
382F7ADF1AB1292A002EBECF /* CCObjectExtensionData.h in Headers */,
|
||||
D0FD035C1A3B51AA00825BB5 /* CCAllocatorStrategyFixedBlock.h in Headers */,
|
||||
15AE1BC419AADFFB00C27E9E /* ExtensionMacros.h in Headers */,
|
||||
15AE185A19AAD31200C27E9E /* CDConfig.h in Headers */,
|
||||
|
@ -8180,6 +8190,7 @@
|
|||
15AE182C19AAD2F700C27E9E /* CCMeshVertexIndexData.cpp in Sources */,
|
||||
15AE1A8C19AAD40300C27E9E /* b2RevoluteJoint.cpp in Sources */,
|
||||
50ABBD4C1925AB0000A911A9 /* MathUtil.cpp in Sources */,
|
||||
382F7ADC1AB1292A002EBECF /* CCObjectExtensionData.cpp in Sources */,
|
||||
15AE191719AAD35000C27E9E /* CCSpriteFrameCacheHelper.cpp in Sources */,
|
||||
B665E2E21AA80A6500DDB1C5 /* CCPULineAffectorTranslator.cpp in Sources */,
|
||||
1A087AE81860400400196EF5 /* edtaa3func.cpp in Sources */,
|
||||
|
@ -8607,6 +8618,7 @@
|
|||
1A01C68F18F57BE800EFE3A6 /* CCDictionary.cpp in Sources */,
|
||||
B276EF621988D1D500CD400F /* CCVertexIndexData.cpp in Sources */,
|
||||
50ABBE561925AB6F00A911A9 /* CCEventFocus.cpp in Sources */,
|
||||
382F7ADD1AB1292A002EBECF /* CCObjectExtensionData.cpp in Sources */,
|
||||
15AE183D19AAD2F700C27E9E /* CCSkeleton3D.cpp in Sources */,
|
||||
503DD8E11926736A00CD74DD /* CCApplication-ios.mm in Sources */,
|
||||
15AE1AAC19AAD40300C27E9E /* b2WorldCallbacks.cpp in Sources */,
|
||||
|
|
|
@ -502,6 +502,7 @@ xcopy /Y /Q "$(ProjectDir)..\..\external\chipmunk\prebuilt\win32\release-lib\*.*
|
|||
<ClCompile Include="..\editor-support\cocostudio\CCDisplayFactory.cpp" />
|
||||
<ClCompile Include="..\editor-support\cocostudio\CCDisplayManager.cpp" />
|
||||
<ClCompile Include="..\editor-support\cocostudio\CCInputDelegate.cpp" />
|
||||
<ClCompile Include="..\editor-support\cocostudio\CCObjectExtensionData.cpp" />
|
||||
<ClCompile Include="..\editor-support\cocostudio\CCProcessBase.cpp" />
|
||||
<ClCompile Include="..\editor-support\cocostudio\CCSGUIReader.cpp" />
|
||||
<ClCompile Include="..\editor-support\cocostudio\CCSkin.cpp" />
|
||||
|
@ -1055,6 +1056,7 @@ xcopy /Y /Q "$(ProjectDir)..\..\external\chipmunk\prebuilt\win32\release-lib\*.*
|
|||
<ClInclude Include="..\editor-support\cocostudio\CCDisplayFactory.h" />
|
||||
<ClInclude Include="..\editor-support\cocostudio\CCDisplayManager.h" />
|
||||
<ClInclude Include="..\editor-support\cocostudio\CCInputDelegate.h" />
|
||||
<ClInclude Include="..\editor-support\cocostudio\CCObjectExtensionData.h" />
|
||||
<ClInclude Include="..\editor-support\cocostudio\CCProcessBase.h" />
|
||||
<ClInclude Include="..\editor-support\cocostudio\CCSGUIReader.h" />
|
||||
<ClInclude Include="..\editor-support\cocostudio\CCSkin.h" />
|
||||
|
|
|
@ -1786,6 +1786,9 @@
|
|||
<ClCompile Include="..\..\extensions\Particle3D\CCParticleSystem3D.cpp">
|
||||
<Filter>extension\Particle3D</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\editor-support\cocostudio\CCObjectExtensionData.cpp">
|
||||
<Filter>cocostudio\json</Filter>
|
||||
</ClCompile>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ClInclude Include="..\physics\CCPhysicsBody.h">
|
||||
|
@ -3496,6 +3499,9 @@
|
|||
<ClInclude Include="..\..\extensions\Particle3D\CCParticleSystem3D.h">
|
||||
<Filter>extension\Particle3D</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\editor-support\cocostudio\CCObjectExtensionData.h">
|
||||
<Filter>cocostudio\json</Filter>
|
||||
</ClInclude>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<None Include="..\math\Mat4.inl">
|
||||
|
|
|
@ -365,6 +365,7 @@
|
|||
<ClInclude Include="$(MSBuildThisFileDirectory)..\..\..\..\editor-support\cocostudio\CCDisplayFactory.h" />
|
||||
<ClInclude Include="$(MSBuildThisFileDirectory)..\..\..\..\editor-support\cocostudio\CCDisplayManager.h" />
|
||||
<ClInclude Include="$(MSBuildThisFileDirectory)..\..\..\..\editor-support\cocostudio\CCInputDelegate.h" />
|
||||
<ClInclude Include="$(MSBuildThisFileDirectory)..\..\..\..\editor-support\cocostudio\CCObjectExtensionData.h" />
|
||||
<ClInclude Include="$(MSBuildThisFileDirectory)..\..\..\..\editor-support\cocostudio\CCProcessBase.h" />
|
||||
<ClInclude Include="$(MSBuildThisFileDirectory)..\..\..\..\editor-support\cocostudio\CCSGUIReader.h" />
|
||||
<ClInclude Include="$(MSBuildThisFileDirectory)..\..\..\..\editor-support\cocostudio\CCSkin.h" />
|
||||
|
@ -932,6 +933,7 @@
|
|||
<ClCompile Include="$(MSBuildThisFileDirectory)..\..\..\..\editor-support\cocostudio\CCDisplayFactory.cpp" />
|
||||
<ClCompile Include="$(MSBuildThisFileDirectory)..\..\..\..\editor-support\cocostudio\CCDisplayManager.cpp" />
|
||||
<ClCompile Include="$(MSBuildThisFileDirectory)..\..\..\..\editor-support\cocostudio\CCInputDelegate.cpp" />
|
||||
<ClCompile Include="$(MSBuildThisFileDirectory)..\..\..\..\editor-support\cocostudio\CCObjectExtensionData.cpp" />
|
||||
<ClCompile Include="$(MSBuildThisFileDirectory)..\..\..\..\editor-support\cocostudio\CCProcessBase.cpp" />
|
||||
<ClCompile Include="$(MSBuildThisFileDirectory)..\..\..\..\editor-support\cocostudio\CCSGUIReader.cpp" />
|
||||
<ClCompile Include="$(MSBuildThisFileDirectory)..\..\..\..\editor-support\cocostudio\CCSkin.cpp" />
|
||||
|
|
|
@ -1734,6 +1734,9 @@
|
|||
</ClInclude>
|
||||
<ClInclude Include="$(MSBuildThisFileDirectory)..\..\..\..\editor-support\cocostudio\WidgetReader\Particle3DReader\Particle3DReader.h" />
|
||||
<ClInclude Include="$(MSBuildThisFileDirectory)..\..\..\..\editor-support\cocostudio\WidgetReader\Particle3DReader\Particle3DReader.h" />
|
||||
<ClInclude Include="$(MSBuildThisFileDirectory)..\..\..\..\editor-support\cocostudio\CCObjectExtensionData.h">
|
||||
<Filter>cocostudio\json</Filter>
|
||||
</ClInclude>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ClCompile Include="$(MSBuildThisFileDirectory)..\..\..\..\cocos2d.cpp" />
|
||||
|
@ -3294,6 +3297,9 @@
|
|||
</ClCompile>
|
||||
<ClCompile Include="$(MSBuildThisFileDirectory)..\..\..\..\editor-support\cocostudio\WidgetReader\Particle3DReader\Particle3DReader.cpp" />
|
||||
<ClCompile Include="$(MSBuildThisFileDirectory)..\..\..\..\editor-support\cocostudio\WidgetReader\Particle3DReader\Particle3DReader.cpp" />
|
||||
<ClCompile Include="$(MSBuildThisFileDirectory)..\..\..\..\editor-support\cocostudio\CCObjectExtensionData.cpp">
|
||||
<Filter>cocostudio\json</Filter>
|
||||
</ClCompile>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Filter Include="2d">
|
||||
|
|
|
@ -526,6 +526,7 @@
|
|||
<ClInclude Include="..\editor-support\cocostudio\CCDisplayFactory.h" />
|
||||
<ClInclude Include="..\editor-support\cocostudio\CCDisplayManager.h" />
|
||||
<ClInclude Include="..\editor-support\cocostudio\CCInputDelegate.h" />
|
||||
<ClInclude Include="..\editor-support\cocostudio\CCObjectExtensionData.h" />
|
||||
<ClInclude Include="..\editor-support\cocostudio\CCProcessBase.h" />
|
||||
<ClInclude Include="..\editor-support\cocostudio\CCSGUIReader.h" />
|
||||
<ClInclude Include="..\editor-support\cocostudio\CCSkin.h" />
|
||||
|
@ -1164,6 +1165,7 @@
|
|||
<ClCompile Include="..\editor-support\cocostudio\CCDisplayFactory.cpp" />
|
||||
<ClCompile Include="..\editor-support\cocostudio\CCDisplayManager.cpp" />
|
||||
<ClCompile Include="..\editor-support\cocostudio\CCInputDelegate.cpp" />
|
||||
<ClCompile Include="..\editor-support\cocostudio\CCObjectExtensionData.cpp" />
|
||||
<ClCompile Include="..\editor-support\cocostudio\CCProcessBase.cpp" />
|
||||
<ClCompile Include="..\editor-support\cocostudio\CCSGUIReader.cpp" />
|
||||
<ClCompile Include="..\editor-support\cocostudio\CCSkin.cpp" />
|
||||
|
|
|
@ -1806,6 +1806,9 @@
|
|||
<ClCompile Include="..\..\extensions\Particle3D\CCParticleSystem3D.cpp">
|
||||
<Filter>extension\Particle3D</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\editor-support\cocostudio\CCObjectExtensionData.cpp">
|
||||
<Filter>cocostudio\json</Filter>
|
||||
</ClCompile>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ClInclude Include="CCAction.h">
|
||||
|
@ -3510,6 +3513,9 @@
|
|||
<ClInclude Include="..\..\extensions\Particle3D\CCParticleSystem3D.h">
|
||||
<Filter>extension\Particle3D</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\editor-support\cocostudio\CCObjectExtensionData.h">
|
||||
<Filter>cocostudio\json</Filter>
|
||||
</ClInclude>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<None Include="..\math\Mat4.inl">
|
||||
|
|
|
@ -24,6 +24,8 @@ THE SOFTWARE.
|
|||
|
||||
#include "CCActionTimeline.h"
|
||||
|
||||
#include "cocostudio/CCObjectExtensionData.h"
|
||||
|
||||
USING_NS_CC;
|
||||
|
||||
NS_TIMELINE_BEGIN
|
||||
|
@ -235,7 +237,7 @@ void ActionTimeline::startWithTarget(Node *target)
|
|||
foreachNodeDescendant(target,
|
||||
[this, target](Node* child)
|
||||
{
|
||||
ActionTimelineData* data = dynamic_cast<ActionTimelineData*>(child->getUserObject());
|
||||
ObjectExtensionData* data = dynamic_cast<ObjectExtensionData*>(child->getUserObject());
|
||||
|
||||
if(data)
|
||||
{
|
||||
|
|
|
@ -74,7 +74,8 @@ ActionTimeline/CCActionTimelineNode.cpp \
|
|||
ActionTimeline/CSLoader.cpp \
|
||||
FlatBuffersSerialize.cpp \
|
||||
WidgetCallBackHandlerProtocol.cpp \
|
||||
WidgetReader/ArmatureNodeReader/ArmatureNodeReader.cpp
|
||||
WidgetReader/ArmatureNodeReader/ArmatureNodeReader.cpp \
|
||||
CCObjectExtensionData.cpp
|
||||
|
||||
|
||||
LOCAL_EXPORT_C_INCLUDES := $(LOCAL_PATH)/..
|
||||
|
|
|
@ -0,0 +1,70 @@
|
|||
/****************************************************************************
|
||||
Copyright (c) 2015 cocos2d-x.org
|
||||
|
||||
http://www.cocos2d-x.org
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
of this software and associated documentation files (the "Software"), to deal
|
||||
in the Software without restriction, including without limitation the rights
|
||||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
copies of the Software, and to permit persons to whom the Software is
|
||||
furnished to do so, subject to the following conditions:
|
||||
|
||||
The above copyright notice and this permission notice shall be included in
|
||||
all copies or substantial portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
||||
THE SOFTWARE.
|
||||
****************************************************************************/
|
||||
|
||||
#include "CCObjectExtensionData.h"
|
||||
|
||||
#include "cocostudio/ActionTimeline/CCActionTimeline.h"
|
||||
|
||||
|
||||
namespace cocostudio
|
||||
{
|
||||
|
||||
ObjectExtensionData* ObjectExtensionData::create()
|
||||
{
|
||||
ObjectExtensionData * ret = new (std::nothrow) ObjectExtensionData();
|
||||
if (ret && ret->init())
|
||||
{
|
||||
ret->autorelease();
|
||||
}
|
||||
else
|
||||
{
|
||||
CC_SAFE_DELETE(ret);
|
||||
}
|
||||
return ret;
|
||||
}
|
||||
|
||||
ObjectExtensionData::ObjectExtensionData()
|
||||
: _customProperty("")
|
||||
, _timelineData(nullptr)
|
||||
{
|
||||
}
|
||||
|
||||
bool ObjectExtensionData::init()
|
||||
{
|
||||
_timelineData = cocostudio::timeline::ActionTimelineData::create(0);
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
void ObjectExtensionData::setActionTag(int actionTag)
|
||||
{
|
||||
_timelineData->setActionTag(actionTag);
|
||||
}
|
||||
|
||||
const int ObjectExtensionData::getActionTag() const
|
||||
{
|
||||
return _timelineData->getActionTag();
|
||||
}
|
||||
|
||||
}
|
|
@ -0,0 +1,67 @@
|
|||
/****************************************************************************
|
||||
Copyright (c) 2015 cocos2d-x.org
|
||||
|
||||
http://www.cocos2d-x.org
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
of this software and associated documentation files (the "Software"), to deal
|
||||
in the Software without restriction, including without limitation the rights
|
||||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
copies of the Software, and to permit persons to whom the Software is
|
||||
furnished to do so, subject to the following conditions:
|
||||
|
||||
The above copyright notice and this permission notice shall be included in
|
||||
all copies or substantial portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
||||
THE SOFTWARE.
|
||||
****************************************************************************/
|
||||
|
||||
#ifndef __cocos2d_libs__CCObjectExtensionData__
|
||||
#define __cocos2d_libs__CCObjectExtensionData__
|
||||
|
||||
#include <string>
|
||||
|
||||
#include "base/CCRef.h"
|
||||
|
||||
#include "cocostudio/CocosStudioExport.h"
|
||||
|
||||
namespace cocostudio
|
||||
{
|
||||
namespace timeline
|
||||
{
|
||||
class ActionTimelineData;
|
||||
}
|
||||
}
|
||||
|
||||
namespace cocostudio
|
||||
{
|
||||
class CC_STUDIO_DLL ObjectExtensionData : public cocos2d::Ref
|
||||
{
|
||||
|
||||
public:
|
||||
static ObjectExtensionData* create();
|
||||
|
||||
virtual void setCustomProperty(const std::string& customProperty) { _customProperty = customProperty; }
|
||||
virtual std::string getCustomProperty() const { return _customProperty; };
|
||||
|
||||
virtual void setActionTag(int actionTag);
|
||||
virtual const int getActionTag() const;
|
||||
|
||||
CC_CONSTRUCTOR_ACCESS:
|
||||
ObjectExtensionData();
|
||||
virtual bool init();
|
||||
|
||||
protected:
|
||||
std::string _customProperty;
|
||||
cocostudio::timeline::ActionTimelineData* _timelineData;
|
||||
};
|
||||
}
|
||||
|
||||
|
||||
#endif /* defined(__cocos2d_libs__CCObjectExtensionData__) */
|
|
@ -43,6 +43,7 @@ set(COCOS_CS_SRC
|
|||
editor-support/cocostudio/TriggerMng.cpp
|
||||
editor-support/cocostudio/TriggerObj.cpp
|
||||
editor-support/cocostudio/FlatBuffersSerialize.cpp
|
||||
editor-support/cocostudio/CCObjectExtensionData.cpp
|
||||
editor-support/cocostudio/WidgetReader/NodeReader/NodeReader.cpp
|
||||
editor-support/cocostudio/WidgetReader/SingleNodeReader/SingleNodeReader.cpp
|
||||
editor-support/cocostudio/WidgetReader/SpriteReader/SpriteReader.cpp
|
||||
|
|
|
@ -324,8 +324,11 @@ Offset<NodeTree> FlatBuffersSerialize::createNodeTree(const tinyxml2::XMLElement
|
|||
readername.append("Reader");
|
||||
|
||||
NodeReaderProtocol* reader = dynamic_cast<NodeReaderProtocol*>(ObjectFactory::getInstance()->createObject(readername));
|
||||
if (reader != nullptr)
|
||||
{
|
||||
options = CreateOptions(*_builder, reader->createOptionsWithFlatBuffers(objectData, _builder));
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
// children
|
||||
|
@ -1265,8 +1268,11 @@ Offset<NodeTree> FlatBuffersSerialize::createNodeTreeForSimulator(const tinyxml2
|
|||
readername.append("Reader");
|
||||
|
||||
NodeReaderProtocol* reader = dynamic_cast<NodeReaderProtocol*>(ObjectFactory::getInstance()->createObject(readername));
|
||||
if (reader != nullptr)
|
||||
{
|
||||
options = CreateOptions(*_builder, reader->createOptionsWithFlatBuffers(objectData, _builder));
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
// children
|
||||
|
|
|
@ -26,6 +26,7 @@
|
|||
|
||||
#include "cocostudio/CSParseBinary_generated.h"
|
||||
#include "cocostudio/ActionTimeline/CCActionTimeline.h"
|
||||
#include "cocostudio/CCObjectExtensionData.h"
|
||||
|
||||
#include "tinyxml2.h"
|
||||
#include "flatbuffers/flatbuffers.h"
|
||||
|
@ -182,6 +183,10 @@ namespace cocostudio
|
|||
{
|
||||
touchEnabled = (value == "True") ? true : false;
|
||||
}
|
||||
else if (attriname == "UserData")
|
||||
{
|
||||
customProperty = value;
|
||||
}
|
||||
else if (attriname == "FrameEvent")
|
||||
{
|
||||
frameEvent = value;
|
||||
|
@ -477,6 +482,7 @@ namespace cocostudio
|
|||
float h = options->size()->height();
|
||||
int alpha = options->alpha();
|
||||
Color3B color(options->color()->r(), options->color()->g(), options->color()->b());
|
||||
std::string customProperty = options->customProperty()->c_str();
|
||||
|
||||
node->setName(name);
|
||||
|
||||
|
@ -508,6 +514,12 @@ namespace cocostudio
|
|||
node->setTag(tag);
|
||||
node->setUserObject(timeline::ActionTimelineData::create(actionTag));
|
||||
|
||||
ObjectExtensionData* extensionData = ObjectExtensionData::create();
|
||||
extensionData->setCustomProperty(customProperty);
|
||||
extensionData->setActionTag(actionTag);
|
||||
node->setUserObject(extensionData);
|
||||
|
||||
|
||||
node->setCascadeColorEnabled(true);
|
||||
node->setCascadeOpacityEnabled(true);
|
||||
|
||||
|
|
|
@ -5,6 +5,7 @@
|
|||
#include "cocostudio/CocoLoader.h"
|
||||
#include "ui/UIButton.h"
|
||||
#include "../ActionTimeline/CCActionTimeline.h"
|
||||
#include "cocostudio/CCObjectExtensionData.h"
|
||||
#include "cocostudio/CSParseBinary_generated.h"
|
||||
|
||||
#include "tinyxml2.h"
|
||||
|
@ -480,6 +481,10 @@ namespace cocostudio
|
|||
{
|
||||
touchEnabled = (value == "True") ? true : false;
|
||||
}
|
||||
else if (attriname == "UserData")
|
||||
{
|
||||
customProperty = value;
|
||||
}
|
||||
else if (attriname == "FrameEvent")
|
||||
{
|
||||
frameEvent = value;
|
||||
|
@ -786,6 +791,14 @@ namespace cocostudio
|
|||
|
||||
int actionTag = options->actionTag();
|
||||
widget->setActionTag(actionTag);
|
||||
|
||||
std::string customProperty = options->customProperty()->c_str();
|
||||
|
||||
ObjectExtensionData* extensionData = ObjectExtensionData::create();
|
||||
extensionData->setCustomProperty(customProperty);
|
||||
extensionData->setActionTag(actionTag);
|
||||
node->setUserObject(extensionData);
|
||||
|
||||
widget->setUserObject(timeline::ActionTimelineData::create(actionTag));
|
||||
|
||||
bool touchEnabled = options->touchEnabled() != 0;
|
||||
|
|
Loading…
Reference in New Issue