void Start() { monsterTransform = this.gameObject.GetComponent <Transform>(); playerTransform = GameObject.FindWithTag("Player").GetComponent <Transform>(); navAgent = this.gameObject.GetComponent <NavMeshAgent>(); alienAnimator = GetComponent <Animator>(); alienHP = this.GetComponentInChildren <MonsterHP>(); navAgent.destination = playerTransform.position + attackDistance * Vector3.forward; //플레이어를 목적지로 설정 int randNum = Random.Range(1, 4); if (randNum == 1) { monsterTransform.position = (monsterTransform.transform.position + 2 * Vector3.forward); } else if (randNum == 2) { monsterTransform.transform.position = (monsterTransform.transform.position + 2 * Vector3.back); } else if (randNum == 3) { monsterTransform.transform.position = (monsterTransform.transform.position + 2 * Vector3.right); } else { monsterTransform.transform.position = (monsterTransform.transform.position + 2 * Vector3.left); } StartCoroutine(this.CheckState()); // 몬스터 상태체크 StartCoroutine(this.CheckStateForAnimation()); // 상태에 따른 애니메이션 }
void Start() { colliderTable.Clear(); headSet.Clear(); GameObject bruteObject = GameObject.Find("Brute"); MonsterHP brute = bruteObject.GetComponent <Brute> ().monster; Collider[] bruteCollider = bruteObject.GetComponentsInChildren <Collider> (); for (int i = 0; i < bruteCollider.Length; ++i) { colliderTable.Add(bruteCollider [i], brute); } Collider bruteHead = bruteObject.GetComponentInChildren <SphereCollider> (); headSet.Add(bruteHead); Transform ghostPool = GameObject.Find("GhostPool").transform; int ghostPoolSize = ghostPool.gameObject.GetComponent <ObjectPool> ().poolSize; for (int i = 0; i < ghostPoolSize; ++i) { Transform ghost = ghostPool.GetChild(i); MonsterHP monster = ghost.gameObject.GetComponent <Ghost> ().monster; Collider[] ghostCollider = ghost.gameObject.GetComponents <Collider> (); for (int j = 0; j < ghostCollider.Length; ++j) { colliderTable.Add(ghostCollider [j], monster); } Collider ghostHead = ghost.gameObject.GetComponent <SphereCollider> (); headSet.Add(ghostHead); } }
void Awake() { AudioSource hurtSound = GetComponent <AudioSource> (); FadeImage skull = GameObject.Find("Skull").GetComponent <FadeImage> (); monster = new MonsterHP(hurtSound, hurtSound, skull); }
private void Start() { Set_command(); _rigid = GetComponent <Rigidbody>(); HP = GetComponent <MonsterHP>(); HP.HPInit(); }
private void Start() { boss = this.GetComponentInParent <BossControl>(); bosshp = GameObject.Find("BossHPCanvas01").GetComponent <MonsterHP>(); bossAni = this.GetComponentInParent <Animator>(); spawnPoint.gameObject.SetActive(false); timer = 0f; //this.gameObject.SetActive(false); }
private float deadTime = 4f; // 죽는 시간 void Start() { bossTransform = this.gameObject.GetComponent <Transform>(); playerTransform = GameObject.FindWithTag("Player").GetComponent <Transform>(); navAgent = this.gameObject.GetComponent <NavMeshAgent>(); bossAnimator = GetComponent <Animator>(); bossHP = this.GetComponentInChildren <MonsterHP>(); shield = transform.Find("Shield").gameObject; navAgent.destination = playerTransform.position + attackDistance * Vector3.forward; //플레이어를 목적지로 설정 StartCoroutine(this.CheckState()); // 몬스터 상태체크 StartCoroutine(this.CheckStateForAnimation()); // 상태에 따른 애니메이션 }
public void ScoreSetting() { GateTrophy = Character.instance.gateNum; MonsterHP = Character.instance.sumMonsterHpNum; BossHp = FinalBattle.instance.doomTrack - Boss.instance.BossDoomTrack; ItemAmount = Character.instance.characterInventory.Count; Clue = Character.instance.clue; Basic = FinalBattle.instance.doomTrack - TerrorLevel.instance.terrorlevel; num1.text = Basic.ToString(); num2.text = BossHp.ToString(); num3.text = GateTrophy.ToString(); num4.text = MonsterHP.ToString(); num5.text = Clue.ToString(); num6.text = Score().ToString(); }
void Start() { hpSliderObject = transform.Find("HPCanvas/HPSlider").gameObject; hpSlider = hpSliderObject.GetComponent <UnityEngine.UI.Slider> (); if (gameObject.name == "Brute") { monster = GetComponent <Brute> ().monster; hpBar = transform.Find("hipcontrol/hpbar"); } else // Ghost { monster = GetComponent <Ghost> ().monster; hpBar = transform.Find("HpBar"); } Camera characterCamera = GameObject.Find("Character/Camera").GetComponent <Camera> (); Canvas canvas = transform.Find("HPCanvas").gameObject.GetComponent <Canvas> (); canvas.worldCamera = characterCamera; canvas.planeDistance = 1.0f; }
// Use this for initialization void Start() { monsterHP = this; }
private void Start() { Set_State(BossState.STATE_Start); HP = GetComponent <MonsterHP>(); HP.HPInit(); }
void Start() { monsterHp = this.GetComponentInChildren <MonsterHP>(); monster = this.GetComponent <MonsterControl>(); hpCanvas = this.GetComponentInChildren <CanvasGroup>(); }
protected virtual void Start() { HP = GetComponent <MonsterHP>(); HP.HPInit(); Move.MoveStart(); }
void Awake() { FadeImage skull = GameObject.Find("Skull").GetComponent <FadeImage> (); monster = new MonsterHP(hurtSound, dieSound, skull); }