private void RemoveBradley(BradleyAPC bradley) { if (bradley == null || (bradley?.IsDestroyed ?? true)) { return; } bradley.Kill(); }
private void OnBradleyApcInitialize(BradleyAPC bradley) { bradley._maxHealth = configs.options.startHealth; bradley.health = bradley._maxHealth; bradley.viewDistance = configs.options.maxTurretRange; bradley.searchRange = configs.options.maxTurretRange; bradley.throttle = configs.options.speed; // TODO: Ensure Bradley speed. bradley.leftThrottle = bradley.throttle; bradley.rightThrottle = bradley.throttle; bradley.maxCratesToSpawn = configs.options.maxLootCrates; // Ensures there is a AI path to follow. Vector3 position = BradleySpawner.singleton.path.interestZones[UnityEngine.Random.Range(0, BradleySpawner.singleton.path.interestZones.Count)].transform.position; bradley.transform.position = position; bradley.DoAI = true; bradley.DoSimpleAI(); bradley.InstallPatrolPath(BradleySpawner.singleton.path); if (!configs.options.bradleyEnabled) { bradley.Kill(); } }