void JumpProcess() { if (fCurrentYPosotion > STAYGRAVITY && direction == ENEMYDIRECETION.ENEMYJUMP) { fCurrentYPosotion -= fGravity; fGravity += jump_accell; } else { direction = ENEMYDIRECETION.ENEMYSTOP; fCurrentYPosotion = y_base; fGravity = STAYGRAVITY; } }
void Start() { trMonster = this.gameObject.GetComponent <Transform>(); trPlayer = GameObject.FindWithTag("Player").GetComponent <Transform>(); if (0 < transform.position.y) { fCurrentYPosotion = transform.position.y; direction = ENEMYDIRECETION.ENEMYJUMP; } StartCoroutine(this.checkEnemyState()); StartCoroutine(this.enemyAction()); }
void Start() { trMonster = this.gameObject.GetComponent <Transform>(); try { trPlayer = GameObject.FindWithTag("Player").GetComponent <Transform>(); } catch { state = ENEMYSTATE.ENEMYRUN; Debug.Log("Game Over - over code 01"); trPlayer = null; } if (0 < transform.position.y) { fCurrentYPosotion = transform.position.y; direction = ENEMYDIRECETION.ENEMYJUMP; } StartCoroutine(this.checkEnemyState()); StartCoroutine(this.enemyAction()); }