void OnTriggerEnter2D(Collider2D coll) { if (coll.gameObject.GetComponent <CharacterCombat>() != null) { CharacterCombat target = coll.gameObject.GetComponent <CharacterCombat>(); target.receiveHit(this); GetComponent <Collider2D>().enabled = false; } }
public void Interact() { CharacterCombat playerCombat = pm.player.GetComponent <CharacterCombat>(); if (playerCombat != null) { playerCombat.Attack(myStats); } }
// Start is called before the first frame update void Start() { // Main interaction with target target = PlayerManager.instance.PlayerGO.transform; // Movement terrain agent = GetComponent <NavMeshAgent>(); // Combat status combat = GetComponent <CharacterCombat>(); }
/* * initialize variables, subscribe OnAttack to CharacterCombat delegate */ protected virtual void Start() { navmeshAgent = GetComponent <NavMeshAgent> (); combat = GetComponent <CharacterCombat> (); //stats = GetComponent<CharacterStats> (); stats = GetComponent <EnemyStats>(); combat.OnAttack += OnAttack; stats.OnDeath += OnDeath; }
private void Start() { target = PlayerManager.instance.player.transform; agent = GetComponent <NavMeshAgent>(); combat = GetComponent <CharacterCombat>(); //agent.updatePosition = false; //agent.updateRotation = false; //https://answers.unity.com/questions/889836/using-unity-navigation-in-a-fixed-timestep.html }
public override void Interact() { base.Interact(); CharacterCombat playerCombat = playerManager.GetComponent <CharacterCombat>(); if (playerCombat != null) { playerCombat.Attack(myStats); } }
int m_CurrentWaypointIndex = 0; //Holds the current index of the Patrol AI private void Awake() { m_Mover = GetComponent <CharacterMovement>(); m_Combat = GetComponent <CharacterCombat>(); m_Health = GetComponent <Health>(); m_Player = GameObject.FindWithTag("Player"); m_ActionScheduler = GetComponent <ActionScheduler>(); m_StartPosition = new LazyValue <Vector3>(GetStartingPosition); }
public override void Interact() { base.Interact(); CharacterCombat playerCombat = GameObject.FindGameObjectWithTag("Player").GetComponent <CharacterCombat>(); if (playerCombat != null) { playerCombat.Attack(myStats); } }
// Update is called once per frame public override void Use() { base.Use() CharacterCombat playerCombat = player.player.GetComponent <CharcterCombat>(); if (playerCombat != null) { playerCombat.Attack(myStats); } }
// Start is called before the first frame update void Start() { target = PlayerManager.instance.player.transform; anim = GetComponentInChildren <Animator>(); myRigidbody = GetComponent <Rigidbody2D>(); combat = GetComponent <CharacterCombat>(); timeBetweenRandomMoveCounter = Random.Range(3f, 7f); movementTimeCounter = Random.Range(0f, 1f); }
protected virtual void Start() { agent = GetComponent <NavMeshAgent>(); animator = GetComponentInChildren <Animator>(); combat = GetComponent <CharacterCombat>(); overideController = new AnimatorOverrideController(animator.runtimeAnimatorController); animator.runtimeAnimatorController = overideController; currentAnimationAttackSet = defaultAnimationSet; }
void Awake() { monsterTr = this.gameObject.GetComponent <Transform>(); target = GameObject.FindWithTag("Player").GetComponent <Transform>(); nvAgent = this.gameObject.GetComponent <NavMeshAgent>(); animator = this.gameObject.GetComponent <Animator>(); combat = GetComponent <CharacterCombat>(); }
// Start is called before the first frame update void Start() { //if (target==null) //{ target = PlayerManager.instance.player.transform; //} agent = GetComponent <NavMeshAgent>(); combat = GetComponent <CharacterCombat>(); }
private void Start() { _rb2d = GetComponent <Rigidbody2D>(); _tilemap = GameObject.Find("Ground").GetComponent <Tilemap>(); target = PlayerManager.Instance.player.transform; targetStats = target.GetComponent <Player>(); combat = GetComponent <CharacterCombat>(); enemyStats = GetComponent <Character>(); pathfinding = GetComponent <Pathfinding>(); }
public override void Interact() { //Attack enemy oðlum yav CharacterCombat playerCombat = playerManager.player.GetComponent <CharacterCombat>(); if (playerCombat != null) { playerCombat.Attact(myStats); } }
private void OnTriggerEnter(Collider other) { if (other.gameObject.name == "Bullet_Shell") { CharacterCombat playerCombat = playerManager.player.GetComponent <CharacterCombat>(); if (playerCombat != null) { playerCombat.Attack(myStats); } } }
public override void Interact() { base.Interact(); // StartCoroutine ("InvokeAttack"); CharacterCombat playerCombat = playerManager.player.GetComponent <CharacterCombat>(); if (playerCombat != null) { playerCombat.Attack(myStats); } }
public override void Interact() { base.Interact(); CharacterCombat playerCombat = playerManager.player.GetComponent <CharacterCombat>(); if (playerCombat != null) { playerCombat.Attack(myStats); Debug.Log("you are attacking the enemy"); } }
public override void Interact() { base.Interact(); //Attack CharacterCombat pC = pM.player.GetComponent <CharacterCombat>(); if (pC != null) { pC.Attack(myStats); } }
public override void Interact() { base.Interact(); // Attack the enemy playerCombat = playerManager.player.GetComponent <CharacterCombat>(); if (playerCombat != null) { Debug.LogError("isBeingAttacked = true"); isBeingAttacked = true; // Player loop attack } }
// Use this for initialization void Start() { // Get Player position this.target = PlayerManager.instance.player.transform; // Get NavMeshAgent this.agent = GetComponent <NavMeshAgent>(); // Get combat stats for this enemy this.combat = GetComponent <CharacterCombat>(); }
public override void Interact() { base.Interact(); CharacterCombat playerCombat = playerManager.player.GetComponent <CharacterCombat>(); if (playerCombat != null) { Debug.Log(transform.name + "attack "); playerCombat.Attack(myStats); } }
void BeginCombat(CharacterStats playerStats) { GameManager.instance.campSelect.allowMovement = false; SwitchTarget(); for (int i = 0; i < enemies.Count; i++) { CharacterCombat enemyCombat = enemies[i].GetComponent <CharacterCombat>(); enemyCombat.Attack(playerStats); } }
/* * initialize variables, subscribe OnAttack to CharacterCombat delegate * */ protected virtual void Start() { stats = Player.instance.playerStats; stats.OnDeath += OnDeath; //animator = GetComponent<Animator>(); ac = GetComponentInChildren <PlayerController2>(); navmeshAgent = GetComponent <NavMeshAgent> (); combat = GetComponent <CharacterCombat> (); combat.OnAttack += OnAttack; //destructable = GetComponent<Destructable>(); //destructable.OnAttack += OnAttack; }
void Start() { joystick = FindObjectOfType <Joystick>(); animator = GetComponent <Animator>(); charCombat = this.GetComponent <CharacterCombat>(); charCombat.getHurtAction += onHurt; charCombat.onDeathAction += death; rigidbody = GetComponent <Rigidbody2D>(); RegisterTickRev(); prevPosition = transform.position; nextPosition = transform.position; }
void Start() { patrol = GetComponent <Patrol2>(); animator = GetComponent <Animator>(); target = PlayerManager.instance.player.transform; agent = GetComponent <NavMeshAgent>(); combat = GetComponent <CharacterCombat>(); hidingEye = GameObject.Find("HidingEye").GetComponent <Image>(); playerController = GameObject.Find("unicorn").GetComponent <PlayerController2>(); targetStats = target.GetComponent <CharacterStats>(); patrol2 = GetComponentsInChildren <Patrol2>(); }
// Start is called before the first frame update void Start() { // we would use GameObject.FindGameWithTag // but we wwould have to search thru the objects in our scene // instead we would have a script to keep track with the player target = PlayerManager.instance.player.transform; agent = GetComponent <NavMeshAgent>(); combat = GetComponent <CharacterCombat>(); }
public override void Interact() { base.Interact(); // Attack CharacterCombat playerCombat = playerManager.player.GetComponent <CharacterCombat>(); if (playerCombat != null) { Debug.Log("DAMAGE: " + (myStats.damage.GetValue())); playerCombat.Attack(myStats); } }
private void Awake() { m_Behaviours = GetComponents <IBehaviour>(); m_ExecutingBehaviours = new Dictionary <IBehaviour, float>(); m_CharacterCombat = GetComponent <CharacterCombat>(); m_Random = new Random(); foreach (var behaviour in m_Behaviours) { behaviour.Initialize(m_Random); } }
public override void Interact() { base.Interact(); CharacterCombat _playerCombat = PlayerManager.ins.player.GetComponent <CharacterCombat> (); //Debug.Log(_playerCombat); if (_playerCombat != null) { _playerCombat.Attack(myStats); } }