コード例 #1
0
 // Use this for initialization
 void Start()
 {
     target = GameObject.FindGameObjectWithTag("Player");
     gridManager = GameObject.FindGameObjectWithTag("GridManager").GetComponent<SceneGridManager>();
     CircleCollider2D collider = this.gameObject.GetComponent<CircleCollider2D>();
     gridManager.registerObject(this.gameObject, collider.transform.position.x, collider.transform.position.y, collider.radius * 2, collider.radius * 2, 5);
     rb2d = GetComponent<Rigidbody2D>();
     algorithms = this.gameObject.GetComponent<NavigationAlgorithms>();
     effectiveSpeed = speed + Random.Range(-speedRandFactor, speedRandFactor);
 }
コード例 #2
0
 void Start()
 {
     gridManager = GameObject.FindGameObjectWithTag("GridManager").GetComponent<SceneGridManager>();
     BoxCollider2D collider = this.gameObject.GetComponent<BoxCollider2D>();
     gridManager.registerObject(this.gameObject, collider.transform.position.x, collider.transform.position.y, collider.size.x, collider.size.y, 5);
 }