weapon item 优化
parent
89e6e00aae
commit
2a618231ac
@ -1,12 +1,16 @@
|
|||||||
extends Control
|
extends Control
|
||||||
class_name WeaponItemSub
|
class_name WeaponItemSub
|
||||||
|
|
||||||
|
var icon : TextureRect
|
||||||
|
var slot : TextureRect
|
||||||
|
|
||||||
func set_texture(value:Texture2D):
|
func init(value:Texture2D):
|
||||||
$WeaponIcon.texture = value
|
icon = $WeaponIcon
|
||||||
|
slot = $WeaponSlot
|
||||||
|
icon.texture = value
|
||||||
|
|
||||||
func update_alpha(alpha_from:float,alpha_to:float,rate:float):
|
func update_alpha(alpha_from:float,alpha_to:float,rate:float):
|
||||||
var alpha = lerp(alpha_from,alpha_to,rate)
|
var alpha = lerp(alpha_from,alpha_to,rate)
|
||||||
$WeaponIcon.modulate = Color(1,1,1,alpha)
|
icon.modulate = Color(1,1,1,alpha)
|
||||||
$WeaponSlot.modulate = Color(1,1,1,alpha)
|
slot.modulate = Color(1,1,1,alpha)
|
||||||
|
|
||||||
|
|||||||
Loading…
Reference in New Issue