Yes, the script control tasks are able to select the properties directly exposed on the monobehaviour. What you could do, is to create an intermediate monobehaviour class with the properties you would like to read/write and attach it on the same gameobject that ‘ViewModel’ is on. Something like this:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
[RequireComponent(typeof(ViewModel))]
publicclassViewModelProxy:MonoBehaviour{
privateViewModel viewModel;
publicboolTestBool{
get{returnviewModel.TestBool;}
set{viewModel.TestBool=value;}
}
publicfloatTestFloat{
get{returnviewModel.TestFloat;}
set{viewModel.TestFloat=value;}
}
voidAwake(){
viewModel=GetComponent<ViewModel>();
}
}
Join us on Discord: https://discord.gg/97q2Rjh
Login
Register
By registering on this website you agree to our Privacy Policy.