private void init(Task owner_task, CalcPosition calc_position_func) { alive_ = true; disabled_ = false; owner_task_ = owner_task; calc_position_func_ = calc_position_func; calc_position_func_(ref updated_position_); locked_ = false; fired_ = false; hitted_ = false; sight_id_ = -1; }
public static LockTarget create(Task owner_task, CalcPosition calc_position_func) { int cnt = 0; while (pool_[pool_index_].alive_) { ++pool_index_; if (pool_index_ >= POOL_MAX) { pool_index_ = 0; } ++cnt; if (cnt >= POOL_MAX) { Debug.LogError("EXCEED LockTarget POOL!"); break; } } var obj = pool_[pool_index_]; obj.init(owner_task, calc_position_func); return(obj); }