示例#1
0
 void Update()
 {
     if (pointSpawner.GetSnakeLength() > 0)
     {
         GetInput();
         Move();
     }
 }
示例#2
0
 private void OnTriggerEnter2D(Collider2D col)
 {
     if (col.transform.CompareTag("Snake"))
     {
         pointSpawner.AddBodyToList(this);
         transform.name = pointSpawner.GetSnakeLength().ToString();
         transform.SetParent(FindObjectOfType <Snake>().transform);
         Vector3 _pos = GetNextPosition();
         transform.position = _pos;
         GetComponent <CircleCollider2D>().isTrigger = false;
     }
 }