예제 #1
0
    public void SpawnTail()
    {
        GameObject        tailObject   = Instantiate(TailPrefab);
        snakeGridFollower tailFollower = tailObject.GetComponent <snakeGridFollower>();

        if (tail != null)
        {
            tailObject.transform.position = tail.currentBlock;
            tail.tail = tailFollower;
            this.tail = tail.tail;
        }
        else
        {
            tailObject.transform.position = previousBlock;
            this.tail  = tailFollower;
            this.child = tailFollower;
        }
        tailFollower.speed = this.speed;
    }