Ejemplo n.º 1
0
        private TailNode CreateTileNode(int pX, int pY)
        {
            TailNode InTailNode = new TailNode();

            InTailNode._Node   = GetNode(pX, pY);
            InTailNode._Object = new GameObject();
            InTailNode._Object.transform.parent     = mTailParentObject.transform;
            InTailNode._Object.transform.position   = InTailNode._Node._WorldPos;
            InTailNode._Object.transform.localScale = Vector3.one * 0.95f;
            SpriteRenderer InSpriteRenderer = InTailNode._Object.AddComponent <SpriteRenderer>();

            InSpriteRenderer.sprite       = mPlayerSprite;
            InSpriteRenderer.sortingOrder = 1;
            return(InTailNode);
        }
Ejemplo n.º 2
0
        private void MoveTail()
        {
            Node InPreviousNode = null;

            for (int i = 0; i < mTailNodes.Count; i++)
            {
                TailNode InTailNode = mTailNodes[i];
                mAvailableNodes.Add(InTailNode._Node);
                if (i == 0)
                {
                    InPreviousNode   = InTailNode._Node;
                    InTailNode._Node = mPlayerNode;
                }
                else
                {
                    Node InPreviousNode1 = InTailNode._Node;
                    InTailNode._Node = InPreviousNode;
                    InPreviousNode   = InPreviousNode1;
                }
                mAvailableNodes.Remove(InTailNode._Node);
                PlacePlayerObject(InTailNode._Object, InTailNode._Node._WorldPos);
            }
        }