virtual protected void Start() { _pv = PhotonView.Get(this); _ais = GetComponent <AIScanner> (); _aimh = GetComponent <AIMovementHandler> (); _aish = GetComponent <AIStatusHandler> (); _ch = GetComponent <CombatHandler> (); }
void Start() { _ch = GetComponent <CombatHandler> (); _aimh = GetComponent <AIMovementHandler> (); _csh = GetComponent <CharacterStatusHandler> (); //dev // InvokeRepeating ("Scan", 1f, _scanInterval); }
// Start is called before the first frame update void Start() { chunkSize = ObstacleController.instance.ChunkSize; AIMovementHandler = GetComponent <AIMovementHandler>(); entity = convertedEntityHolder.GetEntity(); entityManager = convertedEntityHolder.GetEntityManager(); //AddNearbyEnemy(startingNearbyObject); //NearbyEnemies.Add(enemyTest); }
/// <summary> /// Gets the near alive player position to spawn a revived / connecting player /// </summary> /// <returns>The near alive player position.</returns> Vector3?getNearAlivePlayerPos(AIMovementHandler alivePlayer) { Vector3?pos = null; int rand = Random.Range(0, alivePlayer.MeleeSlots.Count); foreach (var slot in alivePlayer.GetComponent <AIMovementHandler>().MeleeSlots) { //check if position is movable if (alivePlayer.IsCellWalkable(slot.POS)) { pos = slot.POS; } } return(pos); }
/// <summary> /// Called when this character dies /// </summary> protected override void die() { base.die(); //do below only for AIStatusHandlers(Non-player units) // if (!(this is AIStatusHandler)) // return; if (Type != TYPE.NON_PLAYER_AI) { return; } // //dev // DevAISpawner.DAIS.DisplayRemainingEnemyCount (); //Network //destroy object after duration destroyObject(20f); // Invoke ("destroyObject", 20f); //remove this character from dynamic obstacle AIMovementHandler.UpdateDynamicAINumbers(); }
void DoBumperDamage(Collision2D col) { if (_animator._bumperActive) { _mainCamera.ShouldJitterCamera = true; Vector3 direction = col.gameObject.transform.position - transform.parent.transform.position; float _thisMomemtum = GetComponentInParent <EntityMovementHandler>().GetForce; float _otherMomentum = col.gameObject.GetComponent <EntityMovementHandler>().GetForce; float _momemtumDiff = Mathf.Abs(Mathf.Abs(_thisMomemtum) - Mathf.Abs(_otherMomentum)); float entityDamage = Constants.BUMPER_DAMAGE_BASE; if (col.gameObject.GetComponent <EntityMovementHandler>().GetType() == typeof(MovementHandler)) { MovementHandler _movementHandler = (MovementHandler)col.gameObject.GetComponent <EntityMovementHandler>(); _movementHandler.DoDamage(entityDamage); } else if (col.gameObject.GetComponent <EntityMovementHandler>().GetType() == typeof(AIMovementHandler)) { AIMovementHandler _aiMovementHandler = (AIMovementHandler)col.gameObject.GetComponent <EntityMovementHandler>(); _aiMovementHandler.DoDamage(entityDamage); } col.gameObject.GetComponent <Rigidbody2D>().AddForce(direction.normalized * _momemtumDiff * 5.0f); _hit = true; } }
// Start is called before the first frame update void Start() { AIMovementHandler = GetComponentInParent <AIMovementHandler>(); forceOverLifetimeModule = particleSystem.forceOverLifetime; }