Has anyone worked with cocos studio addins?

I’ve been trying to piece together how C# addins for Cocos Studio work, in hopes of adding some data members to custom classes. Does any one have experience with this? Or have more information on C# addins?

So far the only information I have found is:

  • This documentation (but it seems out of date or I cant find the right assembly to use the example code)
  • The sample code that gets installed with cocos studio (but it doesn’t do much)
  • This github (it creates a serialiser but not a ViewModel)

Update: Now able to create and place the “Sprite Extend” object from the documentation sample code and see the “Label Text” and “Label Font” fields.

But any attempt to rename LuaCustomObject results in the following exception:

2015-12-01 15:00:15,892 [ERROR] [Thrd:1] CocoStudio.Basic.CSLogger.Error(:0) - Load model list failed.
System.ArgumentOutOfRangeException: Length cannot be less than zero.
Parameter name: length
  at System.String.Substring (Int32 startIndex, Int32 length) [0x00044] in /private/tmp/source-mono-mac-4.2.0-branch-64/bockbuild-mono-4.2.0-branch/profiles/mono-mac-xamarin/build-root/mono-4.2.1-x86/external/referencesource/mscorlib/system/string.cs:1269 
  at Modules.UI.ComTool.View.ComToolUCViewModel.CreateDefaultUIBitmapSource (System.String uiName) [0x00008] in <filename unknown>:0 
  at Modules.UI.ComTool.View.ComToolUCViewModel.CreateBitmap (CocoStudio.Model.ModelMetaData modelMetaData) [0x0000c] in <filename unknown>:0 
  at Modules.UI.ComTool.View.ComToolUCViewModel.CreateModelList () [0x0002f] in <filename unknown>:0 
  at Modules.UI.ComTool.View.ComToolUCViewModel..ctor () [0x00017] in <filename unknown>:0 

I can neither debug nor do my attempts at poking LogConfig.Output yield anything useful, so progress is slow.

Any hints? Or any suggestions on how to setup the dev environment better? (using xamarin studio on mac)

Edit: Turns out the class name must be “*Object” (i.e. instead of “Ship”… I needed to name the class “ShipObject”). But now I’m stuck at how to serialise the new data into the csb.

Have a look this, http://www.cocos.com/doc/

Sorry, that’s Chinese, here is a English version http://www.cocos.com/docs/document_en/
check Chapter3: Editor–CustomWidgets

Thanks for the hints! I also want to try the Addin feature. I have read the documentation but didn’t find the code which is mentioned in it (Addins solution)
Did you use the Github code you linked in your first post ? Could you please briefly describe the steps needed to compile the Addins ?