diff --git a/DungeonShooting_Godot/prefab/bullet/laser/Laser0001.tscn b/DungeonShooting_Godot/prefab/bullet/laser/Laser0001.tscn new file mode 100644 index 0000000..4eab51b --- /dev/null +++ b/DungeonShooting_Godot/prefab/bullet/laser/Laser0001.tscn @@ -0,0 +1,19 @@ +[gd_scene load_steps=3 format=3 uid="uid://d1q8jjtgi2wpu"] + +[ext_resource type="Script" path="res://src/game/activity/bullet/laser/Laser.cs" id="1_d486x"] + +[sub_resource type="RectangleShape2D" id="RectangleShape2D_l4vuk"] +resource_local_to_scene = true + +[node name="Laser0001" type="Area2D"] +collision_layer = 2 +monitorable = false +script = ExtResource("1_d486x") + +[node name="CollisionShape2D" type="CollisionShape2D" parent="."] +shape = SubResource("RectangleShape2D_l4vuk") + +[node name="Line2D" type="Line2D" parent="."] +points = PackedVector2Array(0, 0, 0, 0) +width = 0.0 +default_color = Color(0, 1.27, 1.4, 1) diff --git a/DungeonShooting_Godot/resource/map/tileMaps/TestGroup1/inlet/Start1/Preinstall.json b/DungeonShooting_Godot/resource/map/tileMaps/TestGroup1/inlet/Start1/Preinstall.json index 582ee5f..a37d0ea 100644 --- a/DungeonShooting_Godot/resource/map/tileMaps/TestGroup1/inlet/Start1/Preinstall.json +++ b/DungeonShooting_Godot/resource/map/tileMaps/TestGroup1/inlet/Start1/Preinstall.json @@ -1 +1 @@ -[{"Name":"test1","Weight":100,"Remark":"","WaveList":[[{"Position":{"X":19,"Y":2},"Size":{"X":0,"Y":0},"SpecialMarkType":1,"DelayTime":0,"MarkList":[]},{"Position":{"X":-76,"Y":35},"Size":{"X":0,"Y":0},"SpecialMarkType":0,"DelayTime":0,"MarkList":[{"Id":"weapon0001","Weight":100,"Attr":{"CurrAmmon":"30","ResidueAmmo":"210"},"Altitude":8,"VerticalSpeed":0}]},{"Position":{"X":-79,"Y":46},"Size":{"X":16,"Y":16},"SpecialMarkType":0,"DelayTime":0,"MarkList":[{"Id":"weapon0002","Weight":100,"Attr":{"CurrAmmon":"7","ResidueAmmo":"70"},"Altitude":8,"VerticalSpeed":0}]},{"Position":{"X":-75,"Y":2},"Size":{"X":16,"Y":16},"SpecialMarkType":0,"DelayTime":0,"MarkList":[{"Id":"weapon0004","Weight":100,"Attr":{"CurrAmmon":"180","ResidueAmmo":"90"},"Altitude":8,"VerticalSpeed":0}]},{"Position":{"X":-75,"Y":67},"Size":{"X":16,"Y":16},"SpecialMarkType":0,"DelayTime":0,"MarkList":[{"Id":"weapon0005","Weight":100,"Attr":{"CurrAmmon":"10","ResidueAmmo":"40"},"Altitude":8,"VerticalSpeed":0}]},{"Position":{"X":-73,"Y":-18},"Size":{"X":16,"Y":16},"SpecialMarkType":0,"DelayTime":0,"MarkList":[{"Id":"weapon0003","Weight":100,"Attr":{"CurrAmmon":"12","ResidueAmmo":"90"},"Altitude":8,"VerticalSpeed":0}]},{"Position":{"X":-76,"Y":21},"Size":{"X":16,"Y":16},"SpecialMarkType":0,"DelayTime":0,"MarkList":[{"Id":"weapon0006","Weight":100,"Attr":{"CurrAmmon":"20","ResidueAmmo":"300"},"Altitude":8,"VerticalSpeed":0}]},{"Position":{"X":-74,"Y":-30},"Size":{"X":16,"Y":16},"SpecialMarkType":0,"DelayTime":0,"MarkList":[{"Id":"weapon0007","Weight":100,"Attr":{"CurrAmmon":"60","ResidueAmmo":"300"},"Altitude":8,"VerticalSpeed":0}]}],[{"Position":{"X":55,"Y":67},"Size":{"X":16,"Y":16},"SpecialMarkType":0,"DelayTime":0,"MarkList":[{"Id":"prop0003","Weight":100,"Attr":null,"Altitude":8,"VerticalSpeed":0}]},{"Position":{"X":56,"Y":24},"Size":{"X":16,"Y":16},"SpecialMarkType":0,"DelayTime":0.5,"MarkList":[{"Id":"prop5000","Weight":100,"Attr":null,"Altitude":8,"VerticalSpeed":0}]},{"Position":{"X":56,"Y":0},"Size":{"X":16,"Y":16},"SpecialMarkType":0,"DelayTime":1,"MarkList":[{"Id":"prop5001","Weight":100,"Attr":null,"Altitude":8,"VerticalSpeed":0}]},{"Position":{"X":34,"Y":23},"Size":{"X":16,"Y":16},"SpecialMarkType":0,"DelayTime":1.5,"MarkList":[{"Id":"prop0002","Weight":100,"Attr":null,"Altitude":8,"VerticalSpeed":0}]},{"Position":{"X":55,"Y":44},"Size":{"X":16,"Y":16},"SpecialMarkType":0,"DelayTime":0,"MarkList":[{"Id":"prop5001","Weight":100,"Attr":null,"Altitude":8,"VerticalSpeed":0}]},{"Position":{"X":56,"Y":-24},"Size":{"X":16,"Y":16},"SpecialMarkType":0,"DelayTime":0,"MarkList":[{"Id":"prop5001","Weight":100,"Attr":null,"Altitude":8,"VerticalSpeed":0}]},{"Position":{"X":-16,"Y":16},"Size":{"X":16,"Y":16},"SpecialMarkType":0,"DelayTime":0,"MarkList":[{"Id":"enemy0001","Weight":100,"Attr":{"Face":"0","Weapon":"weapon0005","CurrAmmon":"10","ResidueAmmo":"10"},"Altitude":0,"VerticalSpeed":0}]}]]}] \ No newline at end of file +[{"Name":"test1","Weight":100,"Remark":"","WaveList":[[{"Position":{"X":19,"Y":2},"Size":{"X":0,"Y":0},"SpecialMarkType":1,"DelayTime":0,"MarkList":[]},{"Position":{"X":24,"Y":-14},"Size":{"X":0,"Y":0},"SpecialMarkType":0,"DelayTime":0,"MarkList":[{"Id":"weapon0001","Weight":100,"Attr":{"CurrAmmon":"30","ResidueAmmo":"210"},"Altitude":8,"VerticalSpeed":0}]},{"Position":{"X":6,"Y":34},"Size":{"X":16,"Y":16},"SpecialMarkType":0,"DelayTime":0,"MarkList":[{"Id":"weapon0002","Weight":100,"Attr":{"CurrAmmon":"7","ResidueAmmo":"70"},"Altitude":8,"VerticalSpeed":0}]},{"Position":{"X":-42,"Y":9},"Size":{"X":16,"Y":16},"SpecialMarkType":0,"DelayTime":0,"MarkList":[{"Id":"weapon0004","Weight":100,"Attr":{"CurrAmmon":"180","ResidueAmmo":"90"},"Altitude":8,"VerticalSpeed":0}]},{"Position":{"X":-63,"Y":-18},"Size":{"X":16,"Y":16},"SpecialMarkType":0,"DelayTime":0,"MarkList":[{"Id":"weapon0005","Weight":100,"Attr":{"CurrAmmon":"10","ResidueAmmo":"40"},"Altitude":8,"VerticalSpeed":0}]},{"Position":{"X":-31,"Y":-16},"Size":{"X":16,"Y":16},"SpecialMarkType":0,"DelayTime":0,"MarkList":[{"Id":"weapon0003","Weight":100,"Attr":{"CurrAmmon":"12","ResidueAmmo":"90"},"Altitude":8,"VerticalSpeed":0}]},{"Position":{"X":-47,"Y":32},"Size":{"X":16,"Y":16},"SpecialMarkType":0,"DelayTime":0,"MarkList":[{"Id":"weapon0006","Weight":100,"Attr":{"CurrAmmon":"20","ResidueAmmo":"300"},"Altitude":8,"VerticalSpeed":0}]},{"Position":{"X":2,"Y":-25},"Size":{"X":16,"Y":16},"SpecialMarkType":0,"DelayTime":0,"MarkList":[{"Id":"weapon0007","Weight":100,"Attr":{"CurrAmmon":"60","ResidueAmmo":"300"},"Altitude":8,"VerticalSpeed":0}]}],[{"Position":{"X":57,"Y":56},"Size":{"X":16,"Y":16},"SpecialMarkType":0,"DelayTime":0,"MarkList":[{"Id":"prop0003","Weight":100,"Attr":null,"Altitude":8,"VerticalSpeed":0}]},{"Position":{"X":67,"Y":28},"Size":{"X":16,"Y":16},"SpecialMarkType":0,"DelayTime":0.5,"MarkList":[{"Id":"prop5000","Weight":100,"Attr":null,"Altitude":8,"VerticalSpeed":0}]},{"Position":{"X":60,"Y":-19},"Size":{"X":16,"Y":16},"SpecialMarkType":0,"DelayTime":1,"MarkList":[{"Id":"prop5001","Weight":100,"Attr":null,"Altitude":8,"VerticalSpeed":0}]},{"Position":{"X":34,"Y":23},"Size":{"X":16,"Y":16},"SpecialMarkType":0,"DelayTime":1.5,"MarkList":[{"Id":"prop0002","Weight":100,"Attr":null,"Altitude":8,"VerticalSpeed":0}]}]]}] \ No newline at end of file diff --git a/DungeonShooting_Godot/scene/World.tscn b/DungeonShooting_Godot/scene/World.tscn index 69e07d3..76eca4e 100644 --- a/DungeonShooting_Godot/scene/World.tscn +++ b/DungeonShooting_Godot/scene/World.tscn @@ -10,7 +10,6 @@ glow_blend_mode = 1 [node name="World" type="CanvasModulate" node_paths=PackedStringArray("NormalLayer", "YSortLayer", "TileRoot", "StaticSpriteRoot", "AffiliationAreaRoot", "FogMaskRoot")] -color = Color(0, 0, 0, 1) script = ExtResource("1_kt3mm") NormalLayer = NodePath("NormalLayer") YSortLayer = NodePath("YSortLayer") @@ -33,6 +32,7 @@ layer_1/y_sort_enabled = false layer_1/y_sort_origin = 0 layer_1/z_index = 0 +layer_1/navigation_enabled = true layer_1/tile_data = PackedInt32Array() layer_2/name = "Top" layer_2/enabled = true @@ -40,6 +40,7 @@ layer_2/y_sort_enabled = false layer_2/y_sort_origin = 0 layer_2/z_index = 10 +layer_2/navigation_enabled = true layer_2/tile_data = PackedInt32Array() layer_3/name = "AisleFloor" layer_3/enabled = true @@ -47,6 +48,7 @@ layer_3/y_sort_enabled = false layer_3/y_sort_origin = 0 layer_3/z_index = -10 +layer_3/navigation_enabled = true layer_3/tile_data = PackedInt32Array() [node name="StaticSpriteRoot" type="Node2D" parent="."] diff --git a/DungeonShooting_Godot/src/framework/activity/ActivityObject.cs b/DungeonShooting_Godot/src/framework/activity/ActivityObject.cs index 03cead3..966f5da 100644 --- a/DungeonShooting_Godot/src/framework/activity/ActivityObject.cs +++ b/DungeonShooting_Godot/src/framework/activity/ActivityObject.cs @@ -1051,10 +1051,7 @@ } //协程更新 - if (_coroutineList != null) - { - ProxyCoroutineHandler.ProxyUpdateCoroutine(ref _coroutineList, newDelta); - } + ProxyCoroutineHandler.ProxyUpdateCoroutine(ref _coroutineList, newDelta); ProcessOver(newDelta); diff --git a/DungeonShooting_Godot/src/framework/coroutine/ProxyCoroutineHandler.cs b/DungeonShooting_Godot/src/framework/coroutine/ProxyCoroutineHandler.cs index 8db3fd8..18371c0 100644 --- a/DungeonShooting_Godot/src/framework/coroutine/ProxyCoroutineHandler.cs +++ b/DungeonShooting_Godot/src/framework/coroutine/ProxyCoroutineHandler.cs @@ -15,7 +15,7 @@ /// public static void ProxyUpdateCoroutine(ref List coroutineList, float delta) { - if (coroutineList.Count == 0) + if (coroutineList == null || coroutineList.Count == 0) { return; } diff --git a/DungeonShooting_Godot/src/framework/ui/UiBase.cs b/DungeonShooting_Godot/src/framework/ui/UiBase.cs index 28ee1fd..17e6d7e 100644 --- a/DungeonShooting_Godot/src/framework/ui/UiBase.cs +++ b/DungeonShooting_Godot/src/framework/ui/UiBase.cs @@ -210,10 +210,7 @@ Process(newDelta); //协程更新 - if (_coroutineList != null) - { - ProxyCoroutineHandler.ProxyUpdateCoroutine(ref _coroutineList, newDelta); - } + ProxyCoroutineHandler.ProxyUpdateCoroutine(ref _coroutineList, newDelta); } /// diff --git a/DungeonShooting_Godot/src/game/GameApplication.cs b/DungeonShooting_Godot/src/game/GameApplication.cs index 9e4266c..edefa31 100644 --- a/DungeonShooting_Godot/src/game/GameApplication.cs +++ b/DungeonShooting_Godot/src/game/GameApplication.cs @@ -145,10 +145,7 @@ SoundManager.Update(newDelta); //协程更新 - if (_coroutineList != null) - { - ProxyCoroutineHandler.ProxyUpdateCoroutine(ref _coroutineList, newDelta); - } + ProxyCoroutineHandler.ProxyUpdateCoroutine(ref _coroutineList, newDelta); } /// diff --git a/DungeonShooting_Godot/src/game/activity/bullet/Bullet.cs b/DungeonShooting_Godot/src/game/activity/bullet/Bullet.cs index 0cf2a33..c1c8fc1 100644 --- a/DungeonShooting_Godot/src/game/activity/bullet/Bullet.cs +++ b/DungeonShooting_Godot/src/game/activity/bullet/Bullet.cs @@ -5,7 +5,7 @@ /// 子弹类 /// [Tool] -public partial class Bullet : ActivityObject +public partial class Bullet : ActivityObject, IBullet { /// /// 碰撞区域 @@ -26,11 +26,6 @@ /// 发射该子弹的武器 /// public Weapon Weapon { get; private set; } - - /// - /// 发射该子弹的角色 - /// - public Role Role { get; private set; } /// /// 最小伤害 @@ -43,9 +38,9 @@ public int MaxHarm { get; set; } = 4; /// - /// 发射该子弹的角色是否是Ai + /// 发射该子弹的角色 /// - public bool TriggerRoleIsAi { get; set; } + public Role TriggerRole { get; private set; } // 最大飞行距离 private float MaxDistance; @@ -56,25 +51,28 @@ //当前子弹已经飞行的距离 private float CurrFlyDistance = 0; + public void Init(Weapon weapon, uint targetLayer) + { + TriggerRole = weapon.TriggerRole; + Weapon = weapon; + AttackLayer = targetLayer; + } + /// /// 初始化子弹属性 /// - /// 触发开火的角色 /// 射出该子弹的武器 /// 速度 /// 最大飞行距离 /// 位置 /// 角度 /// 攻击目标层级 - public void Init(bool triggerIsAi, Weapon weapon, float speed, float maxDistance, Vector2 position, float rotation, uint targetLayer) + public void Init(Weapon weapon, float speed, float maxDistance, Vector2 position, float rotation, uint targetLayer) { - TriggerRoleIsAi = triggerIsAi; - Weapon = weapon; - Role = weapon.Master; - AttackLayer = targetLayer; + Init(weapon, targetLayer); CollisionArea.AreaEntered += OnArea2dEntered; - if (!triggerIsAi) //只有玩家使用该武器才能获得正常速度的子弹 + if (TriggerRole == null || !TriggerRole.IsAi) //只有玩家使用该武器才能获得正常速度的子弹 { FlySpeed = speed; } @@ -155,15 +153,15 @@ //计算子弹造成的伤害 var damage = Utils.Random.RandomRangeInt(MinHarm, MaxHarm); - if (Role != null) + if (TriggerRole != null) { - damage = Role.RoleState.CallCalcDamageEvent(damage); + damage = TriggerRole.RoleState.CallCalcDamageEvent(damage); } //击退 if (role is not Player) //目标不是玩家才会触发击退 { - var attr = TriggerRoleIsAi ? Weapon.AiUseAttribute : Weapon.PlayerUseAttribute; + var attr = Weapon.GetUseAttribute(TriggerRole); var repel = Utils.Random.RandomConfigRange(attr.RepelRnage); role.MoveController.AddForce(Vector2.FromAngle(BasisVelocity.Angle()) * repel, repel * 2); } diff --git a/DungeonShooting_Godot/src/game/activity/bullet/IBullet.cs b/DungeonShooting_Godot/src/game/activity/bullet/IBullet.cs new file mode 100644 index 0000000..9c74bcc --- /dev/null +++ b/DungeonShooting_Godot/src/game/activity/bullet/IBullet.cs @@ -0,0 +1,25 @@ + +public interface IBullet : IDestroy, ICoroutine +{ + /// + /// 攻击的层级 + /// + uint AttackLayer { get; set; } + + /// + /// 发射该子弹的武器 + /// + Weapon Weapon { get; } + + /// + /// 发射该子弹的角色 + /// + Role TriggerRole { get; } + + /// + /// 初始化子弹数据 + /// + /// 发射该子弹的武器 + /// 攻击的层级 + void Init(Weapon weapon, uint attackLayer); +} \ No newline at end of file diff --git a/DungeonShooting_Godot/src/game/activity/bullet/laser/Laser.cs b/DungeonShooting_Godot/src/game/activity/bullet/laser/Laser.cs new file mode 100644 index 0000000..23252d5 --- /dev/null +++ b/DungeonShooting_Godot/src/game/activity/bullet/laser/Laser.cs @@ -0,0 +1,107 @@ +using System.Collections; +using System.Collections.Generic; +using Godot; + +/// +/// 激光子弹 +/// +public partial class Laser : Area2D, IBullet +{ + public CollisionShape2D Collision { get; private set; } + public Line2D Line { get; private set; } + public RectangleShape2D Shape { get; private set; } + + public uint AttackLayer { get; set; } + public Weapon Weapon { get; private set; } + public Role TriggerRole { get; private set; } + + public bool IsDestroyed { get; private set; } + //开启的协程 + private List _coroutineList; + + public override void _Ready() + { + Collision = GetNodeOrNull("CollisionShape2D"); + Shape = Collision.Shape as RectangleShape2D; + Line = GetNodeOrNull("Line2D"); + } + + public void Init(Weapon weapon, uint targetLayer) + { + TriggerRole = weapon.TriggerRole; + Weapon = weapon; + AttackLayer = targetLayer; + } + + public void Init(Weapon weapon, uint targetLayer, Vector2 position, float rotation, float width, float distance) + { + Init(weapon, targetLayer); + Position = position; + Rotation = rotation; + + //计算射线最大距离, 也就是撞到墙壁的距离 + var targetPosition = position + Vector2.FromAngle(rotation) * distance; + var parameters = PhysicsRayQueryParameters2D.Create(position, targetPosition, PhysicsLayer.Wall); + var result = GetWorld2D().DirectSpaceState.IntersectRay(parameters); + if (result != null) + { + var point = (Vector2)result["position"]; + distance = position.DistanceTo(point); + } + + Collision.Position = new Vector2(distance * 0.5f, 0); + Shape.Size = new Vector2(distance, width); + + + var tween = CreateTween(); + tween.SetParallel(); + tween.TweenProperty(Line, "width", width, 0.3); + tween.TweenMethod(Callable.From((float v) => + { + Line.SetPointPosition(1, new Vector2(v, 0)); + }), 0, distance, 0.1); + tween.Chain(); + tween.TweenInterval(1.5); + tween.Chain(); + tween.TweenCallback(Callable.From(() => + { + Destroy(); + })); + tween.Play(); + } + + public override void _Process(double delta) + { + ProxyCoroutineHandler.ProxyUpdateCoroutine(ref _coroutineList, (float)delta); + } + + public void Destroy() + { + if (IsDestroyed) + { + return; + } + + QueueFree(); + } + + public long StartCoroutine(IEnumerator able) + { + return ProxyCoroutineHandler.ProxyStartCoroutine(ref _coroutineList, able); + } + + public void StopCoroutine(long coroutineId) + { + ProxyCoroutineHandler.ProxyStopCoroutine(ref _coroutineList, coroutineId); + } + + public bool IsCoroutineOver(long coroutineId) + { + return ProxyCoroutineHandler.ProxyIsCoroutineOver(ref _coroutineList, coroutineId); + } + + public void StopAllCoroutine() + { + ProxyCoroutineHandler.ProxyStopAllCoroutine(ref _coroutineList); + } +} diff --git a/DungeonShooting_Godot/src/game/activity/weapon/Weapon.cs b/DungeonShooting_Godot/src/game/activity/weapon/Weapon.cs index 3bead8a..af6cb96 100644 --- a/DungeonShooting_Godot/src/game/activity/weapon/Weapon.cs +++ b/DungeonShooting_Godot/src/game/activity/weapon/Weapon.cs @@ -146,9 +146,9 @@ public bool NoMasterCanTrigger { get; set; } = true; /// - /// 上一次触发改武器开火的角色是否是Ai + /// 上一次触发改武器开火的角色 /// - public bool TriggerRoleIsAi { get; private set; } + public Role TriggerRole { get; private set; } /// /// 上一次触发改武器开火的触发开火攻击的层级, 数据源自于: @@ -700,15 +700,15 @@ _triggerRoleFlag = true; if (triggerRole != null) { - TriggerRoleIsAi = triggerRole.IsAi; + TriggerRole = triggerRole; TriggerRoleAttackLayer = triggerRole.AttackLayer; - _weaponAttribute = TriggerRoleIsAi ? _aiWeaponAttribute : _playerWeaponAttribute; + _weaponAttribute = triggerRole.IsAi ? _aiWeaponAttribute : _playerWeaponAttribute; } else if (Master != null) { - TriggerRoleIsAi = Master.IsAi; + TriggerRole = Master; TriggerRoleAttackLayer = Master.AttackLayer; - _weaponAttribute = TriggerRoleIsAi ? _aiWeaponAttribute : _playerWeaponAttribute; + _weaponAttribute = Master.IsAi ? _aiWeaponAttribute : _playerWeaponAttribute; } //是否第一帧按下 @@ -1072,6 +1072,19 @@ // { // // } + + /// + /// 根据触扳机的角色对象判断该角色使用的武器数据 + /// + public ExcelConfig.Weapon GetUseAttribute(Role triggerRole) + { + if (triggerRole == null || !triggerRole.IsAi) + { + return PlayerUseAttribute; + } + + return AiUseAttribute; + } /// /// 获取武器攻击的目标层级 @@ -1919,7 +1932,6 @@ //创建子弹 var bullet = Create(bulletId); bullet.Init( - TriggerRoleIsAi, this, speed, distance, diff --git a/DungeonShooting_Godot/src/game/activity/weapon/gun/Gun.cs b/DungeonShooting_Godot/src/game/activity/weapon/gun/Gun.cs index f74575e..204e213 100644 --- a/DungeonShooting_Godot/src/game/activity/weapon/gun/Gun.cs +++ b/DungeonShooting_Godot/src/game/activity/weapon/gun/Gun.cs @@ -26,7 +26,10 @@ protected override void OnShoot(float fireRotation) { - ShootBullet(fireRotation, Attribute.BulletId); + //ShootBullet(fireRotation, Attribute.BulletId); + var laser = ResourceManager.LoadAndInstantiate(ResourcePath.prefab_bullet_laser_Laser0001_tscn); + laser.AddToActivityRoot(RoomLayerEnum.YSortLayer); + laser.Init(this, GetAttackLayer(), FirePoint.GlobalPosition, fireRotation, 3, 600); } // //测试用, 敌人被消灭时触发手上武器开火 diff --git a/DungeonShooting_Godot/src/game/manager/ResourcePath.cs b/DungeonShooting_Godot/src/game/manager/ResourcePath.cs index 40f2ec7..8c77fcb 100644 --- a/DungeonShooting_Godot/src/game/manager/ResourcePath.cs +++ b/DungeonShooting_Godot/src/game/manager/ResourcePath.cs @@ -12,6 +12,7 @@ public const string prefab_bullet_Bullet0001_tscn = "res://prefab/bullet/Bullet0001.tscn"; public const string prefab_bullet_Bullet0002_tscn = "res://prefab/bullet/Bullet0002.tscn"; public const string prefab_bullet_Bullet0003_tscn = "res://prefab/bullet/Bullet0003.tscn"; + public const string prefab_bullet_laser_Laser0001_tscn = "res://prefab/bullet/laser/Laser0001.tscn"; public const string prefab_effect_Blood_tscn = "res://prefab/effect/Blood.tscn"; public const string prefab_effect_common_Effect1_tscn = "res://prefab/effect/common/Effect1.tscn"; public const string prefab_effect_enemy_Effect0001_tscn = "res://prefab/effect/enemy/Effect0001.tscn"; @@ -77,6 +78,7 @@ public const string prefab_weapon_Weapon0007_tscn = "res://prefab/weapon/Weapon0007.tscn"; public const string prefab_weapon_WeaponTemplate_tscn = "res://prefab/weapon/WeaponTemplate.tscn"; public const string resource_config_ActivityObject_json = "res://resource/config/ActivityObject.json"; + public const string resource_config_AiAttackAttr_json = "res://resource/config/AiAttackAttr.json"; public const string resource_config_Sound_json = "res://resource/config/Sound.json"; public const string resource_config_Weapon_json = "res://resource/config/Weapon.json"; public const string resource_curve_Curve1_tres = "res://resource/curve/Curve1.tres"; diff --git a/DungeonShooting_Godot/src/game/room/World.cs b/DungeonShooting_Godot/src/game/room/World.cs index 00ca2eb..35af42b 100644 --- a/DungeonShooting_Godot/src/game/room/World.cs +++ b/DungeonShooting_Godot/src/game/room/World.cs @@ -84,6 +84,8 @@ public override void _Ready() { + Color = Colors.Black; + //临时处理, 加载TileSet var tileSet = ResourceManager.Load(ResourcePath.resource_map_tileSet_map1_TileSet1_tres); var tileSetAtlasSource = (TileSetAtlasSource)tileSet.GetSource(0); @@ -95,10 +97,7 @@ public override void _Process(double delta) { //协程更新 - if (_coroutineList != null) - { - ProxyCoroutineHandler.ProxyUpdateCoroutine(ref _coroutineList, (float)delta); - } + ProxyCoroutineHandler.ProxyUpdateCoroutine(ref _coroutineList, (float)delta); } ///