/// <summary> /// ゲームオブジェクトを登録する /// </summary> /// <param name="target">ターゲットのゲームオブジェクト</param> void RegisterObject(GameObject target) { MortonAgent agent = target.GetComponent <MortonAgent>(); if (agent == null) { Debug.LogWarningFormat("Augument must have a `MortonAgent` component. {0}", target); return; } agent.Manager = _manager; }
void Update() { // Check collisions _manager.GetAllCollisionList(_collisionList); if (Input.GetKeyDown(KeyCode.A)) { GameObject obj = Instantiate(_agentPrefab); float s = Random.Range(0.5f, 2.5f); obj.transform.localScale = Vector3.one * s; MortonAgent agent = obj.GetComponent <MortonAgent>(); agent.Manager = _manager; } }