diff --git a/assets/Media/Prefabs/Game/Bat.prefab b/assets/Media/Prefabs/Game/Bat.prefab index c87ec9e..d06bf05 100644 --- a/assets/Media/Prefabs/Game/Bat.prefab +++ b/assets/Media/Prefabs/Game/Bat.prefab @@ -271,6 +271,10 @@ "sprite": { "__id__": 5 }, + "defaultMaterial": { + "__uuid__": "fda095cb-831d-4601-ad94-846013963de8", + "__expectedType__": "cc.Material" + }, "whiteMaterial": { "__uuid__": "9cb17675-370b-48ed-bfa2-bb613a88af44", "__expectedType__": "cc.Material" diff --git a/assets/Media/Prefabs/Game/Goblin.prefab b/assets/Media/Prefabs/Game/Goblin.prefab index 8d432cc..4106886 100644 --- a/assets/Media/Prefabs/Game/Goblin.prefab +++ b/assets/Media/Prefabs/Game/Goblin.prefab @@ -271,6 +271,10 @@ "sprite": { "__id__": 5 }, + "defaultMaterial": { + "__uuid__": "fda095cb-831d-4601-ad94-846013963de8", + "__expectedType__": "cc.Material" + }, "whiteMaterial": { "__uuid__": "9cb17675-370b-48ed-bfa2-bb613a88af44", "__expectedType__": "cc.Material" diff --git a/assets/Media/Prefabs/Game/Shark.prefab b/assets/Media/Prefabs/Game/Shark.prefab index 210a032..c62a0d4 100644 --- a/assets/Media/Prefabs/Game/Shark.prefab +++ b/assets/Media/Prefabs/Game/Shark.prefab @@ -271,6 +271,10 @@ "sprite": { "__id__": 5 }, + "defaultMaterial": { + "__uuid__": "fda095cb-831d-4601-ad94-846013963de8", + "__expectedType__": "cc.Material" + }, "whiteMaterial": { "__uuid__": "9cb17675-370b-48ed-bfa2-bb613a88af44", "__expectedType__": "cc.Material" diff --git a/assets/Scripts/Game/Unit/Enemy/Enemy.ts b/assets/Scripts/Game/Unit/Enemy/Enemy.ts index cf8d660..4142817 100644 --- a/assets/Scripts/Game/Unit/Enemy/Enemy.ts +++ b/assets/Scripts/Game/Unit/Enemy/Enemy.ts @@ -12,13 +12,12 @@ const { ccclass, property } = _decorator; export class Enemy extends Component { @property(BoxCollider2D) private collider: BoxCollider2D; @property(Sprite) private sprite: Sprite; + @property(Material) private defaultMaterial: Material; @property(Material) private whiteMaterial: Material; private deathEvent: Signal = new Signal(); private lifetimeEndedEvent: Signal = new Signal(); - private defaultMaterial: Material; - private movementType: EnemyMovementType; private health: UnitHealth; private damage: number; @@ -32,8 +31,6 @@ export class Enemy extends Component { private endOfLifetimeTriggered = false; public setup(position: Vec3, settings: EnemySettings): void { - this.defaultMaterial = this.sprite.material; - this.movementType = settings.moveType; this.health = new UnitHealth(settings.health); this.damage = settings.damage;