浏览代码

update projectile

/hh-develop-fps_game_project
HH 4 年前
当前提交
1065a4e5
共有 6 个文件被更改,包括 149 次插入97 次删除
  1. 143
      Project/Assets/ML-Agents/Examples/FPS_Game/Prefabs/Projectile.prefab
  2. 93
      Project/Assets/ML-Agents/Examples/FPS_Game/Scenes/FPS_Game.unity
  3. 3
      Project/Assets/ML-Agents/Examples/FPS_Game/Scripts/Projectile.cs
  4. 3
      Project/Assets/ML-Agents/Examples/FPS_Game/Scripts/ShootProjectiles.cs
  5. 2
      Project/ProjectSettings/DynamicsManager.asset
  6. 2
      Project/ProjectSettings/TagManager.asset

143
Project/Assets/ML-Agents/Examples/FPS_Game/Prefabs/Projectile.prefab


%YAML 1.1
%TAG !u! tag:unity3d.com,2011:
--- !u!1 &1465564013992665965
GameObject:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
serializedVersion: 6
m_Component:
- component: {fileID: 4411856594039931044}
- component: {fileID: 6779490827046006232}
- component: {fileID: 418425099599415636}
- component: {fileID: 3525145920380393505}
m_Layer: 10
m_Name: Cylinder
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 0
--- !u!4 &4411856594039931044
Transform:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 1465564013992665965}
m_LocalRotation: {x: 0.7071068, y: 0, z: 0, w: 0.7071068}
m_LocalPosition: {x: 0, y: 0, z: 0}
m_LocalScale: {x: 0.51999, y: 0.51999, z: 0.51999}
m_Children: []
m_Father: {fileID: 3911029810215854904}
m_RootOrder: 1
m_LocalEulerAnglesHint: {x: 90, y: 0, z: 0}
--- !u!33 &6779490827046006232
MeshFilter:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 1465564013992665965}
m_Mesh: {fileID: 10206, guid: 0000000000000000e000000000000000, type: 0}
--- !u!23 &418425099599415636
MeshRenderer:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 1465564013992665965}
m_Enabled: 1
m_CastShadows: 1
m_ReceiveShadows: 1
m_DynamicOccludee: 1
m_MotionVectors: 1
m_LightProbeUsage: 1
m_ReflectionProbeUsage: 1
m_RenderingLayerMask: 1
m_RendererPriority: 0
m_Materials:
- {fileID: 2100000, guid: cb2aa8892bed247b58476624d7896b0f, type: 2}
m_StaticBatchInfo:
firstSubMesh: 0
subMeshCount: 0
m_StaticBatchRoot: {fileID: 0}
m_ProbeAnchor: {fileID: 0}
m_LightProbeVolumeOverride: {fileID: 0}
m_ScaleInLightmap: 1
m_PreserveUVs: 0
m_IgnoreNormalsForChartDetection: 0
m_ImportantGI: 0
m_StitchLightmapSeams: 0
m_SelectedEditorRenderState: 3
m_MinimumChartSize: 4
m_AutoUVMaxDistance: 0.5
m_AutoUVMaxAngle: 89
m_LightmapParameters: {fileID: 0}
m_SortingLayerID: 0
m_SortingLayer: 0
m_SortingOrder: 0
--- !u!136 &3525145920380393505
CapsuleCollider:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 1465564013992665965}
m_Material: {fileID: 0}
m_IsTrigger: 0
m_Enabled: 1
m_Radius: 0.5000001
m_Height: 2
m_Direction: 1
m_Center: {x: 0.000000059604645, y: 0, z: -0.00000008940697}
--- !u!1 &3911029810215854908
GameObject:
m_ObjectHideFlags: 0

- component: {fileID: 3911029810215854904}
- component: {fileID: 3911029810215854911}
- component: {fileID: 3911029810215854910}
- component: {fileID: 3911029810215854909}
m_Layer: 0
- component: {fileID: 7844766926972049869}
m_Layer: 10
m_Name: Projectile
m_TagString: Untagged
m_Icon: {fileID: 0}

m_GameObject: {fileID: 3911029810215854908}
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
m_LocalPosition: {x: 0, y: 2.8, z: 0}
m_LocalScale: {x: 0.4, y: 0.4, z: 0.4}
m_LocalScale: {x: 0.255744, y: 0.255744, z: 0.255744}
- {fileID: 4411856594039931044}
m_Father: {fileID: 0}
m_RootOrder: 0
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}

m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 3911029810215854908}
m_Mesh: {fileID: 10202, guid: 0000000000000000e000000000000000, type: 0}
m_Mesh: {fileID: 10207, guid: 0000000000000000e000000000000000, type: 0}
--- !u!23 &3911029810215854910
MeshRenderer:
m_ObjectHideFlags: 0

m_GameObject: {fileID: 3911029810215854908}
m_Enabled: 0
m_Enabled: 1
m_CastShadows: 1
m_ReceiveShadows: 1
m_DynamicOccludee: 1

m_SortingLayerID: 0
m_SortingLayer: 0
m_SortingOrder: 0
--- !u!65 &3911029810215854909
BoxCollider:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 3911029810215854908}
m_Material: {fileID: 0}
m_IsTrigger: 0
m_Enabled: 1
serializedVersion: 2
m_Size: {x: 1, y: 1, z: 1}
m_Center: {x: 0, y: 0, z: 0}
--- !u!114 &648473049
MonoBehaviour:
m_ObjectHideFlags: 0

m_Script: {fileID: 11500000, guid: 760a84ae2ce8446b28d91ff804e233cf, type: 3}
m_Name:
m_EditorClassIdentifier:
aliveTime: 0
rb: {fileID: 0}
selfDestructNow: 0
aliveTime: 0.02
rb: {fileID: 4341296992446652170}
selfDestructNow: 1
maxTimeToLive: 3
pauseCollisionDetectionWaitTime: 0.05
projectileController: {fileID: 0}

m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 3911029810215854908}
serializedVersion: 2
m_Mass: 2
m_Mass: 1
m_UseGravity: 0
m_UseGravity: 1
--- !u!135 &7844766926972049869
SphereCollider:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 3911029810215854908}
m_Material: {fileID: 0}
m_IsTrigger: 0
m_Enabled: 1
serializedVersion: 2
m_Radius: 0.5
m_Center: {x: 0, y: 0, z: 0}
--- !u!1 &6461313653667732308
GameObject:
m_ObjectHideFlags: 0

- component: {fileID: 6333385540820070532}
- component: {fileID: 4569169311316799599}
- component: {fileID: 4977931146242317046}
m_Layer: 0
m_Layer: 10
m_IsActive: 1
m_IsActive: 0
--- !u!4 &3111360190714995606
Transform:
m_ObjectHideFlags: 0

93
Project/Assets/ML-Agents/Examples/FPS_Game/Scenes/FPS_Game.unity


- component: {fileID: 637814285}
- component: {fileID: 637814288}
- component: {fileID: 637814287}
- component: {fileID: 637814286}
m_Layer: 0
m_Layer: 10
m_Name: Cylinder
m_TagString: Untagged
m_Icon: {fileID: 0}

m_Father: {fileID: 1739836887}
m_RootOrder: 1
m_LocalEulerAnglesHint: {x: 90, y: 0, z: 0}
--- !u!136 &637814286
CapsuleCollider:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 637814284}
m_Material: {fileID: 0}
m_IsTrigger: 0
m_Enabled: 0
m_Radius: 0.5000001
m_Height: 2
m_Direction: 1
m_Center: {x: 0.000000059604645, y: 0, z: -0.00000008940697}
--- !u!23 &637814287
MeshRenderer:
m_ObjectHideFlags: 0

- component: {fileID: 1061103511}
- component: {fileID: 1061103514}
- component: {fileID: 1061103513}
- component: {fileID: 1061103512}
m_Layer: 0
m_Layer: 10
m_Name: Cube
m_TagString: Untagged
m_Icon: {fileID: 0}

m_Father: {fileID: 5337721584560684410}
m_RootOrder: 0
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
--- !u!65 &1061103512
BoxCollider:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 1061103510}
m_Material: {fileID: 0}
m_IsTrigger: 0
m_Enabled: 0
serializedVersion: 2
m_Size: {x: 1, y: 1, z: 1}
m_Center: {x: 0, y: 0, z: 0}
--- !u!23 &1061103513
MeshRenderer:
m_ObjectHideFlags: 0

serializedVersion: 6
m_Component:
- component: {fileID: 1133994729}
m_Layer: 0
m_Layer: 10
m_Name: SpawnPos
m_TagString: Untagged
m_Icon: {fileID: 0}

m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 1133994728}
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
m_LocalPosition: {x: 0, y: 0, z: 0.592}
m_LocalPosition: {x: 0, y: 0, z: 0.858}
m_LocalScale: {x: 1, y: 1, z: 1}
m_Children: []
m_Father: {fileID: 1739836887}

- component: {fileID: 1251493842}
- component: {fileID: 1251493845}
- component: {fileID: 1251493844}
- component: {fileID: 1251493843}
m_Layer: 0
m_Layer: 10
m_Name: Cube
m_TagString: Untagged
m_Icon: {fileID: 0}

m_Father: {fileID: 1739836887}
m_RootOrder: 0
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
--- !u!65 &1251493843
BoxCollider:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 1251493841}
m_Material: {fileID: 0}
m_IsTrigger: 0
m_Enabled: 0
serializedVersion: 2
m_Size: {x: 1, y: 1, z: 1}
m_Center: {x: 0, y: 0, z: 0}
--- !u!23 &1251493844
MeshRenderer:
m_ObjectHideFlags: 0

- component: {fileID: 1541496575}
- component: {fileID: 1541496578}
- component: {fileID: 1541496577}
- component: {fileID: 1541496576}
m_Layer: 0
m_Layer: 10
m_Name: Cylinder
m_TagString: Untagged
m_Icon: {fileID: 0}

m_Father: {fileID: 5337721584560684410}
m_RootOrder: 1
m_LocalEulerAnglesHint: {x: 90, y: 0, z: 0}
--- !u!136 &1541496576
CapsuleCollider:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 1541496574}
m_Material: {fileID: 0}
m_IsTrigger: 0
m_Enabled: 0
m_Radius: 0.5000001
m_Height: 2
m_Direction: 1
m_Center: {x: 0.000000059604645, y: 0, z: -0.00000008940697}
--- !u!23 &1541496577
MeshRenderer:
m_ObjectHideFlags: 0

serializedVersion: 6
m_Component:
- component: {fileID: 1614797500}
m_Layer: 0
m_Layer: 10
m_Name: SpawnPos
m_TagString: Untagged
m_Icon: {fileID: 0}

m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 1614797499}
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
m_LocalPosition: {x: 0, y: 0, z: 0.592}
m_LocalPosition: {x: 0, y: 0, z: 0.858}
m_LocalScale: {x: 1, y: 1, z: 1}
m_Children: []
m_Father: {fileID: 5337721584560684410}

m_Component:
- component: {fileID: 1739836887}
- component: {fileID: 1739836888}
m_Layer: 0
m_Layer: 10
m_Name: GUN (1)
m_TagString: Untagged
m_Icon: {fileID: 0}

type: 3}
numberOfProjectilesToPool: 25
projectileStartingPos: {fileID: 1133994729}
projectileLaunchAngle: 1
projectileLaunchAngle: 5
shootingRate: 0.02
coolDownWait: 0
autoShootEnabled: 0

m_Modification:
m_TransformParent: {fileID: 0}
m_Modifications:
- target: {fileID: 5337721584560684409, guid: 0058b366f9d6d44a3ba35beb06b0174b,
type: 3}
propertyPath: m_Layer
value: 10
objectReference: {fileID: 0}
- target: {fileID: 5337721584560684410, guid: 0058b366f9d6d44a3ba35beb06b0174b,
type: 3}
propertyPath: m_LocalPosition.x

propertyPath: projectileStartingPos
value:
objectReference: {fileID: 1614797500}
- target: {fileID: 5337721584560684411, guid: 0058b366f9d6d44a3ba35beb06b0174b,
type: 3}
propertyPath: numberOfProjectilesToPool
value: 25
objectReference: {fileID: 0}
- target: {fileID: 5337721584560684411, guid: 0058b366f9d6d44a3ba35beb06b0174b,
type: 3}
propertyPath: projectileLaunchAngle
value: 5
objectReference: {fileID: 0}
- target: {fileID: 5337721584620702641, guid: 0058b366f9d6d44a3ba35beb06b0174b,
type: 3}
propertyPath: cam

3
Project/Assets/ML-Agents/Examples/FPS_Game/Scripts/Projectile.cs


}
void OnCollisionEnter()
void OnCollisionEnter(Collision col)
print(col.gameObject.name);
}
}

3
Project/Assets/ML-Agents/Examples/FPS_Game/Scripts/ShootProjectiles.cs


public void LaunchProjectile(Rigidbody rb, Vector3 startPos, Vector3 targetPos)
{
rb.transform.position = startPos;
rb.transform.rotation = Quaternion.identity;
// rb.transform.rotation = Quaternion.identity;
rb.transform.rotation = transform.rotation;
rb.velocity = Vector3.zero;
rb.angularVelocity = Vector3.zero;

2
Project/ProjectSettings/DynamicsManager.asset


m_ClothInterCollisionDistance: 0
m_ClothInterCollisionStiffness: 0
m_ContactsGeneration: 1
m_LayerCollisionMatrix: fffdfffffffdfffffffdfffffffffffffffdfffffffdfffffffffffffffffffffffdffffc8e8ffffffddffffffeffffffff5fffffffbffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
m_LayerCollisionMatrix: fffdfffffffdfffffffdfffffffffffffffdfffffffdfffffffffffffffffffffffdffffc8e8ffffffd9ffffffeffffffff5fffffffbffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
m_AutoSimulation: 1
m_AutoSyncTransforms: 1
m_ReuseCollisionCallbacks: 1

2
Project/ProjectSettings/TagManager.asset


-
- invisible
- shield
-
- projectile
-
-
-

正在加载...
取消
保存