Browse Source

瞄准线

master
jiannan.guo@yingxiong.com 1 month ago
parent
commit
03ca576062
  1. 118
      client/client/Assets/RawResources/Model/ArmLiner.prefab
  2. 7
      client/client/Assets/RawResources/Model/ArmLiner.prefab.meta
  3. 1
      client/client/Assets/Scripts/CoreGame/AFramSync/Render/BattleRenderWorld.cs
  4. 7
      client/client/Assets/Scripts/CoreGame/AFramSync/Render/Component/Proxy/ShootDirComponent.cs
  5. 6
      client/client/Assets/Scripts/CoreGame/AFramSync/Render/EntitasGen/Components/RenderShootDirComponent.cs
  6. 2
      client/client/Assets/Scripts/CoreGame/AFramSync/Render/Service/REntityCreatorSvc.cs
  7. 3
      client/client/Assets/Scripts/CoreGame/AFramSync/Render/System/Ball.meta
  8. 51
      client/client/Assets/Scripts/CoreGame/AFramSync/Render/System/Ball/ArmSystem.cs
  9. 3
      client/client/Assets/Scripts/CoreGame/AFramSync/Render/System/Ball/ArmSystem.cs.meta
  10. 3
      client/client/Assets/Scripts/CoreGame/AFramSync/Render/View/DirCtrlInput.cs

118
client/client/Assets/RawResources/Model/ArmLiner.prefab

@ -0,0 +1,118 @@
%YAML 1.1
%TAG !u! tag:unity3d.com,2011:
--- !u!1 &6396829578575678466
GameObject:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
serializedVersion: 6
m_Component:
- component: {fileID: 681415745504950151}
- component: {fileID: 8598721907453598192}
m_Layer: 0
m_Name: 9-Sliced
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!4 &681415745504950151
Transform:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 6396829578575678466}
serializedVersion: 2
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
m_LocalPosition: {x: 66, y: 0, z: 0}
m_LocalScale: {x: 30, y: 0.06, z: 1}
m_ConstrainProportionsScale: 0
m_Children: []
m_Father: {fileID: 2920542907525857825}
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
--- !u!212 &8598721907453598192
SpriteRenderer:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 6396829578575678466}
m_Enabled: 1
m_CastShadows: 0
m_ReceiveShadows: 0
m_DynamicOccludee: 1
m_StaticShadowCaster: 0
m_MotionVectors: 1
m_LightProbeUsage: 1
m_ReflectionProbeUsage: 1
m_RayTracingMode: 0
m_RayTraceProcedural: 0
m_RenderingLayerMask: 1
m_RendererPriority: 0
m_Materials:
- {fileID: 10754, guid: 0000000000000000f000000000000000, type: 0}
m_StaticBatchInfo:
firstSubMesh: 0
subMeshCount: 0
m_StaticBatchRoot: {fileID: 0}
m_ProbeAnchor: {fileID: 0}
m_LightProbeVolumeOverride: {fileID: 0}
m_ScaleInLightmap: 1
m_ReceiveGI: 1
m_PreserveUVs: 0
m_IgnoreNormalsForChartDetection: 0
m_ImportantGI: 0
m_StitchLightmapSeams: 1
m_SelectedEditorRenderState: 0
m_MinimumChartSize: 4
m_AutoUVMaxDistance: 0.5
m_AutoUVMaxAngle: 89
m_LightmapParameters: {fileID: 0}
m_SortingLayerID: 0
m_SortingLayer: 0
m_SortingOrder: 3000
m_Sprite: {fileID: 21300000, guid: 27c2f96085de0b54793a4a2082ae2994, type: 3}
m_Color: {r: 1, g: 1, b: 1, a: 1}
m_FlipX: 0
m_FlipY: 0
m_DrawMode: 0
m_Size: {x: 0.3, y: 0.3}
m_AdaptiveModeThreshold: 0.5
m_SpriteTileMode: 0
m_WasSpriteAssigned: 1
m_MaskInteraction: 0
m_SpriteSortPoint: 0
--- !u!1 &9064618260693730221
GameObject:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
serializedVersion: 6
m_Component:
- component: {fileID: 2920542907525857825}
m_Layer: 0
m_Name: ArmLiner
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!4 &2920542907525857825
Transform:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 9064618260693730221}
serializedVersion: 2
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
m_LocalPosition: {x: 0, y: 0, z: 0}
m_LocalScale: {x: 1, y: 1, z: 1}
m_ConstrainProportionsScale: 0
m_Children:
- {fileID: 681415745504950151}
m_Father: {fileID: 0}
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}

7
client/client/Assets/RawResources/Model/ArmLiner.prefab.meta

@ -0,0 +1,7 @@
fileFormatVersion: 2
guid: a70803333a694d54186efe1b973ee9eb
PrefabImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:

1
client/client/Assets/Scripts/CoreGame/AFramSync/Render/BattleRenderWorld.cs

@ -141,6 +141,7 @@ namespace CoreGame.Render
m_RenderFeature.Add(new AssetAddSystem(m_RenderContext));
m_RenderFeature.Add(new RenderMoveSystem());
m_RenderFeature.Add(new BallMotionSystem());
m_RenderFeature.Add(new ArmSystem(m_RenderContext));
m_RenderFeature.Add(new AnimancerTickSys());
m_RenderFeature.Add(new CameraFeature(injector));
m_RenderFeature.Initialize();

7
client/client/Assets/Scripts/CoreGame/AFramSync/Render/Component/Proxy/ShootDirComponent.cs

@ -1,4 +1,6 @@
using Entitas;
using AOT;
using Entitas;
using UnityEngine;
namespace CoreGame.Render
{
@ -6,5 +8,8 @@ namespace CoreGame.Render
public class ShootDirComponent : IComponent
{
public float value;
public FName armPath;
[Inner]
public ReuseGoData arm;
}
}

6
client/client/Assets/Scripts/CoreGame/AFramSync/Render/EntitasGen/Components/RenderShootDirComponent.cs

@ -11,17 +11,19 @@ public partial class RenderEntity {
public CoreGame.Render.ShootDirComponent shootDir { get { return (CoreGame.Render.ShootDirComponent)GetComponent(RenderComponentsLookup.ShootDir); } }
public bool hasShootDir { get { return HasComponent(RenderComponentsLookup.ShootDir); } }
public void AddShootDir(float newValue) {
public void AddShootDir(float newValue, AOT.FName newArmPath) {
var index = RenderComponentsLookup.ShootDir;
var component = (CoreGame.Render.ShootDirComponent)CreateComponent(index, typeof(CoreGame.Render.ShootDirComponent));
component.value = newValue;
component.armPath = newArmPath;
AddComponent(index, component);
}
public void ReplaceShootDir(float newValue) {
public void ReplaceShootDir(float newValue, AOT.FName newArmPath) {
var index = RenderComponentsLookup.ShootDir;
var component = (CoreGame.Render.ShootDirComponent)CreateComponent(index, typeof(CoreGame.Render.ShootDirComponent));
component.value = newValue;
component.armPath = newArmPath;
ReplaceComponent(index, component);
}

2
client/client/Assets/Scripts/CoreGame/AFramSync/Render/Service/REntityCreatorSvc.cs

@ -29,7 +29,7 @@ namespace CoreGame.Render
scaleParam = 1,
}, null);
combatEntity.AddShootDir(90);
combatEntity.ReplaceShootDir(90, (FName)"Assets/RawResources/Model/ArmLiner.prefab");
s_RenderContext.SetInputEnt(combatEntity);
return combatEntity;
}

3
client/client/Assets/Scripts/CoreGame/AFramSync/Render/System/Ball.meta

@ -0,0 +1,3 @@
fileFormatVersion: 2
guid: 829019828400459ba763b4720ddfb7c5
timeCreated: 1753452626

51
client/client/Assets/Scripts/CoreGame/AFramSync/Render/System/Ball/ArmSystem.cs

@ -0,0 +1,51 @@
using System.Collections.Generic;
using Entitas;
using UnityEngine;
using NotImplementedException = System.NotImplementedException;
namespace CoreGame.Render
{
public class ArmSystem : IExecuteSystem
{
private readonly RenderContext m_Context;
public ArmSystem(RenderContext contexts)
{
m_Context = contexts;
}
public void Execute(float deltaTime)
{
var playerEntHandle = m_Context.LocalPlayerEntHandle;
if (playerEntHandle.value == null)
return;
var inputEntHandle = m_Context.InputEntHandle;
if (inputEntHandle.value == null)
return;
var shoot = inputEntHandle.value.shootDir;
if (shoot.arm == null)
{
shoot.arm = GoPoolDic.GetPool(shoot.armPath).GetNewGo(MainAssetCallBack, inputEntHandle.value.creationIndex);
return;
}
if (shoot.arm.go == null)
return;
var localPos = playerEntHandle.value.transformProxy;
shoot.arm.go.transform.position = localPos.GetRenderPosition();
shoot.arm.go.transform.eulerAngles = new(0, 0, shoot.value);
}
private static void MainAssetCallBack(ReuseGoData reuseGoData)
{
if (reuseGoData.go == null)
{
RLog.LogInfo($"go is null, asset path: {reuseGoData.path}");
return;
}
}
}
}

3
client/client/Assets/Scripts/CoreGame/AFramSync/Render/System/Ball/ArmSystem.cs.meta

@ -0,0 +1,3 @@
fileFormatVersion: 2
guid: b6b4f6423a0d46e9ac67c3981fd84aa2
timeCreated: 1753452636

3
client/client/Assets/Scripts/CoreGame/AFramSync/Render/View/DirCtrlInput.cs

@ -23,7 +23,8 @@ namespace CoreGame.Render
if (localPlayer)
{
var f = 10 + (value) * 160;
if (instance.InputEntHandle)
instance.InputEntHandle.value.shootDir.value = f;
var moveDirectionCommand = RenderCommandSvc.CreateFrameCommand<ChangeShootDirCmd>();
moveDirectionCommand.Degree = (short)f;
moveDirectionCommand.SendAndFree(localPlayer);

Loading…
Cancel
Save