Hi Arbor team,
I am creating a class that inherits ArborFSM to add some features I want. I need to init some things when Awake() or Start(), but they are not marked as virtual. I had to fix it in your source.
Can you mark those 2 methods as virtual, or create methods OnAwake(), OnStart() for easy inheritance.
Mark Start() and Awake() as protected virtual
Forum rules
The items required for the request are as follows.
要望に必要な項目は以下の通りです。
The items required for the request are as follows.
- What are you trying to do with Arbor?
- Specifically, where are you inconvenient and in trouble?
- What should I do to improve?
- We can not answer requests that do not know the detailed situation.
- We can not answer your request for specific problems in the specification of your project.
- We can not answer your request on Unity's specification issues.
- We do not guarantee the implementation of your request.
要望に必要な項目は以下の通りです。
- Arborを使って何をしようとしているか。
- 具体的にどこが不便で困っているか。
- 改善するにはどうすればよいか。
- 詳しい状況がわからない要望については答えられません。
- ユーザー様のプロジェクトの仕様上の固有の問題に対する要望については答えられません。
- Unityの仕様上の問題に対する要望には答えられません。
- 要望の実装を必ずお約束するものではございません。
- caitsithware
- 管理人
- Posts: 495
- Joined: 2015/08/17 12:41
Re: Mark Start() and Awake() as protected virtual
Thank you for your request.
There is no problem to mark it as protected virtual, but it is not supposed to be used by inheriting from ArborFSM.
Please consider providing an extension method or a control component.
There is no problem to mark it as protected virtual, but it is not supposed to be used by inheriting from ArborFSM.
Please consider providing an extension method or a control component.
Re: Mark Start() and Awake() as protected virtual
Extension methods will not be able to access non-public properties, nor can they store data on the component itself.
The Control Component will make it look unencapsulated.
Currently, I'm using like this:
The Control Component will make it look unencapsulated.
Currently, I'm using like this:
- Attachments
-
- Ảnh chụp Màn hình 2021-06-26 lúc 22.42.01.png (168.26 KiB) Viewed 9822 times
- caitsithware
- 管理人
- Posts: 495
- Joined: 2015/08/17 12:41
Re: Mark Start() and Awake() as protected virtual
Control components are Unity's theory, so I recommend it.
For example, a PlayerInput script that controls the CharacterController component with Input.
It is okay to inherit it, but please do so at your own risk.
It seems better to mark the protected virtual in the internal design, so I will consider it in the next major version (3.9.0?).
For example, a PlayerInput script that controls the CharacterController component with Input.
It is okay to inherit it, but please do so at your own risk.
It seems better to mark the protected virtual in the internal design, so I will consider it in the next major version (3.9.0?).
Re: Mark Start() and Awake() as protected virtual
Thank you for accepting the request, I look forward to it in the next version.