¡¡ReactiveProperty ¤Ï¡¢ÃÍ·¿¤Þ¤¿¤Ï»²¾È·¿¤Î¥Ç¡¼¥¿¤ò¥é¥Ã¥×¤¹¤ë¤³¤È¤¬¤Ç¤¤Þ¤¹¡£
¶ñÂÎŪ¤Ë¤Ï¡¢¥¸¥§¥Í¥ê¥Ã¥¯¤ÊÀ¼Á¤ò»ý¤Ã¤Æ¤ª¤ê¡¢¤É¤ó¤Ê·¿¤Ç¤â¥é¥Ã¥×¤¹¤ë¤³¤È¤¬¤Ç¤¤Þ¤¹¡£
¤½¤Î¤¿¤á¡¢int ¤ä float ¤Ê¤É¤ÎÃÍ·¿¤À¤±¤Ç¤Ê¤¯¡¢string ¤ä object¡¢ GameObject¡¢¼«ºî¥¯¥é¥¹¤Ê¤É¤Î»²¾È·¿¤â¥é¥Ã¥×¤¹¤ë¤³¤È¤¬¤Ç¤¤Þ¤¹¡£
¡¡Î㤨¤Ð¡¢ReactiveProperty<int>¤ÏÃÍ·¿¤Ç¤¢¤ë int ·¿¤ÎÃͤò¥é¥Ã¥×¤·¤Þ¤¹¤¬¡¢
ReactiveProperty<string>¤Ï»²¾È·¿¤Ç¤¢¤ë string ·¿¤ÎÃͤò¥é¥Ã¥×¤·¤Þ¤¹¡£
¤½¤·¤Æ¡¢¤½¤ì¤¾¤ì¤Î ReactiveProperty ¥¤¥ó¥¹¥¿¥ó¥¹¤Ï¡¢¤½¤Î·¿¤Ë±þ¤¸¤¿Ãͤò»ý¤Á¤Þ¤¹¡£
¡¡ReactiveProperty¤¬ÃÍ·¿¤ò¥é¥Ã¥×¤¹¤ë¾ì¹ç¡¢¤½¤ÎÃͤÏnull¤Ë¤Ê¤ë¤³¤È¤Ï¤¢¤ê¤Þ¤»¤ó¡£
°ìÊý¡¢»²¾È·¿¤ò¥é¥Ã¥×¤¹¤ë¾ì¹ç¡¢¤½¤ÎÃͤÏnull¤Ë¤Ê¤ë²ÄǽÀ¤¬¤¢¤ê¤Þ¤¹¡£
¡¡C# ¤ÎÃÍ·¿¡Êint¡¢float¡¢bool¤Ê¤É¡Ë¤òÀë¸À¤·¤¿ ReactiveProperty ¤Î¾ì¹ç¡¢Ä̾ï¤Ï null ¥Á¥§¥Ã¥¯¤ÏɬÍפ¢¤ê¤Þ¤»¤ó¡£
ÃÍ·¿¤Ï null ¤Ë¤Ê¤ë¤³¤È¤¬¤Ç¤¤Ê¤¤¤¿¤á¤Ç¤¹¡£(null µöÍÆ·¿¤Ç¤¢¤ë¾ì¹ç¤ò½ü¤¤Þ¤¹)
¡¡¤Ç¤¹¤¬¡¢»²¾È·¿¤Î¥×¥ê¥ß¥Æ¥£¥Ö·¿(string¡¢object ¤Ê¤É)¤Ç¤¢¤Ã¤¿¤ê¡¢GameObject ¤ä¥³¥ó¥Ý¡¼¥Í¥ó¥È¤Î·¿¡¢¼«ºî¥¯¥é¥¹¤Ê¤É¤òÀë¸À¤·¤¿ ReactiveProperty ¤Î¾ì¹ç¤Ë¤Ï¡¢null ¥Á¥§¥Ã¥¯¤¬É¬Íפˤʤê¤Þ¤¹¡£
»²¾È·¿¤ÎÊÑ¿ô¤Ï null ¤Ë¤Ê¤ë²ÄǽÀ¤¬¤¢¤ë¤¿¤á¤Ç¤¹¡£
¡¡Î㤨¤Ð¡¢ReactiveProperty<Rigidbody>¤Î¤è¤¦¤Ë¥³¥ó¥Ý¡¼¥Í¥ó¥È¤Î·¿¤Î¥¯¥é¥¹¤òÀë¸À¤·¤¿ ReactiveProperty ¤Î¾ì¹ç¡¢
Rigidbody ¤¬ null ¤Ç¤¢¤ë²ÄǽÀ¤¬¤¢¤ê¤Þ¤¹¡£ReactiveProperty¤Ï»²¾È·¿¤Î¥Ç¡¼¥¿¤ò¥é¥Ã¥×¤·¤Æ¤¤¤Þ¤¹¤¬¡¢¼«ÂΤ¬ null ¤Ç¤¢¤ë¤³¤È¤â¤¢¤ë¤¿¤á¤Ç¤¹¡£
¡¡Ä̾ï¤ÎÊÑ¿ô¤È ReactiveProperty¤Î°ã¤¤¤Ï¡¢ReactiveProperty¤Ï
¥¯¥é¥¹¤Ç¤¢¤ê¡¢¤½¤Î¥¤¥ó¥¹¥¿¥ó¥¹¤¬ null ¤Ç¤¢¤ë²ÄǽÀ¤¬¤¢¤ëÅÀ¤Ç¤¹¡£
¤½¤Î¾ì¹ç¡¢ReactiveProperty¤Înull¥Á¥§¥Ã¥¯¤Ï¼¡¤Î¤è¤¦¤Ë¹Ô¤¦É¬Íפ¬¤¢¤ê¤Þ¤¹¡£
public class Test_A {
public int count;
}
public class Test_B {
public ReactiveProperty<Test_A> TestProperty = new();
void Start() {
if (TestProperty == null || TestProperty .Value == null) {
return;
}
}
}
¡¡¤³¤Î¤è¤¦¤Ë¡¢TestProperty ¤¬ null ¤Ç¤¢¤ë¤«¤É¤¦¤«¤ò¥Á¥§¥Ã¥¯¤·¡¢
¤½¤Î¸å¤Ë TestProperty.Value ¤¬ null ¤Ç¤¢¤ë¤«¤É¤¦¤«¤ò¥Á¥§¥Ã¥¯¤¹¤ë¤³¤È¤Ç¡¢Àµ¤·¤¯ null ¥Á¥§¥Ã¥¯¤ò¹Ô¤¦¤³¤È¤¬¤Ç¤¤Þ¤¹¡£