Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Question: How to attach Custom MonoBehaviour Script to Tiled Object? #53

Closed
HDNua opened this issue Jul 15, 2016 · 2 comments
Closed

Question: How to attach Custom MonoBehaviour Script to Tiled Object? #53

HDNua opened this issue Jul 15, 2016 · 2 comments

Comments

@HDNua
Copy link

HDNua commented Jul 15, 2016

First, thank you for distributing this amazing assist tool.
I'm also one of the big fan of the greatest game Rockman(Megaman), so I'm making a fan game (X-series) too.

I want to attach custom script to imported GameObject, but I couldn't find about how to do this.
In additional, I want to set default value of it. (want to use custom properties)

Since it is not enough to explain my situation because of my poor English, I'll explain more in detail.

I wrote code class "CameraZone5Script". This class has several public boolean fields: _isTopBounded, _isLeftBounded, _isRightBounded, _isBottomBounded, etc.
In Tiled, I created Object Layer "CameraZone", created and checked custom properties like this.

But it is not applied appropriately in Unity (5.3.5), so please, I want to hear some advices.

Again, thanks to your good program.

@Seanba
Copy link
Owner

Seanba commented Jul 15, 2016

Hi there. Here's what you'll need to achieve your goals.

Make sure your custom properties Objects Types Xml file is known to Tiled2Unity (http://www.seanba.com/object-type-support.html)
Write a Custom Importer script in your Unity project that takes properties from Tiled and shoves them into components. Make sure that script lives in an 'Editor' folder (it's a common mistake). I talk more about Custom Importers here: http://www.seanba.com/megadadadventures.html

In the meantime, I'll give some thought to making this more automated given your example. (Will be several weeks before I make progress on it though.)

@HDNua
Copy link
Author

HDNua commented Jul 15, 2016

I'll try it. Thanks for reply. 👍 :)

@HDNua HDNua closed this as completed Jul 15, 2016
HDNua added a commit to HDNua/RxpbEngineUnity that referenced this issue Mar 26, 2017
* !!!!! IMPORTANT & CHALLENGE !!!!!
  Tiled2Unity를 이용하여, Tiled에서 정의한 custom properties를
  Unity에 적용하는 방법을 알아냈음.
> Seanba/Tiled2Unity#53 링크 참조.

- HandyImporter 클래스군 추가.
> HandyImporter_AddComponent
> HandyImporter_CameraZone
> HandyImporter_CameraZoneBorder
> HandyImporter_TiledGeometry
> 이들의 자세한 구현은 코드를 직접 참조하거나 다음 링크를 참조.
  http://www.seanba.com/megadadadventures.html

- 임시 저장 에디션.

end.


Former-commit-id: efc6d472cddc329bf3e70ea147ce86fc82da3dc4
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants