delete godot 3.x demo
|
@ -1,7 +0,0 @@
|
|||
[gd_resource type="Environment" load_steps=2 format=2]
|
||||
|
||||
[sub_resource type="ProceduralSky" id=1]
|
||||
|
||||
[resource]
|
||||
background_mode = 2
|
||||
background_sky = SubResource( 1 )
|
|
@ -1,33 +0,0 @@
|
|||
const ComplexObject = preload("res://gdProtocol/packet/ComplexObject.gd")
|
||||
const NormalObject = preload("res://gdProtocol/packet/NormalObject.gd")
|
||||
const ObjectA = preload("res://gdProtocol/packet/ObjectA.gd")
|
||||
const ObjectB = preload("res://gdProtocol/packet/ObjectB.gd")
|
||||
const SimpleObject = preload("res://gdProtocol/packet/SimpleObject.gd")
|
||||
|
||||
const protocols = {}
|
||||
|
||||
static func getProtocol(protocolId: int):
|
||||
return protocols[protocolId]
|
||||
|
||||
static func newInstance(protocolId: int):
|
||||
var protocol = protocols[protocolId]
|
||||
return protocol.new()
|
||||
|
||||
static func write(buffer, packet):
|
||||
var protocolId: int = packet.PROTOCOL_ID
|
||||
buffer.writeShort(protocolId)
|
||||
var protocol = protocols[protocolId]
|
||||
protocol.write(buffer, packet)
|
||||
|
||||
static func read(buffer):
|
||||
var protocolId = buffer.readShort();
|
||||
var protocol = protocols[protocolId]
|
||||
var packet = protocol.read(buffer);
|
||||
return packet;
|
||||
|
||||
static func initProtocol():
|
||||
protocols[100] = ComplexObject
|
||||
protocols[101] = NormalObject
|
||||
protocols[102] = ObjectA
|
||||
protocols[103] = ObjectB
|
||||
protocols[104] = SimpleObject
|
|
@ -1,664 +0,0 @@
|
|||
const ProtocolManager = preload("res://gdProtocol/ProtocolManager.gd")
|
||||
|
||||
const EMPTY: String = ""
|
||||
|
||||
var buffer = StreamPeerBuffer.new()
|
||||
|
||||
var writeOffset: int = 0 setget setWriteOffset, getWriteOffset
|
||||
var readOffset: int = 0 setget setReadOffset, getReadOffset
|
||||
|
||||
func _init():
|
||||
buffer.big_endian = true
|
||||
|
||||
# -------------------------------------------------get/set-------------------------------------------------
|
||||
func setWriteOffset(writeIndex: int) -> void:
|
||||
if (writeIndex > buffer.get_size()):
|
||||
var template = "writeIndex[{}] out of bounds exception: readerIndex: {}, writerIndex: {} (expected: 0 <= readerIndex <= writerIndex <= capacity: {})"
|
||||
printerr(template.format([writeIndex, readOffset, writeOffset, buffer.size()], "{}"))
|
||||
return
|
||||
writeOffset = writeIndex
|
||||
|
||||
func getWriteOffset() -> int:
|
||||
return writeOffset
|
||||
|
||||
func setReadOffset(readIndex: int) -> void:
|
||||
if (readIndex > writeOffset):
|
||||
var template = "readIndex[{}] out of bounds exception: readerIndex: {}, writerIndex: {} (expected: 0 <= readerIndex <= writerIndex <= capacity: {})"
|
||||
printerr(template.format([readIndex, readOffset, writeOffset, buffer.size()], "{}"))
|
||||
return
|
||||
readOffset = readIndex
|
||||
|
||||
func getReadOffset() -> int:
|
||||
return readOffset
|
||||
|
||||
func isReadable() -> bool:
|
||||
return writeOffset > readOffset
|
||||
|
||||
# -------------------------------------------------write/read-------------------------------------------------
|
||||
func writePoolByteArray(value: PoolByteArray):
|
||||
var length = value.size()
|
||||
buffer.put_partial_data(value)
|
||||
writeOffset += length
|
||||
|
||||
func writeBool(value: bool) -> void:
|
||||
var byte = 0
|
||||
if (value):
|
||||
byte = 1
|
||||
buffer.seek(writeOffset)
|
||||
buffer.put_8(byte)
|
||||
writeOffset += 1
|
||||
|
||||
func readBool() -> bool:
|
||||
buffer.seek(readOffset)
|
||||
var byte = buffer.get_8()
|
||||
readOffset += 1
|
||||
return byte == 1
|
||||
|
||||
func writeByte(value: int) -> void:
|
||||
buffer.seek(writeOffset)
|
||||
buffer.put_8(value)
|
||||
writeOffset += 1
|
||||
|
||||
func readByte() -> int:
|
||||
buffer.seek(readOffset)
|
||||
var value = buffer.get_8()
|
||||
readOffset += 1
|
||||
return value
|
||||
|
||||
func writeShort(value: int) -> void:
|
||||
buffer.seek(writeOffset)
|
||||
buffer.put_16(value)
|
||||
writeOffset += 2
|
||||
|
||||
func readShort() -> int:
|
||||
buffer.seek(readOffset)
|
||||
var value = buffer.get_16()
|
||||
readOffset += 2
|
||||
return value
|
||||
|
||||
func writeInt(value) -> void:
|
||||
writeLong(value)
|
||||
|
||||
func readInt() -> int:
|
||||
return readLong()
|
||||
|
||||
func writeLong(longValue: int) -> void:
|
||||
var value = (longValue << 1) ^ (longValue >> 63)
|
||||
|
||||
if (value >> 7 == 0):
|
||||
writeByte(value)
|
||||
return
|
||||
|
||||
if (value >> 14 == 0):
|
||||
writeByte(value | 0x80)
|
||||
writeByte(value >> 7)
|
||||
return
|
||||
|
||||
if (value >> 21 == 0):
|
||||
writeByte(value | 0x80)
|
||||
writeByte((value >> 7) | 0x80)
|
||||
writeByte(value >> 14)
|
||||
return
|
||||
|
||||
if (value >> 28 == 0):
|
||||
writeByte(value | 0x80)
|
||||
writeByte((value >> 7) | 0x80)
|
||||
writeByte((value >> 14) | 0x80)
|
||||
writeByte(value >> 21)
|
||||
return
|
||||
|
||||
if (value >> 35 == 0):
|
||||
writeByte(value | 0x80)
|
||||
writeByte((value >> 7) | 0x80)
|
||||
writeByte((value >> 14) | 0x80)
|
||||
writeByte((value >> 21) | 0x80)
|
||||
writeByte(value >> 28)
|
||||
return
|
||||
|
||||
if (value >> 42 == 0):
|
||||
writeByte(value | 0x80)
|
||||
writeByte((value >> 7) | 0x80)
|
||||
writeByte((value >> 14) | 0x80)
|
||||
writeByte((value >> 21) | 0x80)
|
||||
writeByte((value >> 28) | 0x80)
|
||||
writeByte(value >> 35)
|
||||
return
|
||||
|
||||
if (value >> 49 == 0):
|
||||
writeByte(value | 0x80)
|
||||
writeByte((value >> 7) | 0x80)
|
||||
writeByte((value >> 14) | 0x80)
|
||||
writeByte((value >> 21) | 0x80)
|
||||
writeByte((value >> 28) | 0x80)
|
||||
writeByte((value >> 35) | 0x80)
|
||||
writeByte(value >> 42)
|
||||
return
|
||||
|
||||
if (value >> 56 == 0):
|
||||
writeByte(value | 0x80)
|
||||
writeByte((value >> 7) | 0x80)
|
||||
writeByte((value >> 14) | 0x80)
|
||||
writeByte((value >> 21) | 0x80)
|
||||
writeByte((value >> 28) | 0x80)
|
||||
writeByte((value >> 35) | 0x80)
|
||||
writeByte((value >> 42) | 0x80)
|
||||
writeByte(value >> 49)
|
||||
return
|
||||
|
||||
writeByte(value | 0x80)
|
||||
writeByte((value >> 7) | 0x80)
|
||||
writeByte((value >> 14) | 0x80)
|
||||
writeByte((value >> 21) | 0x80)
|
||||
writeByte((value >> 28) | 0x80)
|
||||
writeByte((value >> 35) | 0x80)
|
||||
writeByte((value >> 42) | 0x80)
|
||||
writeByte((value >> 49) | 0x80)
|
||||
writeByte(value >> 56)
|
||||
|
||||
func readLong() -> int:
|
||||
var byte: int = readByte()
|
||||
var value: int = byte
|
||||
if (byte < 0):
|
||||
byte = readByte()
|
||||
value = value & 0x00000000_0000007F | byte << 7
|
||||
if (byte < 0):
|
||||
byte = readByte()
|
||||
value = value & 0x00000000_00003FFF | byte << 14
|
||||
if (byte < 0):
|
||||
byte = readByte()
|
||||
value = value & 0x00000000_001FFFFF | byte << 21
|
||||
if (byte < 0):
|
||||
byte = readByte()
|
||||
value = value & 0x00000000_0FFFFFFF | byte << 28
|
||||
if (byte < 0):
|
||||
byte = readByte()
|
||||
value = value & 0x00000007_FFFFFFFF | byte << 35
|
||||
if (byte < 0):
|
||||
byte = readByte()
|
||||
value = value & 0x000003FF_FFFFFFFF | byte << 42
|
||||
if (byte < 0):
|
||||
byte = readByte()
|
||||
value = value & 0x0001FFFF_FFFFFFFF | byte << 49
|
||||
if (byte < 0):
|
||||
byte = readByte()
|
||||
value = value & 0x00FFFFFF_FFFFFFFF | byte << 56
|
||||
|
||||
var mask = value >> 1
|
||||
if (mask < 0):
|
||||
mask = mask & 0x7FFFFFFF_FFFFFFFF
|
||||
return mask ^ -(value & 1)
|
||||
|
||||
|
||||
func writeFloat(value: float) -> void:
|
||||
buffer.seek(writeOffset)
|
||||
buffer.put_float(value)
|
||||
writeOffset += 4
|
||||
|
||||
func readFloat() -> float:
|
||||
buffer.seek(readOffset)
|
||||
var value = buffer.get_float()
|
||||
readOffset += 4
|
||||
return value
|
||||
|
||||
func writeDouble(value: float) -> void:
|
||||
buffer.seek(writeOffset)
|
||||
buffer.put_double(value)
|
||||
writeOffset += 8
|
||||
|
||||
func readDouble() -> float:
|
||||
buffer.seek(readOffset)
|
||||
var value = buffer.get_double()
|
||||
readOffset += 8
|
||||
return value
|
||||
|
||||
|
||||
func writeString(value: String) -> void:
|
||||
if (value == null || value.length() ==0):
|
||||
writeInt(0)
|
||||
return
|
||||
|
||||
buffer.seek(writeOffset)
|
||||
|
||||
var strBytes = value.to_utf8()
|
||||
var length = strBytes.size()
|
||||
writeInt(length)
|
||||
buffer.put_partial_data(strBytes)
|
||||
writeOffset += length
|
||||
|
||||
func readString() -> String:
|
||||
var length = readInt()
|
||||
if (length <= 0):
|
||||
return EMPTY
|
||||
|
||||
buffer.seek(readOffset)
|
||||
var value = buffer.get_utf8_string(length)
|
||||
var strBytes = value.to_utf8()
|
||||
readOffset += length
|
||||
return value
|
||||
|
||||
func writeChar(value) -> void:
|
||||
if (value == null || value.length() == 0):
|
||||
writeString(EMPTY)
|
||||
return
|
||||
writeString(value[0])
|
||||
|
||||
func readChar() -> String:
|
||||
return readString()
|
||||
|
||||
func writePacketFlag(packet) -> bool:
|
||||
var flag = (packet == null)
|
||||
writeBool(!flag)
|
||||
return flag
|
||||
|
||||
func writePacket(packet, protocolId):
|
||||
var protocolRegistration = ProtocolManager.getProtocol(protocolId)
|
||||
protocolRegistration.write(self, packet)
|
||||
|
||||
func readPacket(protocolId):
|
||||
var protocolRegistration = ProtocolManager.getProtocol(protocolId)
|
||||
return protocolRegistration.read(self)
|
||||
|
||||
func newInstance(protocolId: int):
|
||||
return ProtocolManager.newInstance(protocolId)
|
||||
|
||||
func writeBooleanArray(array):
|
||||
if (array == null):
|
||||
writeInt(0)
|
||||
else:
|
||||
writeInt(array.size());
|
||||
for element in array:
|
||||
writeBool(element)
|
||||
|
||||
func readBooleanArray():
|
||||
var array = []
|
||||
var size = readInt()
|
||||
if (size > 0):
|
||||
for index in range(size):
|
||||
array.append(readBool())
|
||||
return array
|
||||
|
||||
func writeByteArray(array):
|
||||
if (array == null):
|
||||
writeInt(0)
|
||||
else:
|
||||
writeInt(array.size());
|
||||
for element in array:
|
||||
writeByte(element)
|
||||
|
||||
func readByteArray():
|
||||
var array = []
|
||||
var size = readInt()
|
||||
if (size > 0):
|
||||
for index in range(size):
|
||||
array.append(readByte())
|
||||
return array
|
||||
|
||||
func writeShortArray(array):
|
||||
if (array == null):
|
||||
writeInt(0)
|
||||
else:
|
||||
writeInt(array.size());
|
||||
for element in array:
|
||||
writeShort(element)
|
||||
|
||||
func readShortArray():
|
||||
var array = []
|
||||
var size = readInt()
|
||||
if (size > 0):
|
||||
for index in range(size):
|
||||
array.append(readShort())
|
||||
return array
|
||||
|
||||
func writeIntArray(array):
|
||||
if (array == null):
|
||||
writeInt(0)
|
||||
else:
|
||||
writeInt(array.size());
|
||||
for element in array:
|
||||
writeInt(element)
|
||||
|
||||
func readIntArray():
|
||||
var array = []
|
||||
var size = readInt()
|
||||
if (size > 0):
|
||||
for index in range(size):
|
||||
array.append(readInt())
|
||||
return array
|
||||
|
||||
func writeLongArray(array):
|
||||
if (array == null):
|
||||
writeInt(0)
|
||||
else:
|
||||
writeInt(array.size());
|
||||
for element in array:
|
||||
writeLong(element)
|
||||
|
||||
func readLongArray():
|
||||
var array = []
|
||||
var size = readInt()
|
||||
if (size > 0):
|
||||
for index in range(size):
|
||||
array.append(readLong())
|
||||
return array
|
||||
|
||||
func writeFloatArray(array):
|
||||
if (array == null):
|
||||
writeInt(0)
|
||||
else:
|
||||
writeInt(array.size());
|
||||
for element in array:
|
||||
writeFloat(element)
|
||||
|
||||
func readFloatArray():
|
||||
var array = []
|
||||
var size = readInt()
|
||||
if (size > 0):
|
||||
for index in range(size):
|
||||
array.append(readFloat())
|
||||
return array
|
||||
|
||||
func writeDoubleArray(array):
|
||||
if (array == null):
|
||||
writeInt(0)
|
||||
else:
|
||||
writeInt(array.size());
|
||||
for element in array:
|
||||
writeDouble(element)
|
||||
|
||||
func readDoubleArray():
|
||||
var array = []
|
||||
var size = readInt()
|
||||
if (size > 0):
|
||||
for index in range(size):
|
||||
array.append(readDouble())
|
||||
return array
|
||||
|
||||
func writeCharArray(array):
|
||||
if (array == null):
|
||||
writeInt(0)
|
||||
else:
|
||||
writeInt(array.size());
|
||||
for element in array:
|
||||
writeChar(element)
|
||||
|
||||
func readCharArray():
|
||||
var array = []
|
||||
var size = readInt()
|
||||
if (size > 0):
|
||||
for index in range(size):
|
||||
array.append(readChar())
|
||||
return array
|
||||
|
||||
func writeStringArray(array):
|
||||
if (array == null):
|
||||
writeInt(0)
|
||||
else:
|
||||
writeInt(array.size());
|
||||
for element in array:
|
||||
writeString(element)
|
||||
|
||||
func readStringArray():
|
||||
var array = []
|
||||
var size = readInt()
|
||||
if (size > 0):
|
||||
for index in range(size):
|
||||
array.append(readString())
|
||||
return array
|
||||
|
||||
|
||||
func writePacketArray(array, protocolId):
|
||||
if (array == null):
|
||||
writeInt(0)
|
||||
else:
|
||||
var protocolRegistration = ProtocolManager.getProtocol(protocolId)
|
||||
writeInt(array.size());
|
||||
for element in array:
|
||||
protocolRegistration.write(self, element)
|
||||
|
||||
func readPacketArray(protocolId):
|
||||
var array = []
|
||||
var size = readInt()
|
||||
if (size > 0):
|
||||
var protocolRegistration = ProtocolManager.getProtocol(protocolId)
|
||||
for index in range(size):
|
||||
array.append(protocolRegistration.read(self))
|
||||
return array
|
||||
|
||||
func writeIntIntMap(map):
|
||||
if (map == null):
|
||||
writeInt(0)
|
||||
else:
|
||||
writeInt(map.size())
|
||||
for key in map:
|
||||
writeInt(key)
|
||||
writeInt(map[key])
|
||||
|
||||
func readIntIntMap():
|
||||
var map = {}
|
||||
var size = readInt()
|
||||
if (size > 0):
|
||||
for index in range(size):
|
||||
var key = readInt()
|
||||
var value = readInt()
|
||||
map[key] = value
|
||||
return map
|
||||
|
||||
func writeIntLongMap(map):
|
||||
if (map == null):
|
||||
writeInt(0)
|
||||
else:
|
||||
writeInt(map.size())
|
||||
for key in map:
|
||||
writeInt(map)
|
||||
writeLong(map[key])
|
||||
|
||||
func readIntLongMap():
|
||||
var map = {}
|
||||
var size = readInt()
|
||||
if (size > 0):
|
||||
for index in range(size):
|
||||
var key = readInt()
|
||||
var value = readLong()
|
||||
map[key] = value
|
||||
return map
|
||||
|
||||
func writeIntStringMap(map):
|
||||
if (map == null):
|
||||
writeInt(0)
|
||||
else:
|
||||
writeInt(map.size())
|
||||
for key in map:
|
||||
writeInt(key)
|
||||
writeString(map[key])
|
||||
|
||||
func readIntStringMap():
|
||||
var map = {}
|
||||
var size = readInt()
|
||||
if (size > 0):
|
||||
for index in range(size):
|
||||
var key = readInt()
|
||||
var value = readString()
|
||||
map[key] = value
|
||||
return map
|
||||
|
||||
|
||||
func writeIntPacketMap(map, protocolId):
|
||||
if (map == null):
|
||||
writeInt(0)
|
||||
else:
|
||||
var protocolRegistration = ProtocolManager.getProtocol(protocolId)
|
||||
writeInt(map.size())
|
||||
for key in map:
|
||||
writeInt(key)
|
||||
protocolRegistration.write(self, map[key])
|
||||
|
||||
func readIntPacketMap(protocolId):
|
||||
var map = {}
|
||||
var size = readInt()
|
||||
if (size > 0):
|
||||
var protocolRegistration = ProtocolManager.getProtocol(protocolId)
|
||||
for index in range(size):
|
||||
var key = readInt()
|
||||
var value = protocolRegistration.read(self)
|
||||
map[key] = value
|
||||
return map
|
||||
|
||||
|
||||
func writeLongIntMap(map):
|
||||
if (map == null):
|
||||
writeInt(0)
|
||||
else:
|
||||
writeInt(map.size())
|
||||
for key in map:
|
||||
writeLong(key)
|
||||
writeInt(map[key])
|
||||
|
||||
func readLongIntMap():
|
||||
var map = {}
|
||||
var size = readInt()
|
||||
if (size > 0):
|
||||
for index in range(size):
|
||||
var key = readLong()
|
||||
var value = readInt()
|
||||
map[key] = value
|
||||
return map
|
||||
|
||||
func writeLongLongMap(map):
|
||||
if (map == null):
|
||||
writeInt(0)
|
||||
else:
|
||||
writeInt(map.size())
|
||||
for key in map:
|
||||
writeLong(key)
|
||||
writeLong(map[key])
|
||||
|
||||
func readLongLongMap():
|
||||
var map = {}
|
||||
var size = readInt()
|
||||
if (size > 0):
|
||||
for index in range(size):
|
||||
var key = readLong()
|
||||
var value = readLong()
|
||||
map[key] = value
|
||||
return map
|
||||
|
||||
func writeLongStringMap(map):
|
||||
if (map == null):
|
||||
writeInt(0)
|
||||
else:
|
||||
writeInt(map.size())
|
||||
for key in map:
|
||||
writeLong(key)
|
||||
writeString(map[key])
|
||||
|
||||
func readLongStringMap():
|
||||
var map = {}
|
||||
var size = readInt()
|
||||
if (size > 0):
|
||||
for index in range(size):
|
||||
var key = readLong()
|
||||
var value = readString()
|
||||
map[key] = value
|
||||
return map
|
||||
|
||||
|
||||
func writeLongPacketMap(map, protocolId):
|
||||
if (map == null):
|
||||
writeInt(0)
|
||||
else:
|
||||
var protocolRegistration = ProtocolManager.getProtocol(protocolId)
|
||||
writeInt(map.size())
|
||||
for key in map:
|
||||
writeLong(key)
|
||||
protocolRegistration.write(self, map[key])
|
||||
|
||||
func readLongPacketMap(protocolId):
|
||||
var map = {}
|
||||
var size = readInt()
|
||||
if (size > 0):
|
||||
var protocolRegistration = ProtocolManager.getProtocol(protocolId)
|
||||
for index in range(size):
|
||||
var key = readLong()
|
||||
var value = protocolRegistration.read(self)
|
||||
map[key] = value
|
||||
return map
|
||||
|
||||
|
||||
func writeStringIntMap(map):
|
||||
if (map == null):
|
||||
writeInt(0)
|
||||
else:
|
||||
writeInt(map.size())
|
||||
for key in map:
|
||||
writeString(key)
|
||||
writeInt(map[key])
|
||||
|
||||
func readStringIntMap():
|
||||
var map = {}
|
||||
var size = readInt()
|
||||
if (size > 0):
|
||||
for index in range(size):
|
||||
var key = readString()
|
||||
var value = readInt()
|
||||
map[key] = value
|
||||
return map
|
||||
|
||||
func writeStringLongMap(map):
|
||||
if (map == null):
|
||||
writeInt(0)
|
||||
else:
|
||||
writeInt(map.size())
|
||||
for key in map:
|
||||
writeString(key)
|
||||
writeLong(map[key])
|
||||
|
||||
func readStringLongMap():
|
||||
var map = {}
|
||||
var size = readInt()
|
||||
if (size > 0):
|
||||
for index in range(size):
|
||||
var key = readString()
|
||||
var value = readLong()
|
||||
map[key] = value
|
||||
return map
|
||||
|
||||
func writeStringStringMap(map):
|
||||
if (map == null):
|
||||
writeInt(0)
|
||||
else:
|
||||
writeInt(map.size())
|
||||
for key in map:
|
||||
writeString(key)
|
||||
writeString(map[key])
|
||||
|
||||
func readStringStringMap():
|
||||
var map = {}
|
||||
var size = readInt()
|
||||
if (size > 0):
|
||||
for index in range(size):
|
||||
var key = readString()
|
||||
var value = readString()
|
||||
map[key] = value
|
||||
return map
|
||||
|
||||
|
||||
func writeStringPacketMap(map, protocolId):
|
||||
if (map == null):
|
||||
writeInt(0)
|
||||
else:
|
||||
var protocolRegistration = ProtocolManager.getProtocol(protocolId)
|
||||
writeInt(map.size())
|
||||
for key in map:
|
||||
writeString(key)
|
||||
protocolRegistration.write(self, map[key])
|
||||
|
||||
func readStringPacketMap(protocolId):
|
||||
var map = {}
|
||||
var size = readInt()
|
||||
if (size > 0):
|
||||
var protocolRegistration = ProtocolManager.getProtocol(protocolId)
|
||||
for index in range(size):
|
||||
var key = readString()
|
||||
var value = protocolRegistration.read(self)
|
||||
map[key] = value
|
||||
return map
|
|
@ -1,409 +0,0 @@
|
|||
# 复杂的对象
|
||||
# 包括了各种复杂的结构,数组,List,Set,Map
|
||||
#
|
||||
# @author jaysunxiao
|
||||
# @version 3.0
|
||||
|
||||
# byte类型,最简单的整形
|
||||
var a # byte
|
||||
# byte的包装类型
|
||||
# 优先使用基础类型,包装类型会有装箱拆箱
|
||||
var aa # java.lang.Byte
|
||||
# 数组类型
|
||||
var aaa # byte[]
|
||||
var aaaa # java.lang.Byte[]
|
||||
var b # short
|
||||
var bb # java.lang.Short
|
||||
var bbb # short[]
|
||||
var bbbb # java.lang.Short[]
|
||||
var c # int
|
||||
var cc # java.lang.Integer
|
||||
var ccc # int[]
|
||||
var cccc # java.lang.Integer[]
|
||||
var d # long
|
||||
var dd # java.lang.Long
|
||||
var ddd # long[]
|
||||
var dddd # java.lang.Long[]
|
||||
var e # float
|
||||
var ee # java.lang.Float
|
||||
var eee # float[]
|
||||
var eeee # java.lang.Float[]
|
||||
var f # double
|
||||
var ff # java.lang.Double
|
||||
var fff # double[]
|
||||
var ffff # java.lang.Double[]
|
||||
var g # boolean
|
||||
var gg # java.lang.Boolean
|
||||
var ggg # boolean[]
|
||||
var gggg # java.lang.Boolean[]
|
||||
var h # char
|
||||
var hh # java.lang.Character
|
||||
var hhh # char[]
|
||||
var hhhh # java.lang.Character[]
|
||||
var jj # java.lang.String
|
||||
var jjj # java.lang.String[]
|
||||
var kk # com.zfoo.protocol.packet.ObjectA
|
||||
var kkk # com.zfoo.protocol.packet.ObjectA[]
|
||||
var l # java.util.List<java.lang.Integer>
|
||||
var ll # java.util.List<java.util.List<java.util.List<java.lang.Integer>>>
|
||||
var lll # java.util.List<java.util.List<com.zfoo.protocol.packet.ObjectA>>
|
||||
var llll # java.util.List<java.lang.String>
|
||||
var lllll # java.util.List<java.util.Map<java.lang.Integer, java.lang.String>>
|
||||
var m # java.util.Map<java.lang.Integer, java.lang.String>
|
||||
var mm # java.util.Map<java.lang.Integer, com.zfoo.protocol.packet.ObjectA>
|
||||
var mmm # java.util.Map<com.zfoo.protocol.packet.ObjectA, java.util.List<java.lang.Integer>>
|
||||
var mmmm # java.util.Map<java.util.List<java.util.List<com.zfoo.protocol.packet.ObjectA>>, java.util.List<java.util.List<java.util.List<java.lang.Integer>>>>
|
||||
var mmmmm # java.util.Map<java.util.List<java.util.Map<java.lang.Integer, java.lang.String>>, java.util.Set<java.util.Map<java.lang.Integer, java.lang.String>>>
|
||||
var s # java.util.Set<java.lang.Integer>
|
||||
var ss # java.util.Set<java.util.Set<java.util.List<java.lang.Integer>>>
|
||||
var sss # java.util.Set<java.util.Set<com.zfoo.protocol.packet.ObjectA>>
|
||||
var ssss # java.util.Set<java.lang.String>
|
||||
var sssss # java.util.Set<java.util.Map<java.lang.Integer, java.lang.String>>
|
||||
# 如果要修改协议并且兼容老协议,需要加上Compatible注解,按照增加的顺序添加order
|
||||
var myCompatible # int
|
||||
var myObject # com.zfoo.protocol.packet.ObjectA
|
||||
|
||||
const PROTOCOL_ID = 100
|
||||
|
||||
static func write(buffer, packet):
|
||||
if (buffer.writePacketFlag(packet)):
|
||||
return
|
||||
buffer.writeByte(packet.a)
|
||||
buffer.writeByte(packet.aa)
|
||||
buffer.writeByteArray(packet.aaa)
|
||||
buffer.writeByteArray(packet.aaaa)
|
||||
buffer.writeShort(packet.b)
|
||||
buffer.writeShort(packet.bb)
|
||||
buffer.writeShortArray(packet.bbb)
|
||||
buffer.writeShortArray(packet.bbbb)
|
||||
buffer.writeInt(packet.c)
|
||||
buffer.writeInt(packet.cc)
|
||||
buffer.writeIntArray(packet.ccc)
|
||||
buffer.writeIntArray(packet.cccc)
|
||||
buffer.writeLong(packet.d)
|
||||
buffer.writeLong(packet.dd)
|
||||
buffer.writeLongArray(packet.ddd)
|
||||
buffer.writeLongArray(packet.dddd)
|
||||
buffer.writeFloat(packet.e)
|
||||
buffer.writeFloat(packet.ee)
|
||||
buffer.writeFloatArray(packet.eee)
|
||||
buffer.writeFloatArray(packet.eeee)
|
||||
buffer.writeDouble(packet.f)
|
||||
buffer.writeDouble(packet.ff)
|
||||
buffer.writeDoubleArray(packet.fff)
|
||||
buffer.writeDoubleArray(packet.ffff)
|
||||
buffer.writeBool(packet.g)
|
||||
buffer.writeBool(packet.gg)
|
||||
buffer.writeBooleanArray(packet.ggg)
|
||||
buffer.writeBooleanArray(packet.gggg)
|
||||
buffer.writeChar(packet.h)
|
||||
buffer.writeChar(packet.hh)
|
||||
buffer.writeCharArray(packet.hhh)
|
||||
buffer.writeCharArray(packet.hhhh)
|
||||
buffer.writeString(packet.jj)
|
||||
buffer.writeStringArray(packet.jjj)
|
||||
buffer.writePacket(packet.kk, 102)
|
||||
buffer.writePacketArray(packet.kkk, 102)
|
||||
buffer.writeIntArray(packet.l)
|
||||
if (packet.ll == null):
|
||||
buffer.writeInt(0)
|
||||
else:
|
||||
buffer.writeInt(packet.ll.size())
|
||||
for element0 in packet.ll:
|
||||
if (element0 == null):
|
||||
buffer.writeInt(0)
|
||||
else:
|
||||
buffer.writeInt(element0.size())
|
||||
for element1 in element0:
|
||||
buffer.writeIntArray(element1)
|
||||
if (packet.lll == null):
|
||||
buffer.writeInt(0)
|
||||
else:
|
||||
buffer.writeInt(packet.lll.size())
|
||||
for element2 in packet.lll:
|
||||
buffer.writePacketArray(element2, 102)
|
||||
buffer.writeStringArray(packet.llll)
|
||||
if (packet.lllll == null):
|
||||
buffer.writeInt(0)
|
||||
else:
|
||||
buffer.writeInt(packet.lllll.size())
|
||||
for element3 in packet.lllll:
|
||||
buffer.writeIntStringMap(element3)
|
||||
buffer.writeIntStringMap(packet.m)
|
||||
buffer.writeIntPacketMap(packet.mm, 102)
|
||||
if (packet.mmm == null):
|
||||
buffer.writeInt(0)
|
||||
else:
|
||||
buffer.writeInt(packet.mmm.size())
|
||||
for key4 in packet.mmm:
|
||||
var value5 = packet.mmm[key4]
|
||||
buffer.writePacket(key4, 102)
|
||||
buffer.writeIntArray(value5)
|
||||
if (packet.mmmm == null):
|
||||
buffer.writeInt(0)
|
||||
else:
|
||||
buffer.writeInt(packet.mmmm.size())
|
||||
for key6 in packet.mmmm:
|
||||
var value7 = packet.mmmm[key6]
|
||||
if (key6 == null):
|
||||
buffer.writeInt(0)
|
||||
else:
|
||||
buffer.writeInt(key6.size())
|
||||
for element8 in key6:
|
||||
buffer.writePacketArray(element8, 102)
|
||||
if (value7 == null):
|
||||
buffer.writeInt(0)
|
||||
else:
|
||||
buffer.writeInt(value7.size())
|
||||
for element9 in value7:
|
||||
if (element9 == null):
|
||||
buffer.writeInt(0)
|
||||
else:
|
||||
buffer.writeInt(element9.size())
|
||||
for element10 in element9:
|
||||
buffer.writeIntArray(element10)
|
||||
if (packet.mmmmm == null):
|
||||
buffer.writeInt(0)
|
||||
else:
|
||||
buffer.writeInt(packet.mmmmm.size())
|
||||
for key11 in packet.mmmmm:
|
||||
var value12 = packet.mmmmm[key11]
|
||||
if (key11 == null):
|
||||
buffer.writeInt(0)
|
||||
else:
|
||||
buffer.writeInt(key11.size())
|
||||
for element13 in key11:
|
||||
buffer.writeIntStringMap(element13)
|
||||
if (value12 == null):
|
||||
buffer.writeInt(0)
|
||||
else:
|
||||
buffer.writeInt(value12.size())
|
||||
for element14 in value12:
|
||||
buffer.writeIntStringMap(element14)
|
||||
buffer.writeIntArray(packet.s)
|
||||
if (packet.ss == null):
|
||||
buffer.writeInt(0)
|
||||
else:
|
||||
buffer.writeInt(packet.ss.size())
|
||||
for element15 in packet.ss:
|
||||
if (element15 == null):
|
||||
buffer.writeInt(0)
|
||||
else:
|
||||
buffer.writeInt(element15.size())
|
||||
for element16 in element15:
|
||||
buffer.writeIntArray(element16)
|
||||
if (packet.sss == null):
|
||||
buffer.writeInt(0)
|
||||
else:
|
||||
buffer.writeInt(packet.sss.size())
|
||||
for element17 in packet.sss:
|
||||
buffer.writePacketArray(element17, 102)
|
||||
buffer.writeStringArray(packet.ssss)
|
||||
if (packet.sssss == null):
|
||||
buffer.writeInt(0)
|
||||
else:
|
||||
buffer.writeInt(packet.sssss.size())
|
||||
for element18 in packet.sssss:
|
||||
buffer.writeIntStringMap(element18)
|
||||
buffer.writeInt(packet.myCompatible)
|
||||
buffer.writePacket(packet.myObject, 102)
|
||||
|
||||
|
||||
static func read(buffer):
|
||||
if (!buffer.readBool()):
|
||||
return null
|
||||
var packet = buffer.newInstance(PROTOCOL_ID)
|
||||
var result19 = buffer.readByte()
|
||||
packet.a = result19
|
||||
var result20 = buffer.readByte()
|
||||
packet.aa = result20
|
||||
var array21 = buffer.readByteArray()
|
||||
packet.aaa = array21
|
||||
var array22 = buffer.readByteArray()
|
||||
packet.aaaa = array22
|
||||
var result23 = buffer.readShort()
|
||||
packet.b = result23
|
||||
var result24 = buffer.readShort()
|
||||
packet.bb = result24
|
||||
var array25 = buffer.readShortArray()
|
||||
packet.bbb = array25
|
||||
var array26 = buffer.readShortArray()
|
||||
packet.bbbb = array26
|
||||
var result27 = buffer.readInt()
|
||||
packet.c = result27
|
||||
var result28 = buffer.readInt()
|
||||
packet.cc = result28
|
||||
var array29 = buffer.readIntArray()
|
||||
packet.ccc = array29
|
||||
var array30 = buffer.readIntArray()
|
||||
packet.cccc = array30
|
||||
var result31 = buffer.readLong()
|
||||
packet.d = result31
|
||||
var result32 = buffer.readLong()
|
||||
packet.dd = result32
|
||||
var array33 = buffer.readLongArray()
|
||||
packet.ddd = array33
|
||||
var array34 = buffer.readLongArray()
|
||||
packet.dddd = array34
|
||||
var result35 = buffer.readFloat()
|
||||
packet.e = result35
|
||||
var result36 = buffer.readFloat()
|
||||
packet.ee = result36
|
||||
var array37 = buffer.readFloatArray()
|
||||
packet.eee = array37
|
||||
var array38 = buffer.readFloatArray()
|
||||
packet.eeee = array38
|
||||
var result39 = buffer.readDouble()
|
||||
packet.f = result39
|
||||
var result40 = buffer.readDouble()
|
||||
packet.ff = result40
|
||||
var array41 = buffer.readDoubleArray()
|
||||
packet.fff = array41
|
||||
var array42 = buffer.readDoubleArray()
|
||||
packet.ffff = array42
|
||||
var result43 = buffer.readBool()
|
||||
packet.g = result43
|
||||
var result44 = buffer.readBool()
|
||||
packet.gg = result44
|
||||
var array45 = buffer.readBooleanArray()
|
||||
packet.ggg = array45
|
||||
var array46 = buffer.readBooleanArray()
|
||||
packet.gggg = array46
|
||||
var result47 = buffer.readChar()
|
||||
packet.h = result47
|
||||
var result48 = buffer.readChar()
|
||||
packet.hh = result48
|
||||
var array49 = buffer.readCharArray()
|
||||
packet.hhh = array49
|
||||
var array50 = buffer.readCharArray()
|
||||
packet.hhhh = array50
|
||||
var result51 = buffer.readString()
|
||||
packet.jj = result51
|
||||
var array52 = buffer.readStringArray()
|
||||
packet.jjj = array52
|
||||
var result53 = buffer.readPacket(102)
|
||||
packet.kk = result53
|
||||
var array54 = buffer.readPacketArray(102)
|
||||
packet.kkk = array54
|
||||
var list55 = buffer.readIntArray()
|
||||
packet.l = list55
|
||||
var result56 = []
|
||||
var size58 = buffer.readInt()
|
||||
if (size58 > 0):
|
||||
for index57 in range(size58):
|
||||
var result59 = []
|
||||
var size61 = buffer.readInt()
|
||||
if (size61 > 0):
|
||||
for index60 in range(size61):
|
||||
var list62 = buffer.readIntArray()
|
||||
result59.append(list62)
|
||||
result56.append(result59)
|
||||
packet.ll = result56
|
||||
var result63 = []
|
||||
var size65 = buffer.readInt()
|
||||
if (size65 > 0):
|
||||
for index64 in range(size65):
|
||||
var list66 = buffer.readPacketArray(102)
|
||||
result63.append(list66)
|
||||
packet.lll = result63
|
||||
var list67 = buffer.readStringArray()
|
||||
packet.llll = list67
|
||||
var result68 = []
|
||||
var size70 = buffer.readInt()
|
||||
if (size70 > 0):
|
||||
for index69 in range(size70):
|
||||
var map71 = buffer.readIntStringMap()
|
||||
result68.append(map71)
|
||||
packet.lllll = result68
|
||||
var map72 = buffer.readIntStringMap()
|
||||
packet.m = map72
|
||||
var map73 = buffer.readIntPacketMap(102)
|
||||
packet.mm = map73
|
||||
var result74 = {}
|
||||
var size75 = buffer.readInt()
|
||||
if (size75 > 0):
|
||||
for index76 in range(size75):
|
||||
var result77 = buffer.readPacket(102)
|
||||
var list78 = buffer.readIntArray()
|
||||
result74[result77] = list78
|
||||
packet.mmm = result74
|
||||
var result79 = {}
|
||||
var size80 = buffer.readInt()
|
||||
if (size80 > 0):
|
||||
for index81 in range(size80):
|
||||
var result82 = []
|
||||
var size84 = buffer.readInt()
|
||||
if (size84 > 0):
|
||||
for index83 in range(size84):
|
||||
var list85 = buffer.readPacketArray(102)
|
||||
result82.append(list85)
|
||||
var result86 = []
|
||||
var size88 = buffer.readInt()
|
||||
if (size88 > 0):
|
||||
for index87 in range(size88):
|
||||
var result89 = []
|
||||
var size91 = buffer.readInt()
|
||||
if (size91 > 0):
|
||||
for index90 in range(size91):
|
||||
var list92 = buffer.readIntArray()
|
||||
result89.append(list92)
|
||||
result86.append(result89)
|
||||
result79[result82] = result86
|
||||
packet.mmmm = result79
|
||||
var result93 = {}
|
||||
var size94 = buffer.readInt()
|
||||
if (size94 > 0):
|
||||
for index95 in range(size94):
|
||||
var result96 = []
|
||||
var size98 = buffer.readInt()
|
||||
if (size98 > 0):
|
||||
for index97 in range(size98):
|
||||
var map99 = buffer.readIntStringMap()
|
||||
result96.append(map99)
|
||||
var result100 = []
|
||||
var size102 = buffer.readInt()
|
||||
if (size102 > 0):
|
||||
for index101 in range(size102):
|
||||
var map103 = buffer.readIntStringMap()
|
||||
result100.append(map103)
|
||||
result93[result96] = result100
|
||||
packet.mmmmm = result93
|
||||
var set104 = buffer.readIntArray()
|
||||
packet.s = set104
|
||||
var result105 = []
|
||||
var size107 = buffer.readInt()
|
||||
if (size107 > 0):
|
||||
for index106 in range(size107):
|
||||
var result108 = []
|
||||
var size110 = buffer.readInt()
|
||||
if (size110 > 0):
|
||||
for index109 in range(size110):
|
||||
var list111 = buffer.readIntArray()
|
||||
result108.append(list111)
|
||||
result105.append(result108)
|
||||
packet.ss = result105
|
||||
var result112 = []
|
||||
var size114 = buffer.readInt()
|
||||
if (size114 > 0):
|
||||
for index113 in range(size114):
|
||||
var set115 = buffer.readPacketArray(102)
|
||||
result112.append(set115)
|
||||
packet.sss = result112
|
||||
var set116 = buffer.readStringArray()
|
||||
packet.ssss = set116
|
||||
var result117 = []
|
||||
var size119 = buffer.readInt()
|
||||
if (size119 > 0):
|
||||
for index118 in range(size119):
|
||||
var map120 = buffer.readIntStringMap()
|
||||
result117.append(map120)
|
||||
packet.sssss = result117
|
||||
if (!buffer.isReadable()):
|
||||
return packet
|
||||
var result121 = buffer.readInt()
|
||||
packet.myCompatible = result121
|
||||
if (!buffer.isReadable()):
|
||||
return packet
|
||||
var result122 = buffer.readPacket(102)
|
||||
packet.myObject = result122
|
||||
return packet
|
|
@ -1,88 +0,0 @@
|
|||
# @author jaysunxiao
|
||||
# @version 3.0
|
||||
|
||||
var a # byte
|
||||
var aaa # byte[]
|
||||
var b # short
|
||||
var c # int
|
||||
var d # long
|
||||
var e # float
|
||||
var f # double
|
||||
var g # boolean
|
||||
var jj # java.lang.String
|
||||
var kk # com.zfoo.protocol.packet.ObjectA
|
||||
var l # java.util.List<java.lang.Integer>
|
||||
var ll # java.util.List<java.lang.Long>
|
||||
var lll # java.util.List<com.zfoo.protocol.packet.ObjectA>
|
||||
var llll # java.util.List<java.lang.String>
|
||||
var m # java.util.Map<java.lang.Integer, java.lang.String>
|
||||
var mm # java.util.Map<java.lang.Integer, com.zfoo.protocol.packet.ObjectA>
|
||||
var s # java.util.Set<java.lang.Integer>
|
||||
var ssss # java.util.Set<java.lang.String>
|
||||
|
||||
const PROTOCOL_ID = 101
|
||||
|
||||
static func write(buffer, packet):
|
||||
if (buffer.writePacketFlag(packet)):
|
||||
return
|
||||
buffer.writeByte(packet.a)
|
||||
buffer.writeByteArray(packet.aaa)
|
||||
buffer.writeShort(packet.b)
|
||||
buffer.writeInt(packet.c)
|
||||
buffer.writeLong(packet.d)
|
||||
buffer.writeFloat(packet.e)
|
||||
buffer.writeDouble(packet.f)
|
||||
buffer.writeBool(packet.g)
|
||||
buffer.writeString(packet.jj)
|
||||
buffer.writePacket(packet.kk, 102)
|
||||
buffer.writeIntArray(packet.l)
|
||||
buffer.writeLongArray(packet.ll)
|
||||
buffer.writePacketArray(packet.lll, 102)
|
||||
buffer.writeStringArray(packet.llll)
|
||||
buffer.writeIntStringMap(packet.m)
|
||||
buffer.writeIntPacketMap(packet.mm, 102)
|
||||
buffer.writeIntArray(packet.s)
|
||||
buffer.writeStringArray(packet.ssss)
|
||||
|
||||
|
||||
static func read(buffer):
|
||||
if (!buffer.readBool()):
|
||||
return null
|
||||
var packet = buffer.newInstance(PROTOCOL_ID)
|
||||
var result0 = buffer.readByte()
|
||||
packet.a = result0
|
||||
var array1 = buffer.readByteArray()
|
||||
packet.aaa = array1
|
||||
var result2 = buffer.readShort()
|
||||
packet.b = result2
|
||||
var result3 = buffer.readInt()
|
||||
packet.c = result3
|
||||
var result4 = buffer.readLong()
|
||||
packet.d = result4
|
||||
var result5 = buffer.readFloat()
|
||||
packet.e = result5
|
||||
var result6 = buffer.readDouble()
|
||||
packet.f = result6
|
||||
var result7 = buffer.readBool()
|
||||
packet.g = result7
|
||||
var result8 = buffer.readString()
|
||||
packet.jj = result8
|
||||
var result9 = buffer.readPacket(102)
|
||||
packet.kk = result9
|
||||
var list10 = buffer.readIntArray()
|
||||
packet.l = list10
|
||||
var list11 = buffer.readLongArray()
|
||||
packet.ll = list11
|
||||
var list12 = buffer.readPacketArray(102)
|
||||
packet.lll = list12
|
||||
var list13 = buffer.readStringArray()
|
||||
packet.llll = list13
|
||||
var map14 = buffer.readIntStringMap()
|
||||
packet.m = map14
|
||||
var map15 = buffer.readIntPacketMap(102)
|
||||
packet.mm = map15
|
||||
var set16 = buffer.readIntArray()
|
||||
packet.s = set16
|
||||
var set17 = buffer.readStringArray()
|
||||
packet.ssss = set17
|
||||
return packet
|
|
@ -1,28 +0,0 @@
|
|||
# @author jaysunxiao
|
||||
# @version 3.0
|
||||
|
||||
var a # int
|
||||
var m # java.util.Map<java.lang.Integer, java.lang.String>
|
||||
var objectB # com.zfoo.protocol.packet.ObjectB
|
||||
|
||||
const PROTOCOL_ID = 102
|
||||
|
||||
static func write(buffer, packet):
|
||||
if (buffer.writePacketFlag(packet)):
|
||||
return
|
||||
buffer.writeInt(packet.a)
|
||||
buffer.writeIntStringMap(packet.m)
|
||||
buffer.writePacket(packet.objectB, 103)
|
||||
|
||||
|
||||
static func read(buffer):
|
||||
if (!buffer.readBool()):
|
||||
return null
|
||||
var packet = buffer.newInstance(PROTOCOL_ID)
|
||||
var result0 = buffer.readInt()
|
||||
packet.a = result0
|
||||
var map1 = buffer.readIntStringMap()
|
||||
packet.m = map1
|
||||
var result2 = buffer.readPacket(103)
|
||||
packet.objectB = result2
|
||||
return packet
|
|
@ -1,20 +0,0 @@
|
|||
# @author jaysunxiao
|
||||
# @version 3.0
|
||||
|
||||
var flag # boolean
|
||||
|
||||
const PROTOCOL_ID = 103
|
||||
|
||||
static func write(buffer, packet):
|
||||
if (buffer.writePacketFlag(packet)):
|
||||
return
|
||||
buffer.writeBool(packet.flag)
|
||||
|
||||
|
||||
static func read(buffer):
|
||||
if (!buffer.readBool()):
|
||||
return null
|
||||
var packet = buffer.newInstance(PROTOCOL_ID)
|
||||
var result0 = buffer.readBool()
|
||||
packet.flag = result0
|
||||
return packet
|
|
@ -1,24 +0,0 @@
|
|||
# @author jaysunxiao
|
||||
# @version 3.0
|
||||
|
||||
var c # int
|
||||
var g # boolean
|
||||
|
||||
const PROTOCOL_ID = 104
|
||||
|
||||
static func write(buffer, packet):
|
||||
if (buffer.writePacketFlag(packet)):
|
||||
return
|
||||
buffer.writeInt(packet.c)
|
||||
buffer.writeBool(packet.g)
|
||||
|
||||
|
||||
static func read(buffer):
|
||||
if (!buffer.readBool()):
|
||||
return null
|
||||
var packet = buffer.newInstance(PROTOCOL_ID)
|
||||
var result0 = buffer.readInt()
|
||||
packet.c = result0
|
||||
var result1 = buffer.readBool()
|
||||
packet.g = result1
|
||||
return packet
|
|
@ -1,104 +0,0 @@
|
|||
extends Node2D
|
||||
|
||||
|
||||
const ProtocolManager = preload("res://gdProtocol/ProtocolManager.gd")
|
||||
const ByteBuffer = preload("res://gdProtocol/buffer/ByteBuffer.gd")
|
||||
const FileUtils = preload("res://zfoo/util/FileUtils.gd")
|
||||
|
||||
func _ready():
|
||||
var buffer = ByteBuffer.new()
|
||||
|
||||
buffer.writeBool(true)
|
||||
buffer.writeBool(false)
|
||||
assert(true == buffer.readBool())
|
||||
assert(false == buffer.readBool())
|
||||
|
||||
buffer.writeByte(-128)
|
||||
buffer.writeByte(99)
|
||||
buffer.writeByte(127)
|
||||
assert(-128 == buffer.readByte())
|
||||
assert(99 == buffer.readByte())
|
||||
assert(127 == buffer.readByte())
|
||||
|
||||
buffer.writeShort(-32768)
|
||||
buffer.writeShort(0)
|
||||
buffer.writeShort(32767)
|
||||
assert(-32768 == buffer.readShort())
|
||||
assert(0 == buffer.readShort())
|
||||
assert(32767 == buffer.readShort())
|
||||
|
||||
buffer.writeInt(-2147483648)
|
||||
buffer.writeInt(-999999)
|
||||
buffer.writeInt(0)
|
||||
buffer.writeInt(999999)
|
||||
buffer.writeInt(2147483647)
|
||||
assert(-2147483648 == buffer.readInt())
|
||||
assert(-999999 == buffer.readInt())
|
||||
assert(0 == buffer.readInt())
|
||||
assert(999999 == buffer.readInt())
|
||||
assert(2147483647 == buffer.readInt())
|
||||
|
||||
var maxLong = int("9223372036854775807")
|
||||
var minLong = int("-9223372036854775808")
|
||||
buffer.writeLong(maxLong)
|
||||
buffer.writeLong(9999999999999999)
|
||||
buffer.writeLong(99999999)
|
||||
buffer.writeLong(0)
|
||||
buffer.writeLong(-99999999)
|
||||
buffer.writeLong(-9999999999999999)
|
||||
buffer.writeLong(minLong)
|
||||
|
||||
assert(maxLong == buffer.readLong())
|
||||
assert(9999999999999999 == buffer.readLong())
|
||||
assert(99999999 == buffer.readLong())
|
||||
assert(0 == buffer.readLong())
|
||||
assert(-99999999 == buffer.readLong())
|
||||
assert(-9999999999999999 == buffer.readLong())
|
||||
assert(minLong == buffer.readLong())
|
||||
|
||||
buffer.writeFloat(-1234.5678)
|
||||
buffer.writeFloat(0)
|
||||
buffer.writeFloat(1234.5678)
|
||||
assert(abs(-1234.5678 - buffer.readFloat()) < 0.001)
|
||||
assert(0 == buffer.readFloat())
|
||||
assert(abs(1234.5678 - buffer.readFloat()) < 0.001)
|
||||
|
||||
buffer.writeDouble(-1234.5678)
|
||||
buffer.writeDouble(0)
|
||||
buffer.writeDouble(1234.5678)
|
||||
assert(abs(-1234.5678 - buffer.readDouble()) < 0.001)
|
||||
assert(0 == buffer.readDouble())
|
||||
assert(abs(1234.5678 - buffer.readDouble()) < 0.001)
|
||||
|
||||
var strValue = "你好 hello world"
|
||||
buffer.writeString(strValue)
|
||||
assert(strValue == buffer.readString())
|
||||
|
||||
buffer.writeChar(strValue)
|
||||
assert(strValue[0] == buffer.readChar())
|
||||
buffer.writeChar("")
|
||||
assert(ByteBuffer.EMPTY == buffer.readChar())
|
||||
test()
|
||||
|
||||
|
||||
func test():
|
||||
ProtocolManager.initProtocol()
|
||||
var buffer = ByteBuffer.new()
|
||||
var poolByteArray = FileUtils.readFileToByteArray("user://ComplexObject.bytes")
|
||||
buffer.writePoolByteArray(poolByteArray)
|
||||
|
||||
var packet = ProtocolManager.read(buffer)
|
||||
print(packet)
|
||||
packet.myCompatible = 0
|
||||
var newByteBuffer = ByteBuffer.new()
|
||||
ProtocolManager.write(newByteBuffer, packet);
|
||||
print(newByteBuffer.getWriteOffset())
|
||||
|
||||
var newPacket = ProtocolManager.read(newByteBuffer);
|
||||
print(newPacket)
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
|
@ -1,6 +0,0 @@
|
|||
[gd_scene load_steps=2 format=2]
|
||||
|
||||
[ext_resource path="res://gdTest/GdProtocolTest.gd" type="Script" id=1]
|
||||
|
||||
[node name="Node2D" type="Node2D"]
|
||||
script = ExtResource( 1 )
|
|
@ -1,34 +0,0 @@
|
|||
[remap]
|
||||
|
||||
importer="texture"
|
||||
type="StreamTexture"
|
||||
path="res://.import/icon.png-487276ed1e3a0c39cad0279d744ee560.stex"
|
||||
metadata={
|
||||
"vram_texture": false
|
||||
}
|
||||
|
||||
[deps]
|
||||
|
||||
source_file="res://icon.png"
|
||||
dest_files=[ "res://.import/icon.png-487276ed1e3a0c39cad0279d744ee560.stex" ]
|
||||
|
||||
[params]
|
||||
|
||||
compress/mode=0
|
||||
compress/lossy_quality=0.7
|
||||
compress/hdr_mode=0
|
||||
compress/bptc_ldr=0
|
||||
compress/normal_map=0
|
||||
flags/repeat=0
|
||||
flags/filter=true
|
||||
flags/mipmaps=false
|
||||
flags/anisotropic=false
|
||||
flags/srgb=2
|
||||
process/fix_alpha_border=true
|
||||
process/premult_alpha=false
|
||||
process/HDR_as_SRGB=false
|
||||
process/invert_color=false
|
||||
stream=false
|
||||
size_limit=0
|
||||
detect_3d=true
|
||||
svg/scale=1.0
|
|
@ -1,73 +0,0 @@
|
|||
; Engine configuration file.
|
||||
; It's best edited using the editor UI and not directly,
|
||||
; since the parameters that go here are not all obvious.
|
||||
;
|
||||
; Format:
|
||||
; [section] ; section goes between []
|
||||
; param=value ; assign values to parameters
|
||||
|
||||
config_version=4
|
||||
|
||||
_global_script_classes=[ {
|
||||
"base": "Node2D",
|
||||
"class": "MyClass",
|
||||
"language": "GDScript",
|
||||
"path": "res://script/demo02_base/MyClass.gd"
|
||||
} ]
|
||||
_global_script_class_icons={
|
||||
"MyClass": "res://icon.png"
|
||||
}
|
||||
|
||||
[application]
|
||||
|
||||
config/name="godot-start"
|
||||
run/main_scene="res://scene/demo01_hello/hello_world.tscn"
|
||||
config/icon="res://icon.png"
|
||||
|
||||
[display]
|
||||
|
||||
window/stretch/mode="2d"
|
||||
window/stretch/aspect="keep"
|
||||
|
||||
[input]
|
||||
|
||||
move_left={
|
||||
"deadzone": 0.5,
|
||||
"events": [ Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":0,"alt":false,"shift":false,"control":false,"meta":false,"command":false,"pressed":false,"scancode":65,"unicode":0,"echo":false,"script":null)
|
||||
, Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":0,"alt":false,"shift":false,"control":false,"meta":false,"command":false,"pressed":false,"scancode":16777231,"unicode":0,"echo":false,"script":null)
|
||||
, Object(InputEventJoypadButton,"resource_local_to_scene":false,"resource_name":"","device":0,"button_index":14,"pressure":0.0,"pressed":false,"script":null)
|
||||
, Object(InputEventJoypadMotion,"resource_local_to_scene":false,"resource_name":"","device":0,"axis":0,"axis_value":-1.0,"script":null)
|
||||
]
|
||||
}
|
||||
move_right={
|
||||
"deadzone": 0.5,
|
||||
"events": [ Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":0,"alt":false,"shift":false,"control":false,"meta":false,"command":false,"pressed":false,"scancode":68,"unicode":0,"echo":false,"script":null)
|
||||
, Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":0,"alt":false,"shift":false,"control":false,"meta":false,"command":false,"pressed":false,"scancode":16777233,"unicode":0,"echo":false,"script":null)
|
||||
, Object(InputEventJoypadButton,"resource_local_to_scene":false,"resource_name":"","device":0,"button_index":15,"pressure":0.0,"pressed":false,"script":null)
|
||||
, Object(InputEventJoypadMotion,"resource_local_to_scene":false,"resource_name":"","device":0,"axis":0,"axis_value":1.0,"script":null)
|
||||
]
|
||||
}
|
||||
move_up={
|
||||
"deadzone": 0.5,
|
||||
"events": [ Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":0,"alt":false,"shift":false,"control":false,"meta":false,"command":false,"pressed":false,"scancode":87,"unicode":0,"echo":false,"script":null)
|
||||
, Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":0,"alt":false,"shift":false,"control":false,"meta":false,"command":false,"pressed":false,"scancode":16777232,"unicode":0,"echo":false,"script":null)
|
||||
, Object(InputEventJoypadButton,"resource_local_to_scene":false,"resource_name":"","device":0,"button_index":12,"pressure":0.0,"pressed":false,"script":null)
|
||||
, Object(InputEventJoypadMotion,"resource_local_to_scene":false,"resource_name":"","device":0,"axis":1,"axis_value":-1.0,"script":null)
|
||||
]
|
||||
}
|
||||
move_down={
|
||||
"deadzone": 0.5,
|
||||
"events": [ Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":0,"alt":false,"shift":false,"control":false,"meta":false,"command":false,"pressed":false,"scancode":83,"unicode":0,"echo":false,"script":null)
|
||||
, Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":0,"alt":false,"shift":false,"control":false,"meta":false,"command":false,"pressed":false,"scancode":16777234,"unicode":0,"echo":false,"script":null)
|
||||
, Object(InputEventJoypadButton,"resource_local_to_scene":false,"resource_name":"","device":0,"button_index":13,"pressure":0.0,"pressed":false,"script":null)
|
||||
, Object(InputEventJoypadMotion,"resource_local_to_scene":false,"resource_name":"","device":0,"axis":1,"axis_value":1.0,"script":null)
|
||||
]
|
||||
}
|
||||
|
||||
[physics]
|
||||
|
||||
common/enable_pause_aware_picking=true
|
||||
|
||||
[rendering]
|
||||
|
||||
environment/default_environment="res://default_env.tres"
|
|
@ -1,20 +0,0 @@
|
|||
[gd_scene load_steps=2 format=2]
|
||||
|
||||
[ext_resource path="res://script/demo01_hello/hello_world.gd" type="Script" id=1]
|
||||
|
||||
[node name="Node2D" type="Node2D"]
|
||||
script = ExtResource( 1 )
|
||||
|
||||
[node name="Label" type="Label" parent="."]
|
||||
margin_left = 359.408
|
||||
margin_top = 248.378
|
||||
margin_right = 595.408
|
||||
margin_bottom = 358.378
|
||||
rect_pivot_offset = Vector2( -0.558563, -0.7173 )
|
||||
text = "Hello World"
|
||||
align = 1
|
||||
valign = 1
|
||||
max_lines_visible = 2
|
||||
__meta__ = {
|
||||
"_edit_use_anchors_": false
|
||||
}
|
|
@ -1,7 +0,0 @@
|
|||
[gd_scene load_steps=2 format=2]
|
||||
|
||||
[ext_resource path="res://script/demo02_base/base1.gd" type="Script" id=1]
|
||||
|
||||
[node name="Node2D" type="Node2D"]
|
||||
script = ExtResource( 1 )
|
||||
a = 9
|
|
@ -1,6 +0,0 @@
|
|||
[gd_scene load_steps=2 format=2]
|
||||
|
||||
[ext_resource path="res://script/demo02_base/base2.gd" type="Script" id=1]
|
||||
|
||||
[node name="Node2D" type="Node2D"]
|
||||
script = ExtResource( 1 )
|
|
@ -1,6 +0,0 @@
|
|||
[gd_scene load_steps=2 format=2]
|
||||
|
||||
[ext_resource path="res://script/demo02_base/base3.gd" type="Script" id=1]
|
||||
|
||||
[node name="Node2D" type="Node2D"]
|
||||
script = ExtResource( 1 )
|
|
@ -1,6 +0,0 @@
|
|||
[gd_scene load_steps=2 format=2]
|
||||
|
||||
[ext_resource path="res://script/demo02_base/base4.gd" type="Script" id=1]
|
||||
|
||||
[node name="Node2D" type="Node2D"]
|
||||
script = ExtResource( 1 )
|
|
@ -1,24 +0,0 @@
|
|||
[gd_scene load_steps=4 format=2]
|
||||
|
||||
[ext_resource path="res://script/demo03_lifecycle/sub_node1.gd" type="Script" id=1]
|
||||
[ext_resource path="res://script/demo03_lifecycle/sub_node2.gd" type="Script" id=2]
|
||||
[ext_resource path="res://script/demo03_lifecycle/parent.gd" type="Script" id=3]
|
||||
|
||||
[node name="Node2D" type="Node2D"]
|
||||
script = ExtResource( 3 )
|
||||
|
||||
[node name="SubNode1" type="Node2D" parent="."]
|
||||
script = ExtResource( 1 )
|
||||
|
||||
[node name="SubNode2" type="Node" parent="SubNode1"]
|
||||
script = ExtResource( 2 )
|
||||
|
||||
[node name="DeleteButton" type="Button" parent="."]
|
||||
margin_left = 400.0
|
||||
margin_top = 189.0
|
||||
margin_right = 589.0
|
||||
margin_bottom = 256.0
|
||||
text = "Delete SubNode1"
|
||||
__meta__ = {
|
||||
"_edit_use_anchors_": false
|
||||
}
|
|
@ -1,64 +0,0 @@
|
|||
[gd_scene load_steps=5 format=2]
|
||||
|
||||
[ext_resource path="res://script/demo04_signal/signal.gd" type="Script" id=1]
|
||||
[ext_resource path="res://script/demo04_signal/mySignal.gd" type="Script" id=2]
|
||||
[ext_resource path="res://script/demo04_signal/yield.gd" type="Script" id=3]
|
||||
[ext_resource path="res://script/demo04_signal/thread.gd" type="Script" id=4]
|
||||
|
||||
[node name="Node2D" type="Node2D"]
|
||||
script = ExtResource( 1 )
|
||||
|
||||
[node name="Button1" type="Button" parent="."]
|
||||
margin_left = 322.927
|
||||
margin_top = 50.5072
|
||||
margin_right = 441.927
|
||||
margin_bottom = 90.5072
|
||||
text = "button1"
|
||||
__meta__ = {
|
||||
"_edit_use_anchors_": false
|
||||
}
|
||||
|
||||
[node name="Button2" type="Button" parent="."]
|
||||
margin_left = 541.436
|
||||
margin_top = 44.0454
|
||||
margin_right = 661.436
|
||||
margin_bottom = 94.0454
|
||||
text = "button2"
|
||||
__meta__ = {
|
||||
"_edit_use_anchors_": false
|
||||
}
|
||||
|
||||
[node name="MySignal" type="Button" parent="."]
|
||||
margin_left = 323.703
|
||||
margin_top = 148.643
|
||||
margin_right = 430.703
|
||||
margin_bottom = 192.643
|
||||
text = "mySignal"
|
||||
script = ExtResource( 2 )
|
||||
__meta__ = {
|
||||
"_edit_use_anchors_": false
|
||||
}
|
||||
|
||||
[node name="Yield" type="Button" parent="."]
|
||||
margin_left = 322.941
|
||||
margin_top = 244.0
|
||||
margin_right = 433.941
|
||||
margin_bottom = 287.0
|
||||
text = "yield"
|
||||
script = ExtResource( 3 )
|
||||
__meta__ = {
|
||||
"_edit_use_anchors_": false
|
||||
}
|
||||
|
||||
[node name="Thread" type="Button" parent="."]
|
||||
margin_left = 321.059
|
||||
margin_top = 331.0
|
||||
margin_right = 435.059
|
||||
margin_bottom = 374.0
|
||||
text = "thread"
|
||||
script = ExtResource( 4 )
|
||||
__meta__ = {
|
||||
"_edit_use_anchors_": false
|
||||
}
|
||||
|
||||
[connection signal="pressed" from="Button1" to="." method="_on_Button1_pressed"]
|
|
@ -1,12 +0,0 @@
|
|||
[gd_scene load_steps=3 format=2]
|
||||
|
||||
[ext_resource path="res://script/demo05_scene_node/hero.gd" type="Script" id=1]
|
||||
[ext_resource path="res://icon.png" type="Texture" id=2]
|
||||
|
||||
[node name="Node2D" type="Node2D"]
|
||||
position = Vector2( 100, 100 )
|
||||
|
||||
[node name="Hero" type="Sprite" parent="."]
|
||||
position = Vector2( 400, 200 )
|
||||
texture = ExtResource( 2 )
|
||||
script = ExtResource( 1 )
|
|
@ -1,11 +0,0 @@
|
|||
[gd_scene load_steps=3 format=2]
|
||||
|
||||
[ext_resource path="res://script/demo06_move/move_hero.gd" type="Script" id=1]
|
||||
[ext_resource path="res://icon.png" type="Texture" id=2]
|
||||
|
||||
[node name="Node2D" type="Node2D"]
|
||||
|
||||
[node name="HeroMove" type="Sprite" parent="."]
|
||||
position = Vector2( 552.42, 212.613 )
|
||||
texture = ExtResource( 2 )
|
||||
script = ExtResource( 1 )
|
|
@ -1,47 +0,0 @@
|
|||
[gd_scene load_steps=5 format=2]
|
||||
|
||||
[ext_resource path="res://icon.png" type="Texture" id=1]
|
||||
[ext_resource path="res://script/demo07_collision/kinematic_body_2d.gd" type="Script" id=2]
|
||||
|
||||
[sub_resource type="RectangleShape2D" id=1]
|
||||
extents = Vector2( 31.5644, 29.6976 )
|
||||
|
||||
[sub_resource type="RectangleShape2D" id=2]
|
||||
extents = Vector2( 30.17, 29.3458 )
|
||||
|
||||
[node name="Node2D" type="Node2D"]
|
||||
|
||||
[node name="StaticBody2D" type="StaticBody2D" parent="."]
|
||||
position = Vector2( 64.5824, 547.095 )
|
||||
|
||||
[node name="Polygon2D" type="Polygon2D" parent="StaticBody2D"]
|
||||
color = Color( 0.329412, 0.580392, 0.270588, 1 )
|
||||
polygon = PoolVector2Array( -23.2672, -184.708, -24.0164, 46.0308, 896.693, 51.2749, 897.443, -184.708, 653.968, 3.3291, 39.6617, 1.83081, 39.6617, -180.214 )
|
||||
|
||||
[node name="CollisionPolygon2D" type="CollisionPolygon2D" parent="StaticBody2D"]
|
||||
polygon = PoolVector2Array( -25.5147, -183.959, -26.2638, 45.2817, 895.944, 52.024, 897.443, -184.708, 654.717, 4.07825, 38.1633, -2.66412, 38.9125, -183.21 )
|
||||
|
||||
[node name="RigidBody2D" type="RigidBody2D" parent="."]
|
||||
position = Vector2( 880.023, 40.7525 )
|
||||
__meta__ = {
|
||||
"_edit_group_": true
|
||||
}
|
||||
|
||||
[node name="CollisionShape2D" type="CollisionShape2D" parent="RigidBody2D"]
|
||||
shape = SubResource( 1 )
|
||||
|
||||
[node name="Sprite" type="Sprite" parent="RigidBody2D"]
|
||||
texture = ExtResource( 1 )
|
||||
|
||||
[node name="KinematicBody2D" type="KinematicBody2D" parent="."]
|
||||
position = Vector2( 549.424, 338.422 )
|
||||
script = ExtResource( 2 )
|
||||
__meta__ = {
|
||||
"_edit_group_": true
|
||||
}
|
||||
|
||||
[node name="CollisionShape2D" type="CollisionShape2D" parent="KinematicBody2D"]
|
||||
shape = SubResource( 2 )
|
||||
|
||||
[node name="Sprite" type="Sprite" parent="KinematicBody2D"]
|
||||
texture = ExtResource( 1 )
|
Before Width: | Height: | Size: 99 KiB |
|
@ -1,34 +0,0 @@
|
|||
[remap]
|
||||
|
||||
importer="texture"
|
||||
type="StreamTexture"
|
||||
path="res://.import/Godette.png-04c1f254cac22071a0bc4b5ab76dab33.stex"
|
||||
metadata={
|
||||
"vram_texture": false
|
||||
}
|
||||
|
||||
[deps]
|
||||
|
||||
source_file="res://scene/demo08_path/image/Godette.png"
|
||||
dest_files=[ "res://.import/Godette.png-04c1f254cac22071a0bc4b5ab76dab33.stex" ]
|
||||
|
||||
[params]
|
||||
|
||||
compress/mode=0
|
||||
compress/lossy_quality=0.7
|
||||
compress/hdr_mode=0
|
||||
compress/bptc_ldr=0
|
||||
compress/normal_map=0
|
||||
flags/repeat=0
|
||||
flags/filter=true
|
||||
flags/mipmaps=false
|
||||
flags/anisotropic=false
|
||||
flags/srgb=2
|
||||
process/fix_alpha_border=true
|
||||
process/premult_alpha=false
|
||||
process/HDR_as_SRGB=false
|
||||
process/invert_color=false
|
||||
stream=false
|
||||
size_limit=0
|
||||
detect_3d=true
|
||||
svg/scale=1.0
|
Before Width: | Height: | Size: 116 KiB |
|
@ -1,34 +0,0 @@
|
|||
[remap]
|
||||
|
||||
importer="texture"
|
||||
type="StreamTexture"
|
||||
path="res://.import/Grasslands.png-0a6ab77180659e2e9d9a66e9712b5531.stex"
|
||||
metadata={
|
||||
"vram_texture": false
|
||||
}
|
||||
|
||||
[deps]
|
||||
|
||||
source_file="res://scene/demo08_path/image/Grasslands.png"
|
||||
dest_files=[ "res://.import/Grasslands.png-0a6ab77180659e2e9d9a66e9712b5531.stex" ]
|
||||
|
||||
[params]
|
||||
|
||||
compress/mode=0
|
||||
compress/lossy_quality=0.7
|
||||
compress/hdr_mode=0
|
||||
compress/bptc_ldr=0
|
||||
compress/normal_map=0
|
||||
flags/repeat=0
|
||||
flags/filter=true
|
||||
flags/mipmaps=false
|
||||
flags/anisotropic=false
|
||||
flags/srgb=2
|
||||
process/fix_alpha_border=true
|
||||
process/premult_alpha=false
|
||||
process/HDR_as_SRGB=false
|
||||
process/invert_color=false
|
||||
stream=false
|
||||
size_limit=0
|
||||
detect_3d=true
|
||||
svg/scale=1.0
|
Before Width: | Height: | Size: 6.7 KiB |
|
@ -1,34 +0,0 @@
|
|||
[remap]
|
||||
|
||||
importer="texture"
|
||||
type="StreamTexture"
|
||||
path="res://.import/Interactive.png-bebc87707c2e3c6e37be714ead0ebc3c.stex"
|
||||
metadata={
|
||||
"vram_texture": false
|
||||
}
|
||||
|
||||
[deps]
|
||||
|
||||
source_file="res://scene/demo08_path/image/Interactive.png"
|
||||
dest_files=[ "res://.import/Interactive.png-bebc87707c2e3c6e37be714ead0ebc3c.stex" ]
|
||||
|
||||
[params]
|
||||
|
||||
compress/mode=0
|
||||
compress/lossy_quality=0.7
|
||||
compress/hdr_mode=0
|
||||
compress/bptc_ldr=0
|
||||
compress/normal_map=0
|
||||
flags/repeat=0
|
||||
flags/filter=true
|
||||
flags/mipmaps=false
|
||||
flags/anisotropic=false
|
||||
flags/srgb=2
|
||||
process/fix_alpha_border=true
|
||||
process/premult_alpha=false
|
||||
process/HDR_as_SRGB=false
|
||||
process/invert_color=false
|
||||
stream=false
|
||||
size_limit=0
|
||||
detect_3d=true
|
||||
svg/scale=1.0
|
Before Width: | Height: | Size: 74 KiB |
|
@ -1,34 +0,0 @@
|
|||
[remap]
|
||||
|
||||
importer="texture"
|
||||
type="StreamTexture"
|
||||
path="res://.import/Robi.png-6434141f148b69577a114e3ae4050d96.stex"
|
||||
metadata={
|
||||
"vram_texture": false
|
||||
}
|
||||
|
||||
[deps]
|
||||
|
||||
source_file="res://scene/demo08_path/image/Robi.png"
|
||||
dest_files=[ "res://.import/Robi.png-6434141f148b69577a114e3ae4050d96.stex" ]
|
||||
|
||||
[params]
|
||||
|
||||
compress/mode=0
|
||||
compress/lossy_quality=0.7
|
||||
compress/hdr_mode=0
|
||||
compress/bptc_ldr=0
|
||||
compress/normal_map=0
|
||||
flags/repeat=0
|
||||
flags/filter=true
|
||||
flags/mipmaps=false
|
||||
flags/anisotropic=false
|
||||
flags/srgb=2
|
||||
process/fix_alpha_border=true
|
||||
process/premult_alpha=false
|
||||
process/HDR_as_SRGB=false
|
||||
process/invert_color=false
|
||||
stream=false
|
||||
size_limit=0
|
||||
detect_3d=true
|
||||
svg/scale=1.0
|
Before Width: | Height: | Size: 7.0 KiB |
|
@ -1,34 +0,0 @@
|
|||
[remap]
|
||||
|
||||
importer="texture"
|
||||
type="StreamTexture"
|
||||
path="res://.import/Shadow.png-3c5663631c022915064bcf46dc6c73d5.stex"
|
||||
metadata={
|
||||
"vram_texture": false
|
||||
}
|
||||
|
||||
[deps]
|
||||
|
||||
source_file="res://scene/demo08_path/image/Shadow.png"
|
||||
dest_files=[ "res://.import/Shadow.png-3c5663631c022915064bcf46dc6c73d5.stex" ]
|
||||
|
||||
[params]
|
||||
|
||||
compress/mode=0
|
||||
compress/lossy_quality=0.7
|
||||
compress/hdr_mode=0
|
||||
compress/bptc_ldr=0
|
||||
compress/normal_map=0
|
||||
flags/repeat=0
|
||||
flags/filter=true
|
||||
flags/mipmaps=false
|
||||
flags/anisotropic=false
|
||||
flags/srgb=2
|
||||
process/fix_alpha_border=true
|
||||
process/premult_alpha=false
|
||||
process/HDR_as_SRGB=false
|
||||
process/invert_color=false
|
||||
stream=false
|
||||
size_limit=0
|
||||
detect_3d=true
|
||||
svg/scale=1.0
|
|
@ -1,26 +0,0 @@
|
|||
[gd_scene load_steps=6 format=2]
|
||||
|
||||
[ext_resource path="res://script/demo06_move/move_hero.gd" type="Script" id=1]
|
||||
[ext_resource path="res://icon.png" type="Texture" id=2]
|
||||
[ext_resource path="res://script/demo08_path/my_line.gd" type="Script" id=3]
|
||||
|
||||
[sub_resource type="Curve" id=1]
|
||||
_data = [ Vector2( 0, 0.0545454 ), 0.0, 0.0, 0, 0, Vector2( 0.155556, 0.3 ), 0.0, 0.0, 0, 0, Vector2( 0.361111, 0.572727 ), 0.0, 0.0, 0, 0, Vector2( 0.733333, 0.781818 ), 0.0, 0.0, 0, 0, Vector2( 0.916667, 1 ), 0.0, 0.0, 0, 0, Vector2( 1, 1 ), 0.0, 0.0, 0, 0 ]
|
||||
|
||||
[sub_resource type="Gradient" id=2]
|
||||
offsets = PoolRealArray( 0, 0.395973, 1 )
|
||||
colors = PoolColorArray( 0.133195, 0.308942, 0.362743, 1, 0.226219, 0.464389, 0.839305, 1, 0.0228882, 0.261307, 0.976563, 1 )
|
||||
|
||||
[node name="Node2D" type="Node2D"]
|
||||
|
||||
[node name="Line2D" type="Line2D" parent="."]
|
||||
width = 64.0
|
||||
width_curve = SubResource( 1 )
|
||||
default_color = Color( 0.4, 0.501961, 1, 1 )
|
||||
gradient = SubResource( 2 )
|
||||
script = ExtResource( 3 )
|
||||
|
||||
[node name="Player" type="Sprite" parent="."]
|
||||
position = Vector2( 159.521, 163.844 )
|
||||
texture = ExtResource( 2 )
|
||||
script = ExtResource( 1 )
|
|
@ -1,45 +0,0 @@
|
|||
[gd_scene load_steps=5 format=2]
|
||||
|
||||
[ext_resource path="res://icon.png" type="Texture" id=1]
|
||||
[ext_resource path="res://script/demo08_path/path.gd" type="Script" id=2]
|
||||
|
||||
[sub_resource type="Curve2D" id=1]
|
||||
_data = {
|
||||
"points": PoolVector2Array( 0, 0, 0, 0, 65.9002, 246.547, 0, 0, 0, 0, 123.326, 218.878, 0, 0, 0, 0, 194.986, 195.578, 0, 0, 0, 0, 229.344, 131.988, 0, 0, 0, 0, 305.912, 274.216, 0, 0, 0, 0, 319.165, 361.592, 0, 0, 0, 0, 357.939, 411.105, 0, 0, 0, 0, 478.682, 369.359, 0, 0, 0, 0, 523.347, 214.509, 0, 0, 0, 0, 546.906, 144.609, 0, 0, 0, 0, 666.176, 175.676, 0, 0, 0, 0, 689.735, 337.807, 0, 0, 0, 0, 685.809, 389.261, 0, 0, 0, 0, 755.996, 418.872 )
|
||||
}
|
||||
|
||||
[sub_resource type="Curve2D" id=2]
|
||||
_data = {
|
||||
"points": PoolVector2Array( 0, 0, 0, 0, 46.9502, 574.442, 0, 0, 0, 0, 80.1843, 548.279, 0, 0, 0, 0, 111.297, 535.551, 0, 0, 0, 0, 163.623, 539.087, 0, 0, 0, 0, 185.543, 556.765, 0, 0, 0, 0, 242.112, 587.17, 0, 0, 0, 0, 276.76, 580.806, 0, 0, 0, 0, 306.458, 575.149, 0, 0, 0, 0, 341.107, 558.886, 0, 0, 0, 0, 355.249, 551.815, 0, 0, 0, 0, 395.554, 548.279, 0, 0, 0, 0, 414.646, 548.279, 0, 0, 0, 0, 480.407, 550.401, 0, 0, 0, 0, 563.138, 576.564, 0, 0, 0, 0, 585.766, 581.513, 0, 0, 0, 0, 681.225, 572.321, 0, 0, 0, 0, 704.56, 559.593, 0, 0, 0, 0, 737.087, 545.451, 0, 0, 0, 0, 766.785, 538.38, 0, 0, 0, 0, 812.747, 543.33, 0, 0, 0, 0, 843.86, 556.765, 0, 0, 0, 0, 889.822, 565.25, 0, 0, 0, 0, 906.085, 565.25, 0, 0, 0, 0, 940.733, 548.279, 0, 0, 0, 0, 958.411, 533.43 )
|
||||
}
|
||||
|
||||
[node name="Node2D" type="Node2D"]
|
||||
|
||||
[node name="Path2D_1" type="Path2D" parent="."]
|
||||
position = Vector2( 5.3012, -35.5921 )
|
||||
scale = Vector2( 1.14345, 1.15617 )
|
||||
curve = SubResource( 1 )
|
||||
|
||||
[node name="PathFollow2D" type="PathFollow2D" parent="Path2D_1"]
|
||||
position = Vector2( 65.9002, 246.547 )
|
||||
rotation = -0.449003
|
||||
script = ExtResource( 2 )
|
||||
|
||||
[node name="Sprite" type="Sprite" parent="Path2D_1/PathFollow2D"]
|
||||
texture = ExtResource( 1 )
|
||||
|
||||
[node name="Path2D_2" type="Path2D" parent="."]
|
||||
curve = SubResource( 2 )
|
||||
|
||||
[node name="PathFollow2D" type="PathFollow2D" parent="Path2D_2"]
|
||||
position = Vector2( 46.9502, 574.442 )
|
||||
rotation = -0.666908
|
||||
script = ExtResource( 2 )
|
||||
|
||||
[node name="RemoteTransform2D" type="RemoteTransform2D" parent="Path2D_2/PathFollow2D"]
|
||||
remote_path = NodePath("../../../Sprite")
|
||||
|
||||
[node name="Sprite" type="Sprite" parent="."]
|
||||
position = Vector2( 46.9502, 574.442 )
|
||||
rotation = -0.666908
|
||||
texture = ExtResource( 1 )
|
|
@ -1,235 +0,0 @@
|
|||
[gd_scene load_steps=28 format=2]
|
||||
|
||||
[ext_resource path="res://scene/demo08_path/image/Robi.png" type="Texture" id=1]
|
||||
[ext_resource path="res://scene/demo08_path/image/Shadow.png" type="Texture" id=2]
|
||||
[ext_resource path="res://script/demo08_path/my_tile.gd" type="Script" id=3]
|
||||
[ext_resource path="res://script/demo08_path/my_player.gd" type="Script" id=4]
|
||||
[ext_resource path="res://scene/demo08_path/image/Grasslands.png" type="Texture" id=5]
|
||||
|
||||
[sub_resource type="NavigationPolygon" id=2]
|
||||
vertices = PoolVector2Array( 0, 0, 80, 0, 80, 80, 0, 80 )
|
||||
polygons = [ PoolIntArray( 0, 1, 2, 3 ) ]
|
||||
|
||||
[sub_resource type="ConvexPolygonShape2D" id=3]
|
||||
points = PoolVector2Array( 0, 0, 80, 0, 80, 80, 0, 80 )
|
||||
|
||||
[sub_resource type="ConvexPolygonShape2D" id=4]
|
||||
points = PoolVector2Array( 0, 0, 80, 0, 80, 80, 0, 80 )
|
||||
|
||||
[sub_resource type="ConvexPolygonShape2D" id=5]
|
||||
points = PoolVector2Array( 0, 0, 80, 0, 80, 80, 0, 80 )
|
||||
|
||||
[sub_resource type="ConvexPolygonShape2D" id=6]
|
||||
points = PoolVector2Array( 0, 0, 80, 0, 80, 80, 0, 80 )
|
||||
|
||||
[sub_resource type="NavigationPolygon" id=7]
|
||||
vertices = PoolVector2Array( 0, 0, 80, 0, 80, 80, 0, 80 )
|
||||
polygons = [ PoolIntArray( 0, 1, 2, 3 ) ]
|
||||
|
||||
[sub_resource type="NavigationPolygon" id=8]
|
||||
vertices = PoolVector2Array( 0, 0, 80, 0, 80, 80, 0, 80 )
|
||||
polygons = [ PoolIntArray( 0, 1, 2, 3 ) ]
|
||||
|
||||
[sub_resource type="NavigationPolygon" id=9]
|
||||
vertices = PoolVector2Array( 0, 0, 80, 0, 80, 80, 0, 80 )
|
||||
polygons = [ PoolIntArray( 0, 1, 2, 3 ) ]
|
||||
|
||||
[sub_resource type="NavigationPolygon" id=10]
|
||||
vertices = PoolVector2Array( 0, 0, 80, 0, 80, 80, 0, 80 )
|
||||
polygons = [ PoolIntArray( 0, 1, 2, 3 ) ]
|
||||
|
||||
[sub_resource type="NavigationPolygon" id=11]
|
||||
vertices = PoolVector2Array( 0, 0, 80, 0, 80, 80, 0, 80 )
|
||||
polygons = [ PoolIntArray( 0, 1, 2, 3 ) ]
|
||||
|
||||
[sub_resource type="NavigationPolygon" id=12]
|
||||
vertices = PoolVector2Array( 0, 0, 80, 0, 80, 80, 0, 80 )
|
||||
polygons = [ PoolIntArray( 0, 1, 2, 3 ) ]
|
||||
|
||||
[sub_resource type="NavigationPolygon" id=13]
|
||||
vertices = PoolVector2Array( 0, 0, 80, 0, 80, 80, 0, 80 )
|
||||
polygons = [ PoolIntArray( 0, 1, 2, 3 ) ]
|
||||
|
||||
[sub_resource type="NavigationPolygon" id=14]
|
||||
vertices = PoolVector2Array( 0, 0, 80, 0, 80, 80, 0, 80 )
|
||||
polygons = [ PoolIntArray( 0, 1, 2, 3 ) ]
|
||||
|
||||
[sub_resource type="NavigationPolygon" id=15]
|
||||
vertices = PoolVector2Array( 0, 0, 80, 0, 80, 80, 0, 80 )
|
||||
polygons = [ PoolIntArray( 0, 1, 2, 3 ) ]
|
||||
|
||||
[sub_resource type="NavigationPolygon" id=16]
|
||||
vertices = PoolVector2Array( 80, 80, 0, 80, 0, 0, 80, 0 )
|
||||
polygons = [ PoolIntArray( 0, 1, 2, 3 ) ]
|
||||
|
||||
[sub_resource type="NavigationPolygon" id=17]
|
||||
vertices = PoolVector2Array( 0, 0, 80, 0, 80, 80, 0, 80 )
|
||||
polygons = [ PoolIntArray( 0, 1, 2, 3 ) ]
|
||||
|
||||
[sub_resource type="NavigationPolygon" id=18]
|
||||
vertices = PoolVector2Array( 0, 0, 80, 0, 80, 80, 0, 80 )
|
||||
polygons = [ PoolIntArray( 0, 1, 2, 3 ) ]
|
||||
|
||||
[sub_resource type="NavigationPolygon" id=19]
|
||||
vertices = PoolVector2Array( 0, 0, 80, 0, 80, 80, 0, 80 )
|
||||
polygons = [ PoolIntArray( 0, 1, 2, 3 ) ]
|
||||
|
||||
[sub_resource type="NavigationPolygon" id=20]
|
||||
vertices = PoolVector2Array( 0, 0, 80, 0, 80, 80, 0, 80 )
|
||||
polygons = [ PoolIntArray( 0, 1, 2, 3 ) ]
|
||||
|
||||
[sub_resource type="NavigationPolygon" id=21]
|
||||
vertices = PoolVector2Array( 0, 0, 80, 0, 80, 80, 0, 80 )
|
||||
polygons = [ PoolIntArray( 0, 1, 2, 3 ) ]
|
||||
|
||||
[sub_resource type="NavigationPolygon" id=22]
|
||||
vertices = PoolVector2Array( 0, 0, 80, 0, 80, 80, 0, 80 )
|
||||
polygons = [ PoolIntArray( 0, 1, 2, 3 ) ]
|
||||
|
||||
[sub_resource type="TileSet" id=1]
|
||||
0/name = "Grasslands.png 0"
|
||||
0/texture = ExtResource( 5 )
|
||||
0/tex_offset = Vector2( 0, 0 )
|
||||
0/modulate = Color( 1, 1, 1, 1 )
|
||||
0/region = Rect2( 0, 0, 80, 80 )
|
||||
0/tile_mode = 0
|
||||
0/occluder_offset = Vector2( 0, 0 )
|
||||
0/navigation_offset = Vector2( 0, 0 )
|
||||
0/navigation = SubResource( 2 )
|
||||
0/shape_offset = Vector2( 0, 0 )
|
||||
0/shape_transform = Transform2D( 1, 0, 0, 1, 0, 0 )
|
||||
0/shape_one_way = false
|
||||
0/shape_one_way_margin = 0.0
|
||||
0/shapes = [ ]
|
||||
0/z_index = 0
|
||||
1/name = "Grasslands.png 1"
|
||||
1/texture = ExtResource( 5 )
|
||||
1/tex_offset = Vector2( 0, 0 )
|
||||
1/modulate = Color( 1, 1, 1, 1 )
|
||||
1/region = Rect2( 80, 0, 80, 80 )
|
||||
1/tile_mode = 0
|
||||
1/occluder_offset = Vector2( 0, 0 )
|
||||
1/navigation_offset = Vector2( 0, 0 )
|
||||
1/shape_offset = Vector2( 0, 0 )
|
||||
1/shape_transform = Transform2D( 1, 0, 0, 1, 0, 0 )
|
||||
1/shape = SubResource( 3 )
|
||||
1/shape_one_way = false
|
||||
1/shape_one_way_margin = 1.0
|
||||
1/shapes = [ {
|
||||
"autotile_coord": Vector2( 0, 0 ),
|
||||
"one_way": false,
|
||||
"one_way_margin": 1.0,
|
||||
"shape": SubResource( 3 ),
|
||||
"shape_transform": Transform2D( 1, 0, 0, 1, 0, 0 )
|
||||
} ]
|
||||
1/z_index = 0
|
||||
2/name = "Grasslands.png 2"
|
||||
2/texture = ExtResource( 5 )
|
||||
2/tex_offset = Vector2( 0, 0 )
|
||||
2/modulate = Color( 1, 1, 1, 1 )
|
||||
2/region = Rect2( 160, 0, 80, 80 )
|
||||
2/tile_mode = 0
|
||||
2/occluder_offset = Vector2( 0, 0 )
|
||||
2/navigation_offset = Vector2( 0, 0 )
|
||||
2/shape_offset = Vector2( 0, 0 )
|
||||
2/shape_transform = Transform2D( 1, 0, 0, 1, 0, 0 )
|
||||
2/shape = SubResource( 4 )
|
||||
2/shape_one_way = false
|
||||
2/shape_one_way_margin = 1.0
|
||||
2/shapes = [ {
|
||||
"autotile_coord": Vector2( 0, 0 ),
|
||||
"one_way": false,
|
||||
"one_way_margin": 1.0,
|
||||
"shape": SubResource( 4 ),
|
||||
"shape_transform": Transform2D( 1, 0, 0, 1, 0, 0 )
|
||||
} ]
|
||||
2/z_index = 0
|
||||
3/name = "Grasslands.png 3"
|
||||
3/texture = ExtResource( 5 )
|
||||
3/tex_offset = Vector2( 0, 0 )
|
||||
3/modulate = Color( 1, 1, 1, 1 )
|
||||
3/region = Rect2( 240, 0, 80, 80 )
|
||||
3/tile_mode = 0
|
||||
3/occluder_offset = Vector2( 0, 0 )
|
||||
3/navigation_offset = Vector2( 0, 0 )
|
||||
3/shape_offset = Vector2( 0, 0 )
|
||||
3/shape_transform = Transform2D( 1, 0, 0, 1, 0, 0 )
|
||||
3/shape = SubResource( 5 )
|
||||
3/shape_one_way = false
|
||||
3/shape_one_way_margin = 1.0
|
||||
3/shapes = [ {
|
||||
"autotile_coord": Vector2( 0, 0 ),
|
||||
"one_way": false,
|
||||
"one_way_margin": 1.0,
|
||||
"shape": SubResource( 5 ),
|
||||
"shape_transform": Transform2D( 1, 0, 0, 1, 0, 0 )
|
||||
} ]
|
||||
3/z_index = 0
|
||||
4/name = "Grasslands.png 4"
|
||||
4/texture = ExtResource( 5 )
|
||||
4/tex_offset = Vector2( 0, 0 )
|
||||
4/modulate = Color( 1, 1, 1, 1 )
|
||||
4/region = Rect2( 320, 0, 80, 80 )
|
||||
4/tile_mode = 0
|
||||
4/occluder_offset = Vector2( 0, 0 )
|
||||
4/navigation_offset = Vector2( 0, 0 )
|
||||
4/shape_offset = Vector2( 0, 0 )
|
||||
4/shape_transform = Transform2D( 1, 0, 0, 1, 0, 0 )
|
||||
4/shape = SubResource( 6 )
|
||||
4/shape_one_way = false
|
||||
4/shape_one_way_margin = 1.0
|
||||
4/shapes = [ {
|
||||
"autotile_coord": Vector2( 0, 0 ),
|
||||
"one_way": false,
|
||||
"one_way_margin": 1.0,
|
||||
"shape": SubResource( 6 ),
|
||||
"shape_transform": Transform2D( 1, 0, 0, 1, 0, 0 )
|
||||
} ]
|
||||
4/z_index = 0
|
||||
5/name = "Grasslands.png 5"
|
||||
5/texture = ExtResource( 5 )
|
||||
5/tex_offset = Vector2( 0, 0 )
|
||||
5/modulate = Color( 1, 1, 1, 1 )
|
||||
5/region = Rect2( 0, 80, 560, 240 )
|
||||
5/tile_mode = 1
|
||||
5/autotile/bitmask_mode = 0
|
||||
5/autotile/bitmask_flags = [ ]
|
||||
5/autotile/icon_coordinate = Vector2( 0, 0 )
|
||||
5/autotile/tile_size = Vector2( 80, 80 )
|
||||
5/autotile/spacing = 0
|
||||
5/autotile/occluder_map = [ ]
|
||||
5/autotile/navpoly_map = [ Vector2( 0, 1 ), SubResource( 7 ), Vector2( 0, 2 ), SubResource( 8 ), Vector2( 1, 1 ), SubResource( 9 ), Vector2( 1, 2 ), SubResource( 10 ), Vector2( 2, 1 ), SubResource( 11 ), Vector2( 2, 2 ), SubResource( 12 ), Vector2( 3, 0 ), SubResource( 13 ), Vector2( 3, 1 ), SubResource( 14 ), Vector2( 3, 2 ), SubResource( 15 ), Vector2( 4, 0 ), SubResource( 16 ), Vector2( 4, 1 ), SubResource( 17 ), Vector2( 4, 2 ), SubResource( 18 ), Vector2( 5, 0 ), SubResource( 19 ), Vector2( 5, 1 ), SubResource( 20 ), Vector2( 5, 2 ), SubResource( 21 ), Vector2( 6, 0 ), SubResource( 22 ) ]
|
||||
5/autotile/priority_map = [ ]
|
||||
5/autotile/z_index_map = [ ]
|
||||
5/occluder_offset = Vector2( 0, 0 )
|
||||
5/navigation_offset = Vector2( 0, 0 )
|
||||
5/shape_offset = Vector2( 0, 0 )
|
||||
5/shape_transform = Transform2D( 1, 0, 0, 1, 0, 0 )
|
||||
5/shape_one_way = false
|
||||
5/shape_one_way_margin = 0.0
|
||||
5/shapes = [ ]
|
||||
5/z_index = 0
|
||||
|
||||
[node name="Node2D" type="Node"]
|
||||
script = ExtResource( 3 )
|
||||
|
||||
[node name="Navigation2D" type="Navigation2D" parent="."]
|
||||
|
||||
[node name="TileMap" type="TileMap" parent="Navigation2D"]
|
||||
tile_set = SubResource( 1 )
|
||||
cell_size = Vector2( 80, 80 )
|
||||
format = 1
|
||||
tile_data = PoolIntArray( 65534, 0, 0, 65535, 0, 0, 0, 0, 0, 1, 0, 0, 2, 0, 0, 3, 1, 0, 4, 0, 0, 5, 0, 0, 6, 0, 0, 7, 3, 0, 8, 0, 0, 9, 0, 0, 10, 0, 0, 11, 0, 0, 12, 0, 0, 13, 0, 0, 131069, 0, 0, 131070, 0, 0, 131071, 0, 0, 65536, 0, 0, 65537, 0, 0, 65538, 0, 0, 65539, 1, 0, 65540, 0, 0, 65541, 2, 0, 65542, 0, 0, 65543, 3, 0, 65544, 0, 0, 65545, 0, 0, 65546, 0, 0, 65547, 0, 0, 65548, 0, 0, 65549, 0, 0, 65550, 0, 0, 65551, 0, 0, 65552, 0, 0, 65553, 0, 0, 196604, 0, 0, 196605, 0, 0, 196606, 0, 0, 196607, 0, 0, 131072, 0, 0, 131073, 0, 0, 131074, 0, 0, 131075, 1, 0, 131076, 0, 0, 131077, 2, 0, 131078, 0, 0, 131079, 3, 0, 131080, 0, 0, 131081, 4, 0, 131082, 4, 0, 131083, 4, 0, 131084, 0, 0, 131085, 0, 0, 131086, 0, 0, 131087, 0, 0, 131088, 0, 0, 262140, 0, 0, 262142, 0, 0, 262143, 0, 0, 196608, 0, 0, 196609, 0, 0, 196610, 0, 0, 196611, 1, 0, 196612, 0, 0, 196613, 2, 0, 196614, 0, 0, 196615, 3, 0, 196616, 0, 0, 196617, 4, 0, 196618, 0, 0, 196619, 0, 0, 196620, 0, 0, 327676, 0, 0, 327677, 0, 0, 327678, 0, 0, 327679, 0, 0, 262144, 0, 0, 262145, 0, 0, 262146, 0, 0, 262147, 1, 0, 262148, 0, 0, 262149, 2, 0, 262150, 0, 0, 262151, 3, 0, 262152, 0, 0, 262153, 4, 0, 262154, 0, 0, 262155, 0, 0, 262156, 0, 0, 393210, 0, 0, 393211, 0, 0, 393212, 0, 0, 393213, 0, 0, 393214, 0, 0, 393215, 0, 0, 327680, 0, 0, 327681, 0, 0, 327682, 0, 0, 327683, 0, 0, 327684, 0, 0, 327685, 2, 0, 327686, 0, 0, 327687, 0, 0, 327688, 0, 0, 327689, 4, 0, 327690, 4, 0, 327691, 0, 0, 327692, 0, 0, 393216, 0, 0, 393217, 0, 0, 393218, 0, 0, 393219, 0, 0, 393220, 0, 0, 393221, 2, 0, 393222, 0, 0, 393223, 0, 0, 393224, 0, 0, 393225, 0, 0, 393226, 4, 0, 393227, 0, 0 )
|
||||
|
||||
[node name="Player" type="Sprite" parent="."]
|
||||
position = Vector2( 150.021, 142.539 )
|
||||
scale = Vector2( 0.211144, 0.211144 )
|
||||
texture = ExtResource( 1 )
|
||||
script = ExtResource( 4 )
|
||||
|
||||
[node name="Shadow" type="Sprite" parent="Player"]
|
||||
position = Vector2( -12.9122, 228.23 )
|
||||
scale = Vector2( 2.38618, 2.38618 )
|
||||
texture = ExtResource( 2 )
|
||||
|
||||
[node name="Line2D" type="Line2D" parent="."]
|
|
@ -1,6 +0,0 @@
|
|||
[gd_scene load_steps=2 format=2]
|
||||
|
||||
[ext_resource path="res://script/demo09_canvas/canvas.gd" type="Script" id=1]
|
||||
|
||||
[node name="Node2D" type="Node2D"]
|
||||
script = ExtResource( 1 )
|
|
@ -1,145 +0,0 @@
|
|||
[gd_scene load_steps=16 format=2]
|
||||
|
||||
[ext_resource path="res://scene/demo10_animation/image/run-6.png" type="Texture" id=1]
|
||||
[ext_resource path="res://scene/demo10_animation/image/run-5.png" type="Texture" id=2]
|
||||
[ext_resource path="res://scene/demo10_animation/image/run-7.png" type="Texture" id=3]
|
||||
[ext_resource path="res://icon.png" type="Texture" id=4]
|
||||
[ext_resource path="res://scene/demo10_animation/image/run-8.png" type="Texture" id=5]
|
||||
[ext_resource path="res://scene/demo10_animation/image/player.png" type="Texture" id=6]
|
||||
[ext_resource path="res://scene/demo10_animation/image/run-4.png" type="Texture" id=7]
|
||||
[ext_resource path="res://scene/demo10_animation/image/run-3.png" type="Texture" id=8]
|
||||
[ext_resource path="res://scene/demo10_animation/image/run-1.png" type="Texture" id=9]
|
||||
[ext_resource path="res://scene/demo10_animation/image/run-2.png" type="Texture" id=10]
|
||||
[ext_resource path="res://script/demo10_animation/timer_animation.gd" type="Script" id=11]
|
||||
[ext_resource path="res://script/demo10_animation/tween_animation.gd" type="Script" id=12]
|
||||
|
||||
[sub_resource type="Animation" id=1]
|
||||
resource_name = "my_animation_1"
|
||||
length = 2.0
|
||||
loop = true
|
||||
tracks/0/type = "value"
|
||||
tracks/0/path = NodePath("icon:position")
|
||||
tracks/0/interp = 1
|
||||
tracks/0/loop_wrap = true
|
||||
tracks/0/imported = false
|
||||
tracks/0/enabled = true
|
||||
tracks/0/keys = {
|
||||
"times": PoolRealArray( 0, 2 ),
|
||||
"transitions": PoolRealArray( 1, 1 ),
|
||||
"update": 0,
|
||||
"values": [ Vector2( 319.48, 335.423 ), Vector2( 966.209, 326.747 ) ]
|
||||
}
|
||||
tracks/1/type = "value"
|
||||
tracks/1/path = NodePath("icon:rotation_degrees")
|
||||
tracks/1/interp = 1
|
||||
tracks/1/loop_wrap = true
|
||||
tracks/1/imported = false
|
||||
tracks/1/enabled = true
|
||||
tracks/1/keys = {
|
||||
"times": PoolRealArray( 0, 2 ),
|
||||
"transitions": PoolRealArray( 1, 1 ),
|
||||
"update": 0,
|
||||
"values": [ 0.0, 0.0 ]
|
||||
}
|
||||
tracks/2/type = "value"
|
||||
tracks/2/path = NodePath("icon:scale")
|
||||
tracks/2/interp = 1
|
||||
tracks/2/loop_wrap = true
|
||||
tracks/2/imported = false
|
||||
tracks/2/enabled = true
|
||||
tracks/2/keys = {
|
||||
"times": PoolRealArray( 0, 2 ),
|
||||
"transitions": PoolRealArray( 1, 1 ),
|
||||
"update": 0,
|
||||
"values": [ Vector2( 1, 1 ), Vector2( 1, 1 ) ]
|
||||
}
|
||||
|
||||
[sub_resource type="Animation" id=2]
|
||||
resource_name = "animation_2"
|
||||
length = 0.6
|
||||
loop = true
|
||||
tracks/0/type = "value"
|
||||
tracks/0/path = NodePath("player:frame")
|
||||
tracks/0/interp = 1
|
||||
tracks/0/loop_wrap = true
|
||||
tracks/0/imported = false
|
||||
tracks/0/enabled = true
|
||||
tracks/0/keys = {
|
||||
"times": PoolRealArray( 0, 0.1, 0.2, 0.3, 0.4, 0.5 ),
|
||||
"transitions": PoolRealArray( 1, 1, 1, 1, 1, 1 ),
|
||||
"update": 1,
|
||||
"values": [ 0, 1, 2, 3, 4, 5 ]
|
||||
}
|
||||
|
||||
[sub_resource type="SpriteFrames" id=3]
|
||||
animations = [ {
|
||||
"frames": [ ExtResource( 9 ), ExtResource( 10 ), ExtResource( 8 ), ExtResource( 7 ), ExtResource( 2 ), ExtResource( 1 ), ExtResource( 3 ), ExtResource( 5 ) ],
|
||||
"loop": true,
|
||||
"name": "default",
|
||||
"speed": 7.0
|
||||
} ]
|
||||
|
||||
[node name="Node2D" type="Node2D"]
|
||||
|
||||
[node name="Animation_1" type="Node2D" parent="."]
|
||||
|
||||
[node name="Sprite" type="Sprite" parent="Animation_1"]
|
||||
position = Vector2( 317.024, 70.0791 )
|
||||
scale = Vector2( 1.70913, 1.70913 )
|
||||
texture = ExtResource( 6 )
|
||||
hframes = 60
|
||||
script = ExtResource( 11 )
|
||||
|
||||
[node name="Timer" type="Timer" parent="Animation_1/Sprite"]
|
||||
wait_time = 0.1
|
||||
autostart = true
|
||||
|
||||
[node name="Animation_2" type="Node2D" parent="."]
|
||||
|
||||
[node name="Sprite" type="Sprite" parent="Animation_2"]
|
||||
position = Vector2( 307.681, 157.511 )
|
||||
texture = ExtResource( 4 )
|
||||
script = ExtResource( 12 )
|
||||
|
||||
[node name="Tween" type="Tween" parent="Animation_2/Sprite"]
|
||||
repeat = true
|
||||
playback/repeat = true
|
||||
|
||||
[node name="TargetPosition" type="Sprite" parent="."]
|
||||
position = Vector2( 928.381, 170.859 )
|
||||
texture = ExtResource( 4 )
|
||||
|
||||
[node name="Animation_3" type="Node2D" parent="."]
|
||||
|
||||
[node name="icon" type="Sprite" parent="Animation_3"]
|
||||
position = Vector2( 966.209, 326.747 )
|
||||
texture = ExtResource( 4 )
|
||||
|
||||
[node name="AnimationPlayer" type="AnimationPlayer" parent="Animation_3"]
|
||||
autoplay = "my_animation_1"
|
||||
anims/my_animation_1 = SubResource( 1 )
|
||||
|
||||
[node name="Animation_4" type="Node2D" parent="."]
|
||||
|
||||
[node name="player" type="Sprite" parent="Animation_4"]
|
||||
position = Vector2( 319.802, 425.747 )
|
||||
scale = Vector2( 1.86179, 1.57452 )
|
||||
texture = ExtResource( 6 )
|
||||
hframes = 60
|
||||
|
||||
[node name="AnimationPlayer" type="AnimationPlayer" parent="Animation_4"]
|
||||
autoplay = "animation_2"
|
||||
anims/animation_2 = SubResource( 2 )
|
||||
|
||||
[node name="Animation_5" type="Node2D" parent="."]
|
||||
position = Vector2( 308.251, 522.067 )
|
||||
__meta__ = {
|
||||
"_edit_group_": true
|
||||
}
|
||||
|
||||
[node name="AnimatedSprite" type="AnimatedSprite" parent="Animation_5"]
|
||||
frames = SubResource( 3 )
|
||||
frame = 7
|
||||
playing = true
|
||||
|
||||
[connection signal="timeout" from="Animation_1/Sprite/Timer" to="Animation_1/Sprite" method="_on_Timer_timeout"]
|
Before Width: | Height: | Size: 16 KiB |
|
@ -1,34 +0,0 @@
|
|||
[remap]
|
||||
|
||||
importer="texture"
|
||||
type="StreamTexture"
|
||||
path="res://.import/player.png-e28fee2dde34564549f6b47bedcbb62e.stex"
|
||||
metadata={
|
||||
"vram_texture": false
|
||||
}
|
||||
|
||||
[deps]
|
||||
|
||||
source_file="res://scene/demo10_animation/image/player.png"
|
||||
dest_files=[ "res://.import/player.png-e28fee2dde34564549f6b47bedcbb62e.stex" ]
|
||||
|
||||
[params]
|
||||
|
||||
compress/mode=0
|
||||
compress/lossy_quality=0.7
|
||||
compress/hdr_mode=0
|
||||
compress/bptc_ldr=0
|
||||
compress/normal_map=0
|
||||
flags/repeat=0
|
||||
flags/filter=true
|
||||
flags/mipmaps=false
|
||||
flags/anisotropic=false
|
||||
flags/srgb=2
|
||||
process/fix_alpha_border=true
|
||||
process/premult_alpha=false
|
||||
process/HDR_as_SRGB=false
|
||||
process/invert_color=false
|
||||
stream=false
|
||||
size_limit=0
|
||||
detect_3d=true
|
||||
svg/scale=1.0
|
Before Width: | Height: | Size: 893 B |
|
@ -1,34 +0,0 @@
|
|||
[remap]
|
||||
|
||||
importer="texture"
|
||||
type="StreamTexture"
|
||||
path="res://.import/run-1.png-3280c05cb0e4f0094bf9a065f1c420ed.stex"
|
||||
metadata={
|
||||
"vram_texture": false
|
||||
}
|
||||
|
||||
[deps]
|
||||
|
||||
source_file="res://scene/demo10_animation/image/run-1.png"
|
||||
dest_files=[ "res://.import/run-1.png-3280c05cb0e4f0094bf9a065f1c420ed.stex" ]
|
||||
|
||||
[params]
|
||||
|
||||
compress/mode=0
|
||||
compress/lossy_quality=0.7
|
||||
compress/hdr_mode=0
|
||||
compress/bptc_ldr=0
|
||||
compress/normal_map=0
|
||||
flags/repeat=0
|
||||
flags/filter=true
|
||||
flags/mipmaps=false
|
||||
flags/anisotropic=false
|
||||
flags/srgb=2
|
||||
process/fix_alpha_border=true
|
||||
process/premult_alpha=false
|
||||
process/HDR_as_SRGB=false
|
||||
process/invert_color=false
|
||||
stream=false
|
||||
size_limit=0
|
||||
detect_3d=true
|
||||
svg/scale=1.0
|
Before Width: | Height: | Size: 885 B |
|
@ -1,34 +0,0 @@
|
|||
[remap]
|
||||
|
||||
importer="texture"
|
||||
type="StreamTexture"
|
||||
path="res://.import/run-2.png-c6dd0e2a0fd44ecce64d51822fe106eb.stex"
|
||||
metadata={
|
||||
"vram_texture": false
|
||||
}
|
||||
|
||||
[deps]
|
||||
|
||||
source_file="res://scene/demo10_animation/image/run-2.png"
|
||||
dest_files=[ "res://.import/run-2.png-c6dd0e2a0fd44ecce64d51822fe106eb.stex" ]
|
||||
|
||||
[params]
|
||||
|
||||
compress/mode=0
|
||||
compress/lossy_quality=0.7
|
||||
compress/hdr_mode=0
|
||||
compress/bptc_ldr=0
|
||||
compress/normal_map=0
|
||||
flags/repeat=0
|
||||
flags/filter=true
|
||||
flags/mipmaps=false
|
||||
flags/anisotropic=false
|
||||
flags/srgb=2
|
||||
process/fix_alpha_border=true
|
||||
process/premult_alpha=false
|
||||
process/HDR_as_SRGB=false
|
||||
process/invert_color=false
|
||||
stream=false
|
||||
size_limit=0
|
||||
detect_3d=true
|
||||
svg/scale=1.0
|
Before Width: | Height: | Size: 800 B |
|
@ -1,34 +0,0 @@
|
|||
[remap]
|
||||
|
||||
importer="texture"
|
||||
type="StreamTexture"
|
||||
path="res://.import/run-3.png-a7f3ee534265c5117fb56b89486b5e55.stex"
|
||||
metadata={
|
||||
"vram_texture": false
|
||||
}
|
||||
|
||||
[deps]
|
||||
|
||||
source_file="res://scene/demo10_animation/image/run-3.png"
|
||||
dest_files=[ "res://.import/run-3.png-a7f3ee534265c5117fb56b89486b5e55.stex" ]
|
||||
|
||||
[params]
|
||||
|
||||
compress/mode=0
|
||||
compress/lossy_quality=0.7
|
||||
compress/hdr_mode=0
|
||||
compress/bptc_ldr=0
|
||||
compress/normal_map=0
|
||||
flags/repeat=0
|
||||
flags/filter=true
|
||||
flags/mipmaps=false
|
||||
flags/anisotropic=false
|
||||
flags/srgb=2
|
||||
process/fix_alpha_border=true
|
||||
process/premult_alpha=false
|
||||
process/HDR_as_SRGB=false
|
||||
process/invert_color=false
|
||||
stream=false
|
||||
size_limit=0
|
||||
detect_3d=true
|
||||
svg/scale=1.0
|
Before Width: | Height: | Size: 749 B |
|
@ -1,34 +0,0 @@
|
|||
[remap]
|
||||
|
||||
importer="texture"
|
||||
type="StreamTexture"
|
||||
path="res://.import/run-4.png-5f322ba121a10ba33f069dd9c25a1035.stex"
|
||||
metadata={
|
||||
"vram_texture": false
|
||||
}
|
||||
|
||||
[deps]
|
||||
|
||||
source_file="res://scene/demo10_animation/image/run-4.png"
|
||||
dest_files=[ "res://.import/run-4.png-5f322ba121a10ba33f069dd9c25a1035.stex" ]
|
||||
|
||||
[params]
|
||||
|
||||
compress/mode=0
|
||||
compress/lossy_quality=0.7
|
||||
compress/hdr_mode=0
|
||||
compress/bptc_ldr=0
|
||||
compress/normal_map=0
|
||||
flags/repeat=0
|
||||
flags/filter=true
|
||||
flags/mipmaps=false
|
||||
flags/anisotropic=false
|
||||
flags/srgb=2
|
||||
process/fix_alpha_border=true
|
||||
process/premult_alpha=false
|
||||
process/HDR_as_SRGB=false
|
||||
process/invert_color=false
|
||||
stream=false
|
||||
size_limit=0
|
||||
detect_3d=true
|
||||
svg/scale=1.0
|
Before Width: | Height: | Size: 895 B |
|
@ -1,34 +0,0 @@
|
|||
[remap]
|
||||
|
||||
importer="texture"
|
||||
type="StreamTexture"
|
||||
path="res://.import/run-5.png-6dc8b7d6582a966a0b43c5375057d646.stex"
|
||||
metadata={
|
||||
"vram_texture": false
|
||||
}
|
||||
|
||||
[deps]
|
||||
|
||||
source_file="res://scene/demo10_animation/image/run-5.png"
|
||||
dest_files=[ "res://.import/run-5.png-6dc8b7d6582a966a0b43c5375057d646.stex" ]
|
||||
|
||||
[params]
|
||||
|
||||
compress/mode=0
|
||||
compress/lossy_quality=0.7
|
||||
compress/hdr_mode=0
|
||||
compress/bptc_ldr=0
|
||||
compress/normal_map=0
|
||||
flags/repeat=0
|
||||
flags/filter=true
|
||||
flags/mipmaps=false
|
||||
flags/anisotropic=false
|
||||
flags/srgb=2
|
||||
process/fix_alpha_border=true
|
||||
process/premult_alpha=false
|
||||
process/HDR_as_SRGB=false
|
||||
process/invert_color=false
|
||||
stream=false
|
||||
size_limit=0
|
||||
detect_3d=true
|
||||
svg/scale=1.0
|
Before Width: | Height: | Size: 879 B |
|
@ -1,34 +0,0 @@
|
|||
[remap]
|
||||
|
||||
importer="texture"
|
||||
type="StreamTexture"
|
||||
path="res://.import/run-6.png-af2f504c10c840072a12547b0a3c767b.stex"
|
||||
metadata={
|
||||
"vram_texture": false
|
||||
}
|
||||
|
||||
[deps]
|
||||
|
||||
source_file="res://scene/demo10_animation/image/run-6.png"
|
||||
dest_files=[ "res://.import/run-6.png-af2f504c10c840072a12547b0a3c767b.stex" ]
|
||||
|
||||
[params]
|
||||
|
||||
compress/mode=0
|
||||
compress/lossy_quality=0.7
|
||||
compress/hdr_mode=0
|
||||
compress/bptc_ldr=0
|
||||
compress/normal_map=0
|
||||
flags/repeat=0
|
||||
flags/filter=true
|
||||
flags/mipmaps=false
|
||||
flags/anisotropic=false
|
||||
flags/srgb=2
|
||||
process/fix_alpha_border=true
|
||||
process/premult_alpha=false
|
||||
process/HDR_as_SRGB=false
|
||||
process/invert_color=false
|
||||
stream=false
|
||||
size_limit=0
|
||||
detect_3d=true
|
||||
svg/scale=1.0
|
Before Width: | Height: | Size: 835 B |
|
@ -1,34 +0,0 @@
|
|||
[remap]
|
||||
|
||||
importer="texture"
|
||||
type="StreamTexture"
|
||||
path="res://.import/run-7.png-778e3a530cfcb29ce7258e12c61126fb.stex"
|
||||
metadata={
|
||||
"vram_texture": false
|
||||
}
|
||||
|
||||
[deps]
|
||||
|
||||
source_file="res://scene/demo10_animation/image/run-7.png"
|
||||
dest_files=[ "res://.import/run-7.png-778e3a530cfcb29ce7258e12c61126fb.stex" ]
|
||||
|
||||
[params]
|
||||
|
||||
compress/mode=0
|
||||
compress/lossy_quality=0.7
|
||||
compress/hdr_mode=0
|
||||
compress/bptc_ldr=0
|
||||
compress/normal_map=0
|
||||
flags/repeat=0
|
||||
flags/filter=true
|
||||
flags/mipmaps=false
|
||||
flags/anisotropic=false
|
||||
flags/srgb=2
|
||||
process/fix_alpha_border=true
|
||||
process/premult_alpha=false
|
||||
process/HDR_as_SRGB=false
|
||||
process/invert_color=false
|
||||
stream=false
|
||||
size_limit=0
|
||||
detect_3d=true
|
||||
svg/scale=1.0
|
Before Width: | Height: | Size: 760 B |
|
@ -1,34 +0,0 @@
|
|||
[remap]
|
||||
|
||||
importer="texture"
|
||||
type="StreamTexture"
|
||||
path="res://.import/run-8.png-3d745ba5b7d037dda1ae54f02d2b148c.stex"
|
||||
metadata={
|
||||
"vram_texture": false
|
||||
}
|
||||
|
||||
[deps]
|
||||
|
||||
source_file="res://scene/demo10_animation/image/run-8.png"
|
||||
dest_files=[ "res://.import/run-8.png-3d745ba5b7d037dda1ae54f02d2b148c.stex" ]
|
||||
|
||||
[params]
|
||||
|
||||
compress/mode=0
|
||||
compress/lossy_quality=0.7
|
||||
compress/hdr_mode=0
|
||||
compress/bptc_ldr=0
|
||||
compress/normal_map=0
|
||||
flags/repeat=0
|
||||
flags/filter=true
|
||||
flags/mipmaps=false
|
||||
flags/anisotropic=false
|
||||
flags/srgb=2
|
||||
process/fix_alpha_border=true
|
||||
process/premult_alpha=false
|
||||
process/HDR_as_SRGB=false
|
||||
process/invert_color=false
|
||||
stream=false
|
||||
size_limit=0
|
||||
detect_3d=true
|
||||
svg/scale=1.0
|
Before Width: | Height: | Size: 1.0 KiB |
|
@ -1,34 +0,0 @@
|
|||
[remap]
|
||||
|
||||
importer="texture"
|
||||
type="StreamTexture"
|
||||
path="res://.import/white_square.png-1bf12a3951ac2e8d713316b3f8f54ac1.stex"
|
||||
metadata={
|
||||
"vram_texture": false
|
||||
}
|
||||
|
||||
[deps]
|
||||
|
||||
source_file="res://scene/demo11_particle_light/image/white_square.png"
|
||||
dest_files=[ "res://.import/white_square.png-1bf12a3951ac2e8d713316b3f8f54ac1.stex" ]
|
||||
|
||||
[params]
|
||||
|
||||
compress/mode=0
|
||||
compress/lossy_quality=0.7
|
||||
compress/hdr_mode=0
|
||||
compress/bptc_ldr=0
|
||||
compress/normal_map=0
|
||||
flags/repeat=0
|
||||
flags/filter=true
|
||||
flags/mipmaps=false
|
||||
flags/anisotropic=false
|
||||
flags/srgb=2
|
||||
process/fix_alpha_border=true
|
||||
process/premult_alpha=false
|
||||
process/HDR_as_SRGB=false
|
||||
process/invert_color=false
|
||||
stream=false
|
||||
size_limit=0
|
||||
detect_3d=true
|
||||
svg/scale=1.0
|
|
@ -1,28 +0,0 @@
|
|||
[gd_scene load_steps=2 format=2]
|
||||
|
||||
[ext_resource path="res://scene/demo11_particle_light/image/white_square.png" type="Texture" id=1]
|
||||
|
||||
[node name="Node2D" type="Node2D"]
|
||||
|
||||
[node name="SpriteWhite1" type="Sprite" parent="."]
|
||||
modulate = Color( 0.180392, 0.501961, 0.388235, 1 )
|
||||
position = Vector2( 158.801, 162.168 )
|
||||
scale = Vector2( 0.33008, 0.33008 )
|
||||
texture = ExtResource( 1 )
|
||||
|
||||
[node name="SpriteWhite2" type="Sprite" parent="."]
|
||||
modulate = Color( 0.568627, 0.239216, 0.239216, 1 )
|
||||
position = Vector2( 388.318, 165.736 )
|
||||
scale = Vector2( 0.33008, 0.33008 )
|
||||
texture = ExtResource( 1 )
|
||||
|
||||
[node name="SpriteWhite3" type="Sprite" parent="."]
|
||||
modulate = Color( 0.109804, 0.0784314, 0.482353, 1 )
|
||||
position = Vector2( 671.349, 157.411 )
|
||||
scale = Vector2( 0.33008, 0.33008 )
|
||||
texture = ExtResource( 1 )
|
||||
|
||||
[node name="Light2D" type="Light2D" parent="."]
|
||||
position = Vector2( 497.817, 209.206 )
|
||||
scale = Vector2( 3.52112, 0.96036 )
|
||||
texture = ExtResource( 1 )
|
|
@ -1,16 +0,0 @@
|
|||
[gd_scene load_steps=4 format=2]
|
||||
|
||||
[ext_resource path="res://scene/demo11_particle_light/normal_map/azagaya_n.png" type="Texture" id=1]
|
||||
[ext_resource path="res://scene/demo11_particle_light/normal_map/azagaya.png" type="Texture" id=2]
|
||||
[ext_resource path="res://scene/demo11_particle_light/normal_map/LightSprite.png" type="Texture" id=3]
|
||||
|
||||
[node name="Node2D" type="Node2D"]
|
||||
|
||||
[node name="azagaya" type="Sprite" parent="."]
|
||||
position = Vector2( 270, 199.431 )
|
||||
texture = ExtResource( 2 )
|
||||
normal_map = ExtResource( 1 )
|
||||
|
||||
[node name="Light2D" type="Light2D" parent="."]
|
||||
position = Vector2( 306.368, 226.998 )
|
||||
texture = ExtResource( 3 )
|
Before Width: | Height: | Size: 17 KiB |
|
@ -1,34 +0,0 @@
|
|||
[remap]
|
||||
|
||||
importer="texture"
|
||||
type="StreamTexture"
|
||||
path="res://.import/LightSprite.png-c40d01886f4a6ec8b4377142d643177e.stex"
|
||||
metadata={
|
||||
"vram_texture": false
|
||||
}
|
||||
|
||||
[deps]
|
||||
|
||||
source_file="res://scene/demo11_particle_light/normal_map/LightSprite.png"
|
||||
dest_files=[ "res://.import/LightSprite.png-c40d01886f4a6ec8b4377142d643177e.stex" ]
|
||||
|
||||
[params]
|
||||
|
||||
compress/mode=0
|
||||
compress/lossy_quality=0.7
|
||||
compress/hdr_mode=0
|
||||
compress/bptc_ldr=0
|
||||
compress/normal_map=0
|
||||
flags/repeat=0
|
||||
flags/filter=true
|
||||
flags/mipmaps=false
|
||||
flags/anisotropic=false
|
||||
flags/srgb=2
|
||||
process/fix_alpha_border=true
|
||||
process/premult_alpha=false
|
||||
process/HDR_as_SRGB=false
|
||||
process/invert_color=false
|
||||
stream=false
|
||||
size_limit=0
|
||||
detect_3d=true
|
||||
svg/scale=1.0
|
Before Width: | Height: | Size: 24 KiB |
|
@ -1,34 +0,0 @@
|
|||
[remap]
|
||||
|
||||
importer="texture"
|
||||
type="StreamTexture"
|
||||
path="res://.import/azagaya.png-ad429dd9403620b051e8578587d08aea.stex"
|
||||
metadata={
|
||||
"vram_texture": false
|
||||
}
|
||||
|
||||
[deps]
|
||||
|
||||
source_file="res://scene/demo11_particle_light/normal_map/azagaya.png"
|
||||
dest_files=[ "res://.import/azagaya.png-ad429dd9403620b051e8578587d08aea.stex" ]
|
||||
|
||||
[params]
|
||||
|
||||
compress/mode=0
|
||||
compress/lossy_quality=0.7
|
||||
compress/hdr_mode=0
|
||||
compress/bptc_ldr=0
|
||||
compress/normal_map=0
|
||||
flags/repeat=0
|
||||
flags/filter=true
|
||||
flags/mipmaps=false
|
||||
flags/anisotropic=false
|
||||
flags/srgb=2
|
||||
process/fix_alpha_border=true
|
||||
process/premult_alpha=false
|
||||
process/HDR_as_SRGB=false
|
||||
process/invert_color=false
|
||||
stream=false
|
||||
size_limit=0
|
||||
detect_3d=true
|
||||
svg/scale=1.0
|
Before Width: | Height: | Size: 33 KiB |
|
@ -1,34 +0,0 @@
|
|||
[remap]
|
||||
|
||||
importer="texture"
|
||||
type="StreamTexture"
|
||||
path="res://.import/azagaya_n.png-5b93a8bb5a6286587518a775b01152a3.stex"
|
||||
metadata={
|
||||
"vram_texture": false
|
||||
}
|
||||
|
||||
[deps]
|
||||
|
||||
source_file="res://scene/demo11_particle_light/normal_map/azagaya_n.png"
|
||||
dest_files=[ "res://.import/azagaya_n.png-5b93a8bb5a6286587518a775b01152a3.stex" ]
|
||||
|
||||
[params]
|
||||
|
||||
compress/mode=0
|
||||
compress/lossy_quality=0.7
|
||||
compress/hdr_mode=0
|
||||
compress/bptc_ldr=0
|
||||
compress/normal_map=0
|
||||
flags/repeat=0
|
||||
flags/filter=true
|
||||
flags/mipmaps=false
|
||||
flags/anisotropic=false
|
||||
flags/srgb=2
|
||||
process/fix_alpha_border=true
|
||||
process/premult_alpha=false
|
||||
process/HDR_as_SRGB=false
|
||||
process/invert_color=false
|
||||
stream=false
|
||||
size_limit=0
|
||||
detect_3d=true
|
||||
svg/scale=1.0
|
Before Width: | Height: | Size: 34 KiB |
|
@ -1,34 +0,0 @@
|
|||
[remap]
|
||||
|
||||
importer="texture"
|
||||
type="StreamTexture"
|
||||
path="res://.import/simplebrick.png-5e16cb9c113a4ed9a022f89e50a799bc.stex"
|
||||
metadata={
|
||||
"vram_texture": false
|
||||
}
|
||||
|
||||
[deps]
|
||||
|
||||
source_file="res://scene/demo11_particle_light/normal_map/simplebrick.png"
|
||||
dest_files=[ "res://.import/simplebrick.png-5e16cb9c113a4ed9a022f89e50a799bc.stex" ]
|
||||
|
||||
[params]
|
||||
|
||||
compress/mode=0
|
||||
compress/lossy_quality=0.7
|
||||
compress/hdr_mode=0
|
||||
compress/bptc_ldr=0
|
||||
compress/normal_map=0
|
||||
flags/repeat=0
|
||||
flags/filter=true
|
||||
flags/mipmaps=false
|
||||
flags/anisotropic=false
|
||||
flags/srgb=2
|
||||
process/fix_alpha_border=true
|
||||
process/premult_alpha=false
|
||||
process/HDR_as_SRGB=false
|
||||
process/invert_color=false
|
||||
stream=false
|
||||
size_limit=0
|
||||
detect_3d=true
|
||||
svg/scale=1.0
|
Before Width: | Height: | Size: 57 KiB |
|
@ -1,34 +0,0 @@
|
|||
[remap]
|
||||
|
||||
importer="texture"
|
||||
type="StreamTexture"
|
||||
path="res://.import/simplebrick_n.png-b5f5247c3aa4e49d79ccb3dd8d40a42e.stex"
|
||||
metadata={
|
||||
"vram_texture": false
|
||||
}
|
||||
|
||||
[deps]
|
||||
|
||||
source_file="res://scene/demo11_particle_light/normal_map/simplebrick_n.png"
|
||||
dest_files=[ "res://.import/simplebrick_n.png-b5f5247c3aa4e49d79ccb3dd8d40a42e.stex" ]
|
||||
|
||||
[params]
|
||||
|
||||
compress/mode=0
|
||||
compress/lossy_quality=0.7
|
||||
compress/hdr_mode=0
|
||||
compress/bptc_ldr=0
|
||||
compress/normal_map=0
|
||||
flags/repeat=0
|
||||
flags/filter=true
|
||||
flags/mipmaps=false
|
||||
flags/anisotropic=false
|
||||
flags/srgb=2
|
||||
process/fix_alpha_border=true
|
||||
process/premult_alpha=false
|
||||
process/HDR_as_SRGB=false
|
||||
process/invert_color=false
|
||||
stream=false
|
||||
size_limit=0
|
||||
detect_3d=true
|
||||
svg/scale=1.0
|
|
@ -1,40 +0,0 @@
|
|||
[gd_scene load_steps=4 format=2]
|
||||
|
||||
[ext_resource path="res://scene/demo11_particle_light/image/white_square.png" type="Texture" id=1]
|
||||
[ext_resource path="res://icon.png" type="Texture" id=2]
|
||||
|
||||
[sub_resource type="OccluderPolygon2D" id=1]
|
||||
polygon = PoolVector2Array( -149.743, -150.861, -148.283, 150.259, 150.348, 150.259, 150.348, -151.244 )
|
||||
|
||||
[node name="Node2D" type="Node2D"]
|
||||
|
||||
[node name="Background" type="Sprite" parent="."]
|
||||
modulate = Color( 0.427451, 0.392157, 0.392157, 1 )
|
||||
light_mask = 3
|
||||
position = Vector2( 514.927, 190.273 )
|
||||
scale = Vector2( 3, 100 )
|
||||
texture = ExtResource( 1 )
|
||||
|
||||
[node name="Shadow" type="Sprite" parent="."]
|
||||
modulate = Color( 0.490196, 0.0509804, 0.541176, 1 )
|
||||
position = Vector2( 478.061, 140.326 )
|
||||
scale = Vector2( 0.31026, 0.31026 )
|
||||
texture = ExtResource( 1 )
|
||||
|
||||
[node name="LightOccluder2D" type="LightOccluder2D" parent="Shadow"]
|
||||
light_mask = 2
|
||||
occluder = SubResource( 1 )
|
||||
light_mask = 2
|
||||
|
||||
[node name="Light" type="Sprite" parent="."]
|
||||
position = Vector2( 462.666, 380.919 )
|
||||
texture = ExtResource( 2 )
|
||||
__meta__ = {
|
||||
"_edit_group_": true
|
||||
}
|
||||
|
||||
[node name="Light2D" type="Light2D" parent="Light"]
|
||||
scale = Vector2( 10, 10 )
|
||||
texture = ExtResource( 1 )
|
||||
shadow_enabled = true
|
||||
shadow_item_cull_mask = 2
|
|
@ -1,37 +0,0 @@
|
|||
[gd_scene load_steps=7 format=2]
|
||||
|
||||
[ext_resource path="res://scene/demo11_particle_light/image/white_square.png" type="Texture" id=1]
|
||||
|
||||
[sub_resource type="Gradient" id=1]
|
||||
colors = PoolColorArray( 0.29541, 0.150013, 0.150013, 1, 0.682129, 0.167868, 0.167868, 1 )
|
||||
|
||||
[sub_resource type="GradientTexture" id=2]
|
||||
gradient = SubResource( 1 )
|
||||
|
||||
[sub_resource type="Curve" id=3]
|
||||
_data = [ Vector2( 0.0592105, 0.263636 ), 0.0, 0.0, 0, 0, Vector2( 0.532895, 0.745454 ), 0.0, 0.0, 0, 0, Vector2( 0.967105, 0.327273 ), 0.0, 0.0, 0, 0 ]
|
||||
|
||||
[sub_resource type="CurveTexture" id=4]
|
||||
curve = SubResource( 3 )
|
||||
|
||||
[sub_resource type="ParticlesMaterial" id=5]
|
||||
flag_disable_z = true
|
||||
direction = Vector3( 0, -1, 0 )
|
||||
spread = 10.0
|
||||
gravity = Vector3( 0, 0, 0 )
|
||||
initial_velocity = 441.86
|
||||
angular_velocity = 200.93
|
||||
orbit_velocity = 0.0
|
||||
orbit_velocity_random = 0.0
|
||||
scale = 0.2
|
||||
scale_random = 0.36
|
||||
scale_curve = SubResource( 4 )
|
||||
color_ramp = SubResource( 2 )
|
||||
|
||||
[node name="Node2D" type="Node2D"]
|
||||
|
||||
[node name="Particles2D" type="Particles2D" parent="."]
|
||||
position = Vector2( 433.903, 489.402 )
|
||||
amount = 20
|
||||
process_material = SubResource( 5 )
|
||||
texture = ExtResource( 1 )
|
|
@ -1,42 +0,0 @@
|
|||
[gd_scene load_steps=2 format=2]
|
||||
|
||||
[ext_resource path="res://icon.png" type="Texture" id=1]
|
||||
|
||||
[node name="Node2D" type="Node2D"]
|
||||
|
||||
[node name="icon" type="Sprite" parent="."]
|
||||
position = Vector2( 102.421, 70.9156 )
|
||||
texture = ExtResource( 1 )
|
||||
|
||||
[node name="ButtonParent" type="Button" parent="."]
|
||||
margin_left = 323.666
|
||||
margin_top = 121.838
|
||||
margin_right = 376.666
|
||||
margin_bottom = 141.838
|
||||
text = "Parent"
|
||||
__meta__ = {
|
||||
"_edit_use_anchors_": false
|
||||
}
|
||||
|
||||
[node name="Button" type="Button" parent="ButtonParent"]
|
||||
margin_right = 44.0
|
||||
margin_bottom = 20.0
|
||||
text = "Child"
|
||||
|
||||
[node name="Control" type="Control" parent="."]
|
||||
margin_left = 55.1478
|
||||
margin_top = 233.954
|
||||
margin_right = 216.148
|
||||
margin_bottom = 344.954
|
||||
__meta__ = {
|
||||
"_edit_use_anchors_": false
|
||||
}
|
||||
|
||||
[node name="Label" type="Label" parent="Control"]
|
||||
margin_right = 105.0
|
||||
margin_bottom = 14.0
|
||||
rect_pivot_offset = Vector2( 75.7402, 10.9574 )
|
||||
text = "aaaaaaaaaaaaaav"
|
||||
__meta__ = {
|
||||
"_edit_use_anchors_": false
|
||||
}
|
|
@ -1,60 +0,0 @@
|
|||
[gd_scene load_steps=4 format=2]
|
||||
|
||||
[ext_resource path="res://scene/demo12_gui/Source_Han_Sans.ttf" type="DynamicFontData" id=1]
|
||||
|
||||
[sub_resource type="DynamicFont" id=1]
|
||||
font_data = ExtResource( 1 )
|
||||
|
||||
[sub_resource type="DynamicFont" id=2]
|
||||
font_data = ExtResource( 1 )
|
||||
|
||||
[node name="Node2D" type="Node2D"]
|
||||
|
||||
[node name="Label" type="Label" parent="."]
|
||||
margin_left = 25.2518
|
||||
margin_top = 20.3757
|
||||
margin_right = 91.2518
|
||||
margin_bottom = 44.3757
|
||||
rect_pivot_offset = Vector2( 37.8167, 12 )
|
||||
custom_fonts/font = SubResource( 1 )
|
||||
text = "label1你好"
|
||||
__meta__ = {
|
||||
"_edit_use_anchors_": false
|
||||
}
|
||||
|
||||
[node name="Label2" type="Label" parent="."]
|
||||
margin_left = 25.6472
|
||||
margin_top = 62.6466
|
||||
margin_right = 143.647
|
||||
margin_bottom = 86.6466
|
||||
custom_fonts/font = SubResource( 2 )
|
||||
text = "有字体的lable"
|
||||
__meta__ = {
|
||||
"_edit_use_anchors_": false
|
||||
}
|
||||
|
||||
[node name="AcceptDialog" type="AcceptDialog" parent="."]
|
||||
margin_left = 17.2379
|
||||
margin_top = 152.189
|
||||
margin_right = 136.238
|
||||
margin_bottom = 232.189
|
||||
dialog_text = "Are you OK?"
|
||||
|
||||
[node name="Button" type="Button" parent="."]
|
||||
margin_left = 41.0
|
||||
margin_top = 293.0
|
||||
margin_right = 105.0
|
||||
margin_bottom = 313.0
|
||||
text = "cancel"
|
||||
__meta__ = {
|
||||
"_edit_use_anchors_": false
|
||||
}
|
||||
|
||||
[node name="ColorRect" type="ColorRect" parent="."]
|
||||
margin_left = 515.958
|
||||
margin_top = 14.3027
|
||||
margin_right = 697.958
|
||||
margin_bottom = 123.303
|
||||
__meta__ = {
|
||||
"_edit_use_anchors_": false
|
||||
}
|
|
@ -1,39 +0,0 @@
|
|||
[gd_scene load_steps=3 format=2]
|
||||
|
||||
[ext_resource path="res://icon.png" type="Texture" id=1]
|
||||
[ext_resource path="res://script/demo13_camera/switch_camera.gd" type="Script" id=2]
|
||||
|
||||
[node name="Node2D" type="Node2D"]
|
||||
script = ExtResource( 2 )
|
||||
|
||||
[node name="icon" type="Sprite" parent="."]
|
||||
modulate = Color( 0.964706, 0.0313726, 0.0313726, 1 )
|
||||
position = Vector2( -512, 300 )
|
||||
texture = ExtResource( 1 )
|
||||
|
||||
[node name="icon2" type="Sprite" parent="."]
|
||||
modulate = Color( 0.882353, 0.796078, 0.0901961, 1 )
|
||||
position = Vector2( 512, 300 )
|
||||
texture = ExtResource( 1 )
|
||||
|
||||
[node name="icon3" type="Sprite" parent="."]
|
||||
modulate = Color( 0.0588235, 0.152941, 0.584314, 1 )
|
||||
position = Vector2( -512, 900 )
|
||||
texture = ExtResource( 1 )
|
||||
|
||||
[node name="icon4" type="Sprite" parent="."]
|
||||
modulate = Color( 0.0705882, 0.92549, 0.666667, 1 )
|
||||
position = Vector2( 512, 900 )
|
||||
texture = ExtResource( 1 )
|
||||
|
||||
[node name="Camera2D1" type="Camera2D" parent="."]
|
||||
position = Vector2( -512, 300 )
|
||||
|
||||
[node name="Camera2D2" type="Camera2D" parent="."]
|
||||
position = Vector2( 512, 300 )
|
||||
|
||||
[node name="Camera2D3" type="Camera2D" parent="."]
|
||||
position = Vector2( -512, 900 )
|
||||
|
||||
[node name="Camera2D4" type="Camera2D" parent="."]
|
||||
position = Vector2( 512, 900 )
|
|
@ -1,25 +0,0 @@
|
|||
[gd_scene load_steps=3 format=2]
|
||||
|
||||
[ext_resource path="res://script/demo13_camera/player.gd" type="Script" id=1]
|
||||
[ext_resource path="res://icon.png" type="Texture" id=2]
|
||||
|
||||
[node name="Node2D2" type="Node2D"]
|
||||
position = Vector2( -82.76, 10.6787 )
|
||||
|
||||
[node name="icon" type="Sprite" parent="."]
|
||||
modulate = Color( 0.141176, 0.878431, 0.117647, 1 )
|
||||
position = Vector2( -227.193, 239.648 )
|
||||
texture = ExtResource( 2 )
|
||||
|
||||
[node name="icon2" type="Sprite" parent="."]
|
||||
modulate = Color( 0.054902, 0.533333, 0.815686, 1 )
|
||||
position = Vector2( 665.147, 246.323 )
|
||||
texture = ExtResource( 2 )
|
||||
|
||||
[node name="player" type="Sprite" parent="."]
|
||||
position = Vector2( 77.117, 245.968 )
|
||||
texture = ExtResource( 2 )
|
||||
script = ExtResource( 1 )
|
||||
|
||||
[node name="Camera2D" type="Camera2D" parent="player"]
|
||||
current = true
|
|
@ -1,38 +0,0 @@
|
|||
[gd_scene load_steps=3 format=2]
|
||||
|
||||
[ext_resource path="res://icon.png" type="Texture" id=1]
|
||||
[ext_resource path="res://script/demo13_camera/player.gd" type="Script" id=2]
|
||||
|
||||
[node name="Node2D" type="Node2D"]
|
||||
|
||||
[node name="icon" type="Sprite" parent="."]
|
||||
position = Vector2( 73.0152, 64.7613 )
|
||||
texture = ExtResource( 1 )
|
||||
|
||||
[node name="Control" type="Control" parent="."]
|
||||
margin_left = 1.0
|
||||
margin_right = 1024.0
|
||||
margin_bottom = 601.0
|
||||
__meta__ = {
|
||||
"_edit_use_anchors_": false
|
||||
}
|
||||
|
||||
[node name="ViewportContainer" type="ViewportContainer" parent="Control"]
|
||||
modulate = Color( 0.0352941, 0.894118, 0.65098, 1 )
|
||||
margin_left = 770.879
|
||||
margin_top = 437.506
|
||||
margin_right = 1020.88
|
||||
margin_bottom = 587.506
|
||||
__meta__ = {
|
||||
"_edit_use_anchors_": false
|
||||
}
|
||||
|
||||
[node name="Viewport" type="Viewport" parent="Control/ViewportContainer"]
|
||||
size = Vector2( 250, 150 )
|
||||
handle_input_locally = false
|
||||
render_target_update_mode = 3
|
||||
|
||||
[node name="Sprite" type="Sprite" parent="Control/ViewportContainer/Viewport"]
|
||||
position = Vector2( 100, 100 )
|
||||
texture = ExtResource( 1 )
|
||||
script = ExtResource( 2 )
|
|
@ -1,15 +0,0 @@
|
|||
[gd_scene load_steps=3 format=2]
|
||||
|
||||
[ext_resource path="res://scene/demo13_camera/2.move_camera.tscn" type="PackedScene" id=1]
|
||||
[ext_resource path="res://scene/demo13_camera/mini_viewport.tscn" type="PackedScene" id=2]
|
||||
|
||||
[node name="Node2D" type="Node2D"]
|
||||
|
||||
[node name="Node2D" parent="." instance=ExtResource( 1 )]
|
||||
|
||||
[node name="CanvasLayer" type="CanvasLayer" parent="."]
|
||||
|
||||
[node name="Control" parent="CanvasLayer" instance=ExtResource( 2 )]
|
||||
modulate = Color( 0.894118, 0.792157, 0.792157, 1 )
|
||||
margin_right = 0.0
|
||||
margin_bottom = 0.0
|
|
@ -1,30 +0,0 @@
|
|||
[gd_scene load_steps=2 format=2]
|
||||
|
||||
[ext_resource path="res://scene/demo13_camera/2.move_camera.tscn" type="PackedScene" id=1]
|
||||
|
||||
[node name="Control" type="Control"]
|
||||
anchor_right = 1.0
|
||||
anchor_bottom = 1.0
|
||||
margin_right = -1024.0
|
||||
margin_bottom = -600.0
|
||||
__meta__ = {
|
||||
"_edit_use_anchors_": false
|
||||
}
|
||||
|
||||
[node name="ViewportContainer" type="ViewportContainer" parent="."]
|
||||
margin_left = 773.127
|
||||
margin_top = 444.248
|
||||
margin_right = 1023.13
|
||||
margin_bottom = 594.248
|
||||
__meta__ = {
|
||||
"_edit_use_anchors_": false
|
||||
}
|
||||
|
||||
[node name="Viewport" type="Viewport" parent="ViewportContainer"]
|
||||
size = Vector2( 250, 150 )
|
||||
handle_input_locally = false
|
||||
render_target_update_mode = 3
|
||||
|
||||
[node name="Camera2D" type="Camera2D" parent="ViewportContainer/Viewport"]
|
||||
|
||||
[node name="Node2D" parent="ViewportContainer/Viewport" instance=ExtResource( 1 )]
|
|
@ -1,6 +0,0 @@
|
|||
[gd_scene load_steps=2 format=2]
|
||||
|
||||
[ext_resource path="res://script/demo14_file/file.gd" type="Script" id=1]
|
||||
|
||||
[node name="Node2D" type="Node2D"]
|
||||
script = ExtResource( 1 )
|
|
@ -1,15 +0,0 @@
|
|||
[remap]
|
||||
|
||||
importer="mp3"
|
||||
type="AudioStreamMP3"
|
||||
path="res://.import/Follow Me - Andrew Langdon.mp3-208cd3bb30a229567f90fba5350fdc21.mp3str"
|
||||
|
||||
[deps]
|
||||
|
||||
source_file="res://scene/demo15_audio/audio/Follow Me - Andrew Langdon.mp3"
|
||||
dest_files=[ "res://.import/Follow Me - Andrew Langdon.mp3-208cd3bb30a229567f90fba5350fdc21.mp3str" ]
|
||||
|
||||
[params]
|
||||
|
||||
loop=true
|
||||
loop_offset=0
|
|
@ -1,9 +0,0 @@
|
|||
[gd_scene load_steps=2 format=2]
|
||||
|
||||
[ext_resource path="res://scene/demo15_audio/audio/Follow Me - Andrew Langdon.mp3" type="AudioStream" id=1]
|
||||
|
||||
[node name="Node2D" type="Node2D"]
|
||||
|
||||
[node name="AudioStreamPlayer" type="AudioStreamPlayer" parent="."]
|
||||
stream = ExtResource( 1 )
|
||||
autoplay = true
|
|
@ -1,35 +0,0 @@
|
|||
[gd_scene load_steps=3 format=2]
|
||||
|
||||
[ext_resource path="res://scene/demo15_audio/audio/Follow Me - Andrew Langdon.mp3" type="AudioStream" id=1]
|
||||
|
||||
[sub_resource type="Animation" id=1]
|
||||
resource_name = "music"
|
||||
length = 10.0
|
||||
loop = true
|
||||
tracks/0/type = "audio"
|
||||
tracks/0/path = NodePath("AudioStreamPlayer")
|
||||
tracks/0/interp = 1
|
||||
tracks/0/loop_wrap = true
|
||||
tracks/0/imported = false
|
||||
tracks/0/enabled = true
|
||||
tracks/0/keys = {
|
||||
"clips": [ {
|
||||
"end_offset": 0.0,
|
||||
"start_offset": 12.0,
|
||||
"stream": ExtResource( 1 )
|
||||
}, {
|
||||
"end_offset": 0.0,
|
||||
"start_offset": 0.0,
|
||||
"stream": null
|
||||
} ],
|
||||
"times": PoolRealArray( 0, 10.1 )
|
||||
}
|
||||
|
||||
[node name="Node2D" type="Node2D"]
|
||||
|
||||
[node name="AudioStreamPlayer" type="AudioStreamPlayer" parent="."]
|
||||
stream = ExtResource( 1 )
|
||||
|
||||
[node name="AnimationPlayer" type="AnimationPlayer" parent="."]
|
||||
autoplay = "music"
|
||||
anims/music = SubResource( 1 )
|
|
@ -1,12 +0,0 @@
|
|||
[gd_scene load_steps=3 format=2]
|
||||
|
||||
[ext_resource path="res://script/demo16_http/http_request.gd" type="Script" id=1]
|
||||
[ext_resource path="res://script/demo16_http/http_utils.gd" type="Script" id=2]
|
||||
|
||||
[node name="Node2D" type="Node2D"]
|
||||
|
||||
[node name="HTTPRequest" type="HTTPRequest" parent="."]
|
||||
script = ExtResource( 1 )
|
||||
|
||||
[node name="HttpUtils" type="Node2D" parent="."]
|
||||
script = ExtResource( 2 )
|
|
@ -1,6 +0,0 @@
|
|||
[gd_scene load_steps=2 format=2]
|
||||
|
||||
[ext_resource path="res://script/demo_test/demoTest.gd" type="Script" id=1]
|
||||
|
||||
[node name="Node2D" type="Node2D"]
|
||||
script = ExtResource( 1 )
|
|
@ -1,11 +0,0 @@
|
|||
extends Node2D
|
||||
|
||||
|
||||
# Declare member variables here. Examples:
|
||||
# var a = 2
|
||||
# var b = "text"
|
||||
|
||||
|
||||
# Called when the node enters the scene tree for the first time.
|
||||
func _ready():
|
||||
print("Hello World")
|
|
@ -1,4 +0,0 @@
|
|||
extends Reference
|
||||
|
||||
# 表示B对象
|
||||
var b
|
|
@ -1,4 +0,0 @@
|
|||
extends Reference
|
||||
|
||||
# 表示A对象
|
||||
var a
|
|
@ -1,4 +0,0 @@
|
|||
extends Node2D
|
||||
|
||||
func _to_string():
|
||||
print("This is C Node2!")
|
|
@ -1,5 +0,0 @@
|
|||
# 如果没有继承任何类,则默认继承Reference
|
||||
extends Reference
|
||||
|
||||
func _to_string():
|
||||
print("This is C Reference!")
|
|
@ -1,177 +0,0 @@
|
|||
extends Node2D
|
||||
|
||||
const StringUtils = preload("res://zfoo/util/StringUtils.gd")
|
||||
|
||||
# (optional) class definition with a custom icon
|
||||
class_name MyClass, "res://icon.png"
|
||||
|
||||
|
||||
|
||||
# Member variables
|
||||
# gds有5种基础类型,Boolean,Integer(Java long),Float(Java double),String,Null
|
||||
|
||||
# &&=and ||=or !=not
|
||||
var a = (true or false) && true
|
||||
var b = 9223372036854775807
|
||||
var c = 1.5
|
||||
var s = "Hello"
|
||||
var arr = [1, 2, 3]
|
||||
var dict = {
|
||||
2: 3,
|
||||
"key": "字符串作为key",
|
||||
arr: "数组作为key"
|
||||
}
|
||||
var typed_var: int
|
||||
var typed_var_float: float
|
||||
var typed_var_bool: bool
|
||||
var inferred_type: String = "String"
|
||||
|
||||
# Constants
|
||||
|
||||
const ANSWER = 42
|
||||
const THE_NAME = "Charly"
|
||||
|
||||
# Enums
|
||||
|
||||
enum {LEFT, RRIGHT, FRONT, BACK}
|
||||
# 等价于
|
||||
# const LEFT = 0
|
||||
# const RIGHT = 1
|
||||
# const FRONT = 2
|
||||
# const BACK = 3
|
||||
enum FOOD {GOOD, NORMAL, BAD = -1}
|
||||
|
||||
# Built-in vector types
|
||||
|
||||
var v2 = Vector2(1, 2)
|
||||
var v3 = Vector3(1, 2, 3)
|
||||
|
||||
func _init():
|
||||
pass
|
||||
|
||||
static func getAnswer():
|
||||
return ANSWER
|
||||
|
||||
func typeInfo():
|
||||
var template = "[Variant:{}] [type:{}] [value:{}]"
|
||||
print(StringUtils.format(template, [TYPE_BOOL, typeof(a), a]))
|
||||
print(StringUtils.format(template, [TYPE_INT, typeof(b), b]))
|
||||
print(StringUtils.format(template, [TYPE_INT, typeof(c), c]))
|
||||
print(StringUtils.format(template, [TYPE_STRING, typeof(s), s]))
|
||||
# print(StringUtils.format(template, [TYPE_ARRAY, typeof(arr), arr]))
|
||||
print(StringUtils.format(template, [TYPE_DICTIONARY, typeof(dict), dict]))
|
||||
print(StringUtils.format(template, [TYPE_DICTIONARY, typeof(FOOD), FOOD]))
|
||||
print(StringUtils.format(template, [TYPE_DICTIONARY, typeof(FOOD.GOOD), FOOD.GOOD]))
|
||||
# 在java中类似于this
|
||||
print(self is Node)
|
||||
print(a is Dog) # 类似于instanceof
|
||||
|
||||
func if_function(param1, param2):
|
||||
if param1 < param2:
|
||||
print(param1)
|
||||
elif param2 > 5:
|
||||
print(param2)
|
||||
else:
|
||||
print("Fail!")
|
||||
|
||||
|
||||
func switch_function():
|
||||
var local_var = 5
|
||||
|
||||
match local_var:
|
||||
1:
|
||||
print("match1")
|
||||
2:
|
||||
print("match2")
|
||||
5:
|
||||
print("match5")
|
||||
# continue
|
||||
6:
|
||||
print("match6")
|
||||
_:
|
||||
print("match_")
|
||||
|
||||
|
||||
func loop_function():
|
||||
for i in range(20):
|
||||
print(i)
|
||||
|
||||
var param = 10
|
||||
while param != 0:
|
||||
param -= 1
|
||||
|
||||
return param
|
||||
|
||||
# Function
|
||||
func arrayIterator():
|
||||
# range等价于for(int i = 0; i < 20; i++)
|
||||
print("数组遍历方法1:")
|
||||
for i in range(3):
|
||||
print(i)
|
||||
print("数组遍历方法2:")
|
||||
for ele in arr:
|
||||
print(ele)
|
||||
print("数组遍历方法3:")
|
||||
for index in range(arr.size()):
|
||||
print(arr[index])
|
||||
|
||||
|
||||
func dictionaryIterator():
|
||||
print("字典遍历方法1:")
|
||||
for key in dict:
|
||||
print("key:" + key as String)
|
||||
print("value:" + dict[key] as String)
|
||||
|
||||
print("字典遍历方法2:")
|
||||
for key in dict.keys():
|
||||
print("key:" + key as String)
|
||||
print("value:" + dict[key] as String)
|
||||
|
||||
print("字典遍历方法3:")
|
||||
for value in dict.values():
|
||||
print("value:" + value as String)
|
||||
|
||||
|
||||
|
||||
|
||||
func innerClassTest():
|
||||
var dog = Dog.new(1)
|
||||
dog.move()
|
||||
|
||||
dog.info()
|
||||
dog.height = 2
|
||||
dog.info()
|
||||
|
||||
# Inner class,默认继承Object
|
||||
class Animal:
|
||||
extends Object # 如果不指定继承的类,默认基础Object
|
||||
const STATIC_FIELD = "静态变量"
|
||||
# 属性
|
||||
var height: int
|
||||
|
||||
func _init():
|
||||
print("Animal 构造方法")
|
||||
|
||||
func move():
|
||||
print("animal,移动")
|
||||
|
||||
static func staticFuction():
|
||||
pass
|
||||
|
||||
class Dog:
|
||||
extends Animal
|
||||
|
||||
# Constructor
|
||||
func _init(height):
|
||||
self.height = height
|
||||
print("Dog 构造方法")
|
||||
|
||||
# Functions override functions with the same name on the base/parent class.
|
||||
func move():
|
||||
print("dog,用4个脚跑")
|
||||
# If you still want to call them, use '.' (like 'super' in other languages).
|
||||
.move()
|
||||
|
||||
func info(parm = 100):
|
||||
print("height:" + height as String)
|
||||
|
|
@ -1,59 +0,0 @@
|
|||
extends Node2D
|
||||
|
||||
|
||||
# 导出一个数字
|
||||
export var a = 1
|
||||
# 导出一个节点路径
|
||||
export var b:NodePath
|
||||
# 导出一个节点路径,不同的写法
|
||||
export(NodePath) var c
|
||||
# 导出一个文件路径
|
||||
export(String, FILE) var e
|
||||
# 导出一个文件路径,以txt结尾
|
||||
export(String, FILE, "*.txt") var d
|
||||
# 导出一个资源文件路径
|
||||
export(Resource) var f
|
||||
# 导出一个颜色
|
||||
export(Color, RGB) var g
|
||||
|
||||
func _init():
|
||||
print("init")
|
||||
|
||||
|
||||
# Called when the node enters the scene tree for the first time.
|
||||
func _ready():
|
||||
print("ready")
|
||||
print("new一个对象--------------------------------")
|
||||
var myClass = MyClass.new()
|
||||
print(myClass.to_string())
|
||||
|
||||
print("数据类型信息--------------------------------")
|
||||
myClass.typeInfo()
|
||||
|
||||
print("基础语法if else--------------------------------")
|
||||
myClass.if_function(1, 2)
|
||||
|
||||
print("基础语法switch--------------------------------")
|
||||
myClass.switch_function()
|
||||
|
||||
print("基础语法while for--------------------------------")
|
||||
myClass.loop_function()
|
||||
|
||||
print("数组遍历--------------------------------")
|
||||
myClass.arrayIterator()
|
||||
|
||||
print("字典遍历--------------------------------")
|
||||
myClass.dictionaryIterator()
|
||||
|
||||
print("访问静态变量--------------------------------")
|
||||
var answer = MyClass.ANSWER
|
||||
print("访问const变量,类似于static变量:" + answer as String)
|
||||
|
||||
print("调用静态方法--------------------------------")
|
||||
print("调用静态方法:" + MyClass.getAnswer() as String)
|
||||
|
||||
|
||||
print("内部类测试--------------------------------")
|
||||
myClass.innerClassTest()
|
||||
|
||||
|
|
@ -1,46 +0,0 @@
|
|||
extends Node2D
|
||||
|
||||
const CNode = preload("res://script/demo02_base/CNode.gd")
|
||||
const CReference = preload("res://script/demo02_base/CReference.gd")
|
||||
|
||||
# monitor初探
|
||||
func _ready():
|
||||
#nodeTest()
|
||||
#nodeFreeTest()
|
||||
#nodeQueueFreeTest()
|
||||
#referenceTest()
|
||||
#referenceFreeTest()
|
||||
referencUnreferenceTest()
|
||||
pass
|
||||
|
||||
|
||||
func nodeTest():
|
||||
for i in range(10000):
|
||||
var instance = CNode.new()
|
||||
|
||||
|
||||
func nodeFreeTest():
|
||||
for i in range(10000):
|
||||
var instance = CNode.new()
|
||||
instance.free()
|
||||
|
||||
# queue_free效率更高
|
||||
func nodeQueueFreeTest():
|
||||
for i in range(10000):
|
||||
var instance = CNode.new()
|
||||
instance.queue_free()
|
||||
|
||||
func referenceTest():
|
||||
for i in range(10000):
|
||||
var instance = CReference.new()
|
||||
|
||||
|
||||
func referenceFreeTest():
|
||||
for i in range(10000):
|
||||
var instance = CReference.new()
|
||||
instance.free()
|
||||
|
||||
func referencUnreferenceTest():
|
||||
for i in range(10000):
|
||||
var instance = CReference.new()
|
||||
instance.unreference()
|
|
@ -1,38 +0,0 @@
|
|||
extends Node2D
|
||||
|
||||
const A = preload("res://script/demo02_base/A.gd")
|
||||
const B = preload("res://script/demo02_base/B.gd")
|
||||
|
||||
func _ready():
|
||||
#referenceTest()
|
||||
#referenceCycleTest()
|
||||
referenceUnreference1Test()
|
||||
#referenceUnreference2Test()
|
||||
pass
|
||||
|
||||
|
||||
func referenceTest():
|
||||
var a = A.new()
|
||||
var b = B.new()
|
||||
|
||||
func referenceCycleTest():
|
||||
var a = A.new()
|
||||
var b = B.new()
|
||||
a.b = b
|
||||
b.a = a
|
||||
|
||||
|
||||
func referenceUnreference1Test():
|
||||
var a = A.new()
|
||||
var b = B.new()
|
||||
a.b = b
|
||||
b.a = a
|
||||
a.unreference()
|
||||
|
||||
func referenceUnreference2Test():
|
||||
var a = A.new()
|
||||
var b = B.new()
|
||||
a.b = b
|
||||
b.a = a
|
||||
a.unreference()
|
||||
b.unreference()
|
|
@ -1,28 +0,0 @@
|
|||
extends Node2D
|
||||
|
||||
|
||||
func _ready():
|
||||
# new一个Sprite节点
|
||||
var sprite = Sprite.new()
|
||||
|
||||
# 设置图片
|
||||
var icon = preload("res://icon.png")
|
||||
sprite.set_texture(icon)
|
||||
|
||||
# 修改名称
|
||||
sprite.name = "mynode"
|
||||
|
||||
# 修改坐标居中
|
||||
sprite.position.x = 200
|
||||
sprite.position.y = 200
|
||||
|
||||
# 添加到当前的场景中
|
||||
add_child(sprite)
|
||||
pass
|
||||
|
||||
|
||||
|
||||
func _process(delta):
|
||||
var sprite = $mynode
|
||||
sprite.rotate(0.1)
|
||||
pass
|