public CubulonBotShooting(BotBrain brain) : base(brain) { _delay = brain._enemyController.GetComponent <Animator>().runtimeAnimatorController.animationClips.ToList() .Find(x => x.name.Equals("DownLeft")).length; _nextShotTime = Time.time + _delay; _projectile = Resources.Load <GameObject>("Prefabs/Projectiles/BlueProjectile"); }
public override void CreateNewCharacter() { base.CreateNewCharacter(); BotBrain botBrain = GetComponentInChildren <PlayerMovement>().gameObject.AddComponent <BotBrain>(); botBrain.aiController = aiController; }
// OnStateEnter is called when a transition starts and the state machine starts to evaluate this state override public void OnStateEnter(Animator animator, AnimatorStateInfo stateInfo, int layerIndex) { botBrain = animator.GetComponent <BotBrain>(); controller = botBrain.GetComponentInParent <BotController>(); playerShoot = botBrain.GetComponent <PlayerShoot>(); playerMovement = botBrain.GetComponent <PlayerMovement>(); transform = botBrain.transform; controller.OnMove(0); }
GameObject Breed(GameObject Parent1, GameObject Parent2) { Vector3 StartingPos = new Vector3(this.transform.position.x + Random.Range(-2, 2), this.transform.position.y, this.transform.position.z + Random.Range(-2, 2)); GameObject offspring = Instantiate(BotPrefab, StartingPos, this.transform.rotation); // Gets Access to the Brain BotBrain B = offspring.GetComponent <BotBrain>(); // Mutates 1 out of 100 if (Random.Range(0, 100) == 1) { B.Init(); B.bot_DNA.Mutate(); } else { B.Init(); // Generation of OffSpring B.bot_DNA.OffSpringGen(Parent1.GetComponent <BotBrain>().bot_DNA, Parent2.GetComponent <BotBrain>().bot_DNA); } return(offspring); }
public TargetFinder(BotBrain brain) : base(brain) { brain.Target = AppModel.PlayerGameObj(); }
public MyLoderunnerBot(string serverUrl) : base(serverUrl) { _gameLoop = new GameLoop(); _botBrain = new BotBrain(_gameLoop); }
private void Start() { bot = GetComponent <Bot>(); brain = GetComponent <BotBrain>(); brain.myTarget.position = transform.position; }
private void Start() { State = new EnemyState(); _botBrain = BotBrainByType(Type, gameObject); _botBrain.OnCreate(); }
public CubulonBotMoving(BotBrain brain) : base(brain) { targets = FindPoints(); }
public BulletBotShooting(BotBrain brain) : base(brain) { _controller = Owner.GetComponent <EnemyController>(); _weapon = _controller.Weapon; }
public WormBossMoving(BotBrain brain) : base(brain) { targets = FindPoints(); }
protected BotPart(BotBrain brain) { Brain = brain; }