public void lose(_Action3Enemy.CharacterInfo ch) //, float pastTime ) { //if( pastTime != 0.0f ) { hateDown(ch, GM.t.delta); // pastTime ); carmDown(ch); } }
public void toAlert(_Action3Enemy.CharacterInfo ch) { //Debug.Log( "to alert" ); refreshAlertTime(ch); errRadius = 0.0f; act = null; }
public void toDecision(_Action3Enemy.CharacterInfo ch, _Action3 a, float er = 0.0f) { //Debug.Log( "to decision" ); hate = 1.0f; refreshChaseTime(ch); errRadius = er; act = a; }
public void keep(_Action3Enemy.CharacterInfo ch, _Action3 a, float h, float time, float er) // 感覚でとらえた相手・ヘイトを適用する。 { var preTargetting = hate >= 1.0f; hateUp(ch, h, time * (isBattling ? 3.0f : 1.0f)); var nowTargetting = hate >= 1.0f; if ((!isExists | isRelease) & (preTargetting ^ nowTargetting)) { refreshChaseTime(ch); } // 待機・警戒・疑敵・倦怠時に確敵モードに移行した場合、追跡タイマーをセットする。 errRadius = er; act = a; }
void carmDown(_Action3Enemy.CharacterInfo ch) // 時間限界時に、確敵・喪失→警戒→待機の順で1つだけ低い状態へ移行する。 { if (!isRelease) { return; } if (isChaseOver) { refreshAlertTime(ch); } else { resetTime(); } if (isExists) { act = null; } }
public bool isCapturable(_Action3Enemy.CharacterInfo ch) // キャプチャする際、スキャンしなおすケースの検討のため、キャプチャ可能か(すべきか)どうかを返す。 { //return hate >= capturableLimits[ (int)ch.persistence ]; return(Random.value >= capturableLimits[(int)ch.persistence]); }
void refreshAlertTime(_Action3Enemy.CharacterInfo ch) { //Debug.Log( "alert time" ); releaseTime = Time.time + alertTimes[(int)ch.aggressive]; }
void hateDown(_Action3Enemy.CharacterInfo ch, float time) { hate -= hateDownRatios[(int)ch.aggressive] * time; hate = hate < 0.0f ? 0.0f : hate; }
void hateUp(_Action3Enemy.CharacterInfo ch, float up, float time) { var newHate = hate + up * hateUpRatios[(int)ch.aggressive] * time; hate = newHate > 1.0f ? 1.0f : newHate; }
public void toLost(_Action3Enemy.CharacterInfo ch) { //Debug.Log( "to lost" ); hateDown(ch, 0.1f); }