Stas Kostikov
New member
Hi. I have a question about Behaviour Designer Editor (original not pro)
I have code like this:
public class CheckEnemyCooldown : Conditional
{
[AutoSetIfAvailable]
public AINetworkedCharacter Character;
public override TaskStatus OnUpdate()
{
return !this.Character.IsOnCooldown ? TaskStatus.Success : TaskStatus.Failure;
}
}
And what I want that Character field is auto field with suitable value as soon as node added into editor.
Best idea that I come with is this.
[CustomObjectDrawer(typeof(AutoSetIfAvailableAttribute))]
public class AutoSetIfAvailableDrawer : ObjectDrawer
{
}
but as soon as I add this code. I start receiving exception about using new to create MonoBehaviour my guess there some new inside DrawField if I use a custom drawer.
Any way to solve it? Or there is a different way?
I have code like this:
public class CheckEnemyCooldown : Conditional
{
[AutoSetIfAvailable]
public AINetworkedCharacter Character;
public override TaskStatus OnUpdate()
{
return !this.Character.IsOnCooldown ? TaskStatus.Success : TaskStatus.Failure;
}
}
And what I want that Character field is auto field with suitable value as soon as node added into editor.
Best idea that I come with is this.
[CustomObjectDrawer(typeof(AutoSetIfAvailableAttribute))]
public class AutoSetIfAvailableDrawer : ObjectDrawer
{
}
but as soon as I add this code. I start receiving exception about using new to create MonoBehaviour my guess there some new inside DrawField if I use a custom drawer.
Any way to solve it? Or there is a different way?