void Start() { worldController = GameObject.Find("世界の仕組みそのもの").GetComponent <WorldController>(); enemyDate.parentEnemyPrefab = this.transform.GetComponent <EnemyPrefab>(); agent = GetComponent <NavMeshAgent>(); //target = GameObject.Find("Hero").transform; try{ target = serchTag(gameObject, "Hero").transform; heroPrefab = target.gameObject.GetComponent <HeroPrefab>(); } catch { target = null; Debug.Log("aaa"); } // GetDate(1); // hero = GameObject.Find("Hero"); StartCoroutine("AttackAnimeStart"); points = new Vector3[5]; points[0] = new Vector3(this.transform.position.x + 5, this.transform.position.y, this.transform.position.z + 5); points[1] = new Vector3(this.transform.position.x - 5, this.transform.position.y, this.transform.position.z + 5); points[2] = new Vector3(this.transform.position.x + 5, this.transform.position.y, this.transform.position.z - 5); points[3] = new Vector3(this.transform.position.x - 5, this.transform.position.y, this.transform.position.z - 5); points[4] = new Vector3(this.transform.position.x, this.transform.position.y, this.transform.position.z); roamflag = true; agent.speed = MovementSpeed; }
private void Start() { worldController = GameObject.Find("世界の仕組みそのもの").GetComponent <WorldController>(); enemyDate.parentEnemyPrefab = this.transform.GetComponent <EnemyPrefab>(); try { target = serchTag(gameObject, "Hero").transform; heroPrefab = target.gameObject.GetComponent <HeroPrefab>(); } catch { target = null; Debug.Log("aaa"); } battleMode = false; StartCoroutine("AttackAnimeStart"); }
public void Test()//ヒーローが誕生した時に呼ぶ。ターゲットを設定するため。 { target = serchTag(gameObject, "Hero").transform; heroPrefab = target.gameObject.GetComponent <HeroPrefab>(); }