///<inheritdoc/> public override void Init(AIEntity entity) { base.Init(entity); weaponBehaviour = new AIWeaponBehaviour(entity); visionResult = new AISensors.VisionResult(); //set random cover time from cover and move to it done = false; time = Random.Range(currentCover.TimeInCover.x, currentCover.TimeInCover.y); controller?.ForceMoveTo(currentCover.transform.position); }
/// <inheritdoc/> public override void Init(AIEntity entity) { base.Init(entity); weaponBehaviour = new AIWeaponBehaviour(entity); walkRand = new AIWalkRandPos(entity, new Vector2(1, 2), 3.5f); //Move to last player position and setup timer if (!entity.InFear) { controller?.MoveTo(entity.Data.lastSeenPlayerPosition); } entity.Data.currentAggresionWaitTime = entity.Data.AggresionWaitTime; entity.Sensors.OnHearSound += Sensors_OnHearSound; if (controller && Utils.CalculateChance(controller.CoverOnAggressionChance) && !entity.InFear) { controller.GetCover(); } }