SKTexture: Error loading image resource: “Tile_-4412407809”

前端 未结 1 1909
萌比男神i
萌比男神i 2021-01-22 14:59

I\'m trying to find out what is causing this Tile_xxxxx name to be some sort of long random number in this code.

SKTexture: Error loading image resource: \"Tile_         


        
1条回答
  •  北恋
    北恋 (楼主)
    2021-01-22 15:46

    Fixed.

    Change

    var value = topLeft.hashable
    value = value | topRight.hashable << 1
    value = value | bottomLeft.hashable << 2
    value = value | bottomRight.hashable << 3
    
    to
    
    var value = (topLeft ? 1 : 0)
    value = value | (topRight ? 1 : 0) << 1
    value = value | (bottomLeft ? 1 : 0) << 2
    value = value | (bottomRight ? 1 : 0) << 3
    

    0 讨论(0)
提交回复
热议问题