private void Start() { atkMng = this.gameObject.GetComponent <AtkMng>(); ani = this.gameObject.GetComponentInChildren <Animator>(); this.gameObject.GetComponentInChildren <AnimationEventReceiver>().attackHit = AttackHit; }
// Use this for initialization void Start() { mesh = new Mesh(); meshFilter = GetComponent <MeshFilter>(); meshCollider = GetComponent <MeshCollider>(); meshCollider.sharedMesh = mesh; atkMng = gameObject.GetComponentInParent <AtkMng>(); }
private void Start() { animator = this.gameObject.GetComponentInChildren <Animator>(); atkMng = this.gameObject.GetComponent <AtkMng>(); enemyWeapon = this.gameObject.GetComponentInChildren <EnemyWeapon>(); nav = this.gameObject.GetComponent <NavMeshAgent>(); enemyTakingDamage = this.gameObject.GetComponent <EnemyTakingDamage>(); Equipment(); }
private float atkTimer = 0.0f;//누르고 있으면 무한공격이 되지 않도록 만드는 변수 private void Start() { playerAnim = this.GetComponent <Animator>(); playerAbilities = this.GetComponent <PlayerAbilities>(); equipment = this.GetComponent <Equipment>(); atkMng = this.GetComponent <AtkMng>(); floorMask = LayerMask.GetMask("Floor"); //"Floor"로 layer 위치값 등록 //나중에 Update에서 갱신하도록 수정해야 함. atkTimer = 1.5f - (playerAbilities.AtkSpeed / 140); //공격속도 숫자가 커질수록 타이머 시간은 줄어듬. }
private IEnumerator Initialize() { target = GameObject.FindGameObjectWithTag("Player").transform; if (target == null) { Debug.LogError("target is null"); } myStats = this.gameObject.GetComponent <EnemyStats>(); animator = this.gameObject.GetComponentInChildren <Animator>(); atkMng = this.gameObject.GetComponent <AtkMng>(); nav = this.gameObject.GetComponent <NavMeshAgent>(); this.gameObject.GetComponentInChildren <AnimationEventReceiver>().attackHit = AttackHit; startPos = this.transform.position; nav.speed = walkSpeed; nav.stoppingDistance = attackRange; yield return(null); }