diff --git a/AnthroBase/Sources/AnthroBase/AnthroCharacterBody2D+ClassProps.swift b/AnthroBase/Sources/AnthroBase/AnthroCharacterBody2D+ClassProps.swift index d1acd7e..4665ed3 100644 --- a/AnthroBase/Sources/AnthroBase/AnthroCharacterBody2D+ClassProps.swift +++ b/AnthroBase/Sources/AnthroBase/AnthroCharacterBody2D+ClassProps.swift @@ -69,6 +69,7 @@ extension AnthroCharacterBody2D { func setCharacter(args: [Variant]) -> Variant? { ClassInfo.withCheckedProperty(named: "character", in: args) { arg in character = Character(rawValue: Int(arg) ?? 0) ?? .chelsea + changeSprites() } } diff --git a/AnthroBase/Sources/AnthroBase/AnthroCharacterBody2D.swift b/AnthroBase/Sources/AnthroBase/AnthroCharacterBody2D.swift index c23d255..84d7d99 100644 --- a/AnthroBase/Sources/AnthroBase/AnthroCharacterBody2D.swift +++ b/AnthroBase/Sources/AnthroBase/AnthroCharacterBody2D.swift @@ -22,7 +22,7 @@ public class AnthroCharacterBody2D: CharacterBody2D { @PickerNameProvider public enum Character: Int { case chelsea - case sky + case obel } @SceneTree(path: "Sprite") @@ -75,6 +75,15 @@ public class AnthroCharacterBody2D: CharacterBody2D { super._physicsProcess(delta: delta) } + func changeSprites() { + switch character { + case .chelsea: + sprite?.texture = #texture2DLiteral("res://resources/sprt_chelsea.png") + case .obel: + sprite?.texture = #texture2DLiteral("res://resources/sprt_obel.png") + } + } + private func updateBlendingProperties(with vector: Vector2) { guard let animationTree else { GD.pushError("Animation tree is missing.")