Checking condition and calling continuous method with periods of delay unity

后端 未结 1 1580
没有蜡笔的小新
没有蜡笔的小新 2020-12-12 07:32

I want code to check if target is alive, and if yes shoot at it. I want to check it all the time, and shoot all the time, The only problem is that checks can be made anytime

1条回答
  •  借酒劲吻你
    2020-12-12 08:01

    InvokeRepeating( "PossiblyShoot" , 1f, 1f );
    
    private void PossiblyShoot()
       {
       1. check if target still exists
       2. if it exists shoot at it
       }
    

    0 讨论(0)
提交回复
热议问题