浏览代码

-removed all DOTS physics stuff. Tagged the previous commit so we can go back to it later

/demo-work
Mike Geig 5 年前
当前提交
07e4012f
共有 9 个文件被更改,包括 193 次插入1458 次删除
  1. 414
      Assets/Objects/Levels/Island/Environment Objects.prefab
  2. 28
      Assets/Scripts/Boat/Engine.cs
  3. 29
      Assets/Scripts/GameSystem/RaceManager.cs
  4. 162
      Assets/scenes/Island.unity
  5. 2
      Packages/manifest.json
  6. 8
      Assets/Scripts/DOTS.meta
  7. 7
      Assets/scenes/Physics Scene.unity.meta
  8. 1001
      Assets/scenes/Physics Scene.unity

414
Assets/Objects/Levels/Island/Environment Objects.prefab
文件差异内容过多而无法显示
查看文件

28
Assets/Scripts/Boat/Engine.cs


using System.Collections;
using WaterSystem;
using Unity.Mathematics;
using Unity.Entities;
namespace BoatAttack.Boat
{

Gizmos.matrix = transform.localToWorldMatrix;
Gizmos.DrawCube(enginePosition, new Vector3(0.1f, 0.2f, 0.3f)); // Draw teh engine position with sphere
}
//Called by parent BuoyantObject_DOTS
public void Convert(Entity entity, EntityManager dstManager, GameObjectConversionSystem conversionSystem)
{
//Set up driving data
bool isHuman = GetComponent<BoatController>().Human;
if (!isHuman)
AIController_DOTS.Register(entity, transform.position);
var driveData = new DrivingData
{
steeringTorque = steeringTorque,
upwardTorque = upwardTorque,
horsePower = horsePower,
engineOffset = enginePosition
};
dstManager.AddComponentData(entity, driveData);
var inputData = new InputData
{
isHuman = isHuman
};
dstManager.AddComponentData(entity, inputData);
}
}
}

29
Assets/Scripts/GameSystem/RaceManager.cs


public bool reversed;
}
public bool useDOTS;
public GameObject humanBoat;
public GameObject aiBoat;
public Race raceData;
private void Start()

private void CreateBoats()
{
if (useDOTS)
{
CreateBoats_DOTS();
return;
}
var i = 0;
foreach (var boat in raceData.boats)
{

i++;
}
}
private void CreateBoats_DOTS()
{
var i = 0;
foreach (var boat in raceData.boats)
{
var matrix = WaypointGroup.instance.startingPositons[i];
var prefab = boat.Human ? humanBoat : aiBoat;
GameObject entityObj = Instantiate(prefab, matrix.GetColumn(3), Quaternion.LookRotation(matrix.GetColumn(2))) as GameObject;
GameObject boatObject = entityObj.GetComponent<BuoyantObject_DOTS>().childObject;
boatObject.name = boat.boatName;
BoatController boatController = boatObject.GetComponent<BoatController>();
boatController.cam.gameObject.layer = LayerMask.NameToLayer("Player" + (i + 1));
i++;
}
}
}
}

162
Assets/scenes/Island.unity


- target: {fileID: 7357475664972103680, guid: 860f73418635b430596220c04821a36c,
type: 3}
propertyPath: m_RootOrder
value: 9
value: 8
objectReference: {fileID: 0}
- target: {fileID: 7357475664972103680, guid: 860f73418635b430596220c04821a36c,
type: 3}

m_AmplitudeGain: 1
m_FrequencyGain: 1
mNoiseOffsets: {x: 527.5414, y: 670.016, z: 973.20294}
--- !u!4 &162950506 stripped
Transform:
m_CorrespondingSourceObject: {fileID: 6450326203797976577, guid: 5962dbe0eae0ef049ac51af92afaef2f,
type: 3}
m_PrefabInstance: {fileID: 1032374063}
m_PrefabAsset: {fileID: 0}
--- !u!1 &198446338
GameObject:
m_ObjectHideFlags: 3

m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 471032674}
m_LocalRotation: {x: -0, y: -0, z: -0, w: 1}
m_LocalPosition: {x: -62.5, y: -0.25, z: 56.25}
m_LocalPosition: {x: -81.25, y: -0.25, z: -31.25}
m_LocalScale: {x: 1, y: 1, z: 1}
m_Children: []
m_Father: {fileID: 0}

m_Name:
m_EditorClassIdentifier:
m_FogColor: {r: 1.2723992, g: 1.7492784, b: 1.802265, a: 1}
--- !u!1001 &1032374063
PrefabInstance:
m_ObjectHideFlags: 0
serializedVersion: 2
m_Modification:
m_TransformParent: {fileID: 0}
m_Modifications:
- target: {fileID: 6450326203797976577, guid: 5962dbe0eae0ef049ac51af92afaef2f,
type: 3}
propertyPath: m_LocalPosition.x
value: -98.33657
objectReference: {fileID: 0}
- target: {fileID: 6450326203797976577, guid: 5962dbe0eae0ef049ac51af92afaef2f,
type: 3}
propertyPath: m_LocalPosition.y
value: -42.54921
objectReference: {fileID: 0}
- target: {fileID: 6450326203797976577, guid: 5962dbe0eae0ef049ac51af92afaef2f,
type: 3}
propertyPath: m_LocalPosition.z
value: 75.09257
objectReference: {fileID: 0}
- target: {fileID: 6450326203797976577, guid: 5962dbe0eae0ef049ac51af92afaef2f,
type: 3}
propertyPath: m_LocalRotation.x
value: 0
objectReference: {fileID: 0}
- target: {fileID: 6450326203797976577, guid: 5962dbe0eae0ef049ac51af92afaef2f,
type: 3}
propertyPath: m_LocalRotation.y
value: 0
objectReference: {fileID: 0}
- target: {fileID: 6450326203797976577, guid: 5962dbe0eae0ef049ac51af92afaef2f,
type: 3}
propertyPath: m_LocalRotation.z
value: 0
objectReference: {fileID: 0}
- target: {fileID: 6450326203797976577, guid: 5962dbe0eae0ef049ac51af92afaef2f,
type: 3}
propertyPath: m_LocalRotation.w
value: 1
objectReference: {fileID: 0}
- target: {fileID: 6450326203797976577, guid: 5962dbe0eae0ef049ac51af92afaef2f,
type: 3}
propertyPath: m_RootOrder
value: 8
objectReference: {fileID: 0}
- target: {fileID: 6450326203797976577, guid: 5962dbe0eae0ef049ac51af92afaef2f,
type: 3}
propertyPath: m_LocalEulerAnglesHint.x
value: 0
objectReference: {fileID: 0}
- target: {fileID: 6450326203797976577, guid: 5962dbe0eae0ef049ac51af92afaef2f,
type: 3}
propertyPath: m_LocalEulerAnglesHint.y
value: 0
objectReference: {fileID: 0}
- target: {fileID: 6450326203797976577, guid: 5962dbe0eae0ef049ac51af92afaef2f,
type: 3}
propertyPath: m_LocalEulerAnglesHint.z
value: 0
objectReference: {fileID: 0}
- target: {fileID: 6450326203797976588, guid: 5962dbe0eae0ef049ac51af92afaef2f,
type: 3}
propertyPath: m_Name
value: DOTS Helper
objectReference: {fileID: 0}
- target: {fileID: 6450326203797976588, guid: 5962dbe0eae0ef049ac51af92afaef2f,
type: 3}
propertyPath: m_IsActive
value: 0
objectReference: {fileID: 0}
- target: {fileID: 6450326203797976579, guid: 5962dbe0eae0ef049ac51af92afaef2f,
type: 3}
propertyPath: m_Enabled
value: 1
objectReference: {fileID: 0}
m_RemovedComponents: []
m_SourcePrefab: {fileID: 100100000, guid: 5962dbe0eae0ef049ac51af92afaef2f, type: 3}
--- !u!1 &1095320327
GameObject:
m_ObjectHideFlags: 3

m_HasTransformHierarchy: 1
m_AllowConstantClipSamplingOptimization: 1
m_KeepAnimatorControllerStateOnDisable: 0
--- !u!1001 &1460550506
PrefabInstance:
m_ObjectHideFlags: 0
serializedVersion: 2
m_Modification:
m_TransformParent: {fileID: 162950506}
m_Modifications:
- target: {fileID: 6698997538611213016, guid: ebb958ca9e119be438b62f3cce1981fc,
type: 3}
propertyPath: m_Name
value: Physics Settings
objectReference: {fileID: 0}
- target: {fileID: 4018593011617785703, guid: ebb958ca9e119be438b62f3cce1981fc,
type: 3}
propertyPath: m_LocalPosition.x
value: -81.26014
objectReference: {fileID: 0}
- target: {fileID: 4018593011617785703, guid: ebb958ca9e119be438b62f3cce1981fc,
type: 3}
propertyPath: m_LocalPosition.y
value: -1.9031935
objectReference: {fileID: 0}
- target: {fileID: 4018593011617785703, guid: ebb958ca9e119be438b62f3cce1981fc,
type: 3}
propertyPath: m_LocalPosition.z
value: -21.097088
objectReference: {fileID: 0}
- target: {fileID: 4018593011617785703, guid: ebb958ca9e119be438b62f3cce1981fc,
type: 3}
propertyPath: m_LocalRotation.x
value: 0
objectReference: {fileID: 0}
- target: {fileID: 4018593011617785703, guid: ebb958ca9e119be438b62f3cce1981fc,
type: 3}
propertyPath: m_LocalRotation.y
value: 0
objectReference: {fileID: 0}
- target: {fileID: 4018593011617785703, guid: ebb958ca9e119be438b62f3cce1981fc,
type: 3}
propertyPath: m_LocalRotation.z
value: 0
objectReference: {fileID: 0}
- target: {fileID: 4018593011617785703, guid: ebb958ca9e119be438b62f3cce1981fc,
type: 3}
propertyPath: m_LocalRotation.w
value: 1
objectReference: {fileID: 0}
- target: {fileID: 4018593011617785703, guid: ebb958ca9e119be438b62f3cce1981fc,
type: 3}
propertyPath: m_RootOrder
value: 0
objectReference: {fileID: 0}
- target: {fileID: 4018593011617785703, guid: ebb958ca9e119be438b62f3cce1981fc,
type: 3}
propertyPath: m_LocalEulerAnglesHint.x
value: 0
objectReference: {fileID: 0}
- target: {fileID: 4018593011617785703, guid: ebb958ca9e119be438b62f3cce1981fc,
type: 3}
propertyPath: m_LocalEulerAnglesHint.y
value: 0
objectReference: {fileID: 0}
- target: {fileID: 4018593011617785703, guid: ebb958ca9e119be438b62f3cce1981fc,
type: 3}
propertyPath: m_LocalEulerAnglesHint.z
value: 0
objectReference: {fileID: 0}
m_RemovedComponents: []
m_SourcePrefab: {fileID: 100100000, guid: ebb958ca9e119be438b62f3cce1981fc, type: 3}
--- !u!1 &1490334302
GameObject:
m_ObjectHideFlags: 0

- target: {fileID: 6589000190618102542, guid: e70416e3bc35d4004a9981d0ac102ba5,
type: 3}
propertyPath: m_LocalRotation.y
value: 0.7262534
value: 0.72625333
value: 0.6842787
value: 0.68427867
objectReference: {fileID: 0}
- target: {fileID: 8115735017685696522, guid: e70416e3bc35d4004a9981d0ac102ba5,
type: 3}

2
Packages/manifest.json


"com.unity.burst": "1.1.2",
"com.unity.cinemachine": "2.3.4",
"com.unity.collab-proxy": "1.2.16",
"com.unity.entities": "0.1.1-preview",
"com.unity.physics": "0.2.0-preview",
"com.unity.properties": "0.6.4-preview",
"com.unity.purchasing": "2.0.6",
"com.unity.render-pipelines.universal": "7.0.1",

8
Assets/Scripts/DOTS.meta


fileFormatVersion: 2
guid: 50a088ca486a3814f9d009649668b1d1
folderAsset: yes
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:

7
Assets/scenes/Physics Scene.unity.meta


fileFormatVersion: 2
guid: 15526d9c33e0e1a4a976cb75b81a90bb
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:

1001
Assets/scenes/Physics Scene.unity
文件差异内容过多而无法显示
查看文件

正在加载...
取消
保存