diff --git a/MAEasySimulator/Assets/BoxReady.prefab b/MAEasySimulator/Assets/BoxReady.prefab
new file mode 100644
index 0000000..0486e12
--- /dev/null
+++ b/MAEasySimulator/Assets/BoxReady.prefab
@@ -0,0 +1,117 @@
+%YAML 1.1
+%TAG !u! tag:unity3d.com,2011:
+--- !u!1 &1464484887366625871
+GameObject:
+ m_ObjectHideFlags: 0
+ m_CorrespondingSourceObject: {fileID: 0}
+ m_PrefabInstance: {fileID: 0}
+ m_PrefabAsset: {fileID: 0}
+ serializedVersion: 6
+ m_Component:
+ - component: {fileID: 2240881192534159605}
+ m_Layer: 0
+ m_Name: BoxReady
+ m_TagString: Untagged
+ m_Icon: {fileID: 0}
+ m_NavMeshLayer: 0
+ m_StaticEditorFlags: 0
+ m_IsActive: 1
+--- !u!4 &2240881192534159605
+Transform:
+ m_ObjectHideFlags: 0
+ m_CorrespondingSourceObject: {fileID: 0}
+ m_PrefabInstance: {fileID: 0}
+ m_PrefabAsset: {fileID: 0}
+ m_GameObject: {fileID: 1464484887366625871}
+ 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: 1686881325863600557}
+ m_Father: {fileID: 0}
+ m_RootOrder: 0
+ m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
+--- !u!1 &7628867827952849558
+GameObject:
+ m_ObjectHideFlags: 0
+ m_CorrespondingSourceObject: {fileID: 0}
+ m_PrefabInstance: {fileID: 0}
+ m_PrefabAsset: {fileID: 0}
+ serializedVersion: 6
+ m_Component:
+ - component: {fileID: 1686881325863600557}
+ - component: {fileID: 4593160332070172903}
+ - component: {fileID: 1052598617310108787}
+ m_Layer: 0
+ m_Name: default
+ m_TagString: Untagged
+ m_Icon: {fileID: 0}
+ m_NavMeshLayer: 0
+ m_StaticEditorFlags: 0
+ m_IsActive: 1
+--- !u!4 &1686881325863600557
+Transform:
+ m_ObjectHideFlags: 0
+ m_CorrespondingSourceObject: {fileID: 0}
+ m_PrefabInstance: {fileID: 0}
+ m_PrefabAsset: {fileID: 0}
+ m_GameObject: {fileID: 7628867827952849558}
+ 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: []
+ m_Father: {fileID: 2240881192534159605}
+ m_RootOrder: 0
+ m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
+--- !u!33 &4593160332070172903
+MeshFilter:
+ m_ObjectHideFlags: 0
+ m_CorrespondingSourceObject: {fileID: 0}
+ m_PrefabInstance: {fileID: 0}
+ m_PrefabAsset: {fileID: 0}
+ m_GameObject: {fileID: 7628867827952849558}
+ m_Mesh: {fileID: -2432090755550338912, guid: 108d7f9df3c40e24fa41d9378c7dc09b, type: 3}
+--- !u!23 &1052598617310108787
+MeshRenderer:
+ m_ObjectHideFlags: 0
+ m_CorrespondingSourceObject: {fileID: 0}
+ m_PrefabInstance: {fileID: 0}
+ m_PrefabAsset: {fileID: 0}
+ m_GameObject: {fileID: 7628867827952849558}
+ m_Enabled: 1
+ m_CastShadows: 1
+ m_ReceiveShadows: 1
+ m_DynamicOccludee: 1
+ m_StaticShadowCaster: 0
+ m_MotionVectors: 1
+ m_LightProbeUsage: 1
+ m_ReflectionProbeUsage: 1
+ m_RayTracingMode: 2
+ m_RayTraceProcedural: 0
+ m_RenderingLayerMask: 1
+ m_RendererPriority: 0
+ m_Materials:
+ - {fileID: 2100000, guid: ae084d9f2e473734d896276d52440441, type: 2}
+ 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: 3
+ m_MinimumChartSize: 4
+ m_AutoUVMaxDistance: 0.5
+ m_AutoUVMaxAngle: 89
+ m_LightmapParameters: {fileID: 0}
+ m_SortingLayerID: 0
+ m_SortingLayer: 0
+ m_SortingOrder: 0
+ m_AdditionalVertexStreams: {fileID: 0}
diff --git a/MAEasySimulator/Assets/BoxReady.prefab.meta b/MAEasySimulator/Assets/BoxReady.prefab.meta
new file mode 100644
index 0000000..1375135
--- /dev/null
+++ b/MAEasySimulator/Assets/BoxReady.prefab.meta
@@ -0,0 +1,7 @@
+fileFormatVersion: 2
+guid: 4f905cb687ee5c547bf9c92595cc2946
+PrefabImporter:
+ externalObjects: {}
+ userData:
+ assetBundleName:
+ assetBundleVariant:
diff --git a/MAEasySimulator/Assets/Drone/Art/material/blue.mat b/MAEasySimulator/Assets/Drone/Art/material/blue.mat
index e850fd7..cde4a32 100644
--- a/MAEasySimulator/Assets/Drone/Art/material/blue.mat
+++ b/MAEasySimulator/Assets/Drone/Art/material/blue.mat
@@ -130,7 +130,7 @@ Material:
- _ZWrite: 1
m_Colors:
- _BaseColor: {r: 0, g: 0.638464, b: 1, a: 1}
- - _Color: {r: 1, g: 1, b: 1, a: 1}
+ - _Color: {r: 0, g: 0.638464, b: 1, a: 1}
- _EmissionColor: {r: 0.062032763, g: 0.55507654, b: 0.7735849, a: 1}
- _SpecColor: {r: 0.19999996, g: 0.19999996, b: 0.19999996, a: 1}
m_BuildTextureStacks: []
diff --git a/MAEasySimulator/Assets/DroneController.cs b/MAEasySimulator/Assets/DroneController.cs
index 172e109..bd6e5be 100644
--- a/MAEasySimulator/Assets/DroneController.cs
+++ b/MAEasySimulator/Assets/DroneController.cs
@@ -5,46 +5,126 @@
using Unity.MLAgents.Actuators;
using Unity.MLAgents.Sensors;
+///
+/// ドローン共通コンポーネント
+///
public class DroneController : MonoBehaviour {
[Header("Movement Parameters")]
public float moveSpeed = 10f; // 移動速度
- public float verticalForce = 10f; // 上昇・下降の強さ
- public float tiltAng = 10f; // 傾きの角度
- public float tiltVel = 5f; // 傾きの速度
public float rotSpeed = 100f; // 回転速度
- public float sidewaysTiltAmount;
- public float forwardTiltAmount;
- public float rotAmount;
+ [Header("Battery")]
+ public float batteryLevel = 100f; // バッテリー残量の初期値
+ private float batteryDrainRate = 1f; // 1秒あたりのバッテリー消費率
[Header("Communication Parameters")]
public float communicationRange = 10f; // 通信範囲(半径)
public GameObject communicateArea; //通信電波域を表すオブジェクト円形(Droneの子要素として定義)
-
+ [Header("Crash Objects")]
+ public List CrashTags; //衝突判定対象のタグ
public Rigidbody Rbody;
+ /**Events*/
+ public delegate void OnReceiveMessage(string message);
+ public OnReceiveMessage onReceiveMsg;
+ public delegate void OnCrash(Vector3 crashPos);
+ public OnCrash onCrash;
+ public delegate void OnEmptyButtery();
+ public OnEmptyButtery onEmptyBattery;
+ /***/
+ public List CommunicateTargetTags;
+ private string Team;
+
void Start() {
Rbody = GetComponent();
communicateArea.transform.localScale = new Vector3(communicationRange, communicationRange, communicationRange);
+ StartCoroutine(BatteryDrainCoroutine());
+ }
+
+ void OnTriggerEnter(Collider other) {
+ if (CrashTags.Contains(other.tag)) {
+ onCrash?.Invoke(other.transform.position);
+ FreeFall();
+ }
+ }
+
+ public void RegisterTeam(string team) {
+ Team = team;
+ }
+ public void AddCommunicateTarget(string target) {
+ CommunicateTargetTags.Add(target);
+ }
+
+ public void InHeuristicCtrl(in ActionBuffers actionsOut) {
+ var action = actionsOut.ContinuousActions;
+ //WASD定義
+ if(Input.GetKey(KeyCode.W)) {
+ //前進
+ action[1] = 1f;
+ } else if (Input.GetKey(KeyCode.S)) {
+ //後退
+ action[1] = -1f;
+ }
+
+ if (Input.GetKey(KeyCode.A)) {
+ //左移動
+ action[0] = -1f;
+ } else if (Input.GetKey(KeyCode.D)) {
+ //右移動
+ action[0] = 1f;
+ }
+
+ if (Input.GetKey(KeyCode.LeftArrow)) {
+ //左回転
+ action[2] = -1f;
+ } else if (Input.GetKey(KeyCode.RightArrow)) {
+ //右回転
+ action[2] = 1f;
+ }
+
+ if (Input.GetKey(KeyCode.Space)) {
+ //上昇
+ action[3] = 1f;
+ } else if (Input.GetKey(KeyCode.LeftShift)) {
+ //下降
+ action[3] = -1f;
+ }
}
public void FlyingCtrl(ActionBuffers actions) {
- float horInput = actions.ContinuousActions[0];
- float verInput = actions.ContinuousActions[1];
- float rotInput = actions.ContinuousActions[2];
+ float horInput = actions.ContinuousActions[0]; //水平方向の入力(左右)
+ float verInput = actions.ContinuousActions[1]; //垂直方向の入力(前後)
+ float rotInput = actions.ContinuousActions[2]; //回転方向の入力
+ float altInput = actions.ContinuousActions[3]; //高度方向の入力(上下)
+
+ if (batteryLevel <= 0) {
+ return;
+ }
- // 水平、垂直方向の移動計算
- Vector3 moveDirection = new Vector3(horInput, 0, verInput) * moveSpeed;
- Rbody.AddForce(transform.TransformDirection(moveDirection));
+ if(horInput > 0) {
+ Right(horInput);
+ } else {
+ Left(Mathf.Abs(horInput));
+ }
+ if(verInput > 0) {
+ Forward(verInput);
+ } else {
+ Back(Mathf.Abs(verInput));
+ }
+ //回転
+ if(rotInput > 0) {
+ Cw(rotInput);
+ } else if (rotInput < 0) {
+ Ccw(Mathf.Abs(rotInput));
+ }
+ //高度方向の移動
+ if(altInput > 0) {
+ Up(altInput);
+ } else if (altInput < 0) {
+ Down(Mathf.Abs(altInput));
+ }
- // 入力に基づいて傾き・回転を計算
- sidewaysTiltAmount = Mathf.Lerp(sidewaysTiltAmount, -horInput * tiltAng, tiltVel * Time.fixedDeltaTime);
- forwardTiltAmount = Mathf.Lerp(forwardTiltAmount, verInput * tiltAng, tiltVel * Time.fixedDeltaTime);
- rotAmount += rotInput * rotSpeed * Time.fixedDeltaTime;
- // 傾き・回転をドローンに適用
- Quaternion targetRot = Quaternion.Euler(forwardTiltAmount, rotAmount, sidewaysTiltAmount);
- transform.rotation = targetRot;
}
///
@@ -54,7 +134,7 @@ public bool Communicate(string message) {
Collider[] hitColliders = Physics.OverlapSphere(transform.position, communicationRange); //範囲内にあるコライダーを取得
var result = false;
foreach (var hitCollider in hitColliders) {
- if (hitCollider.tag == "Drone") { //TODO:ハードコードを避ける
+ if (CommunicateTargetTags.Contains(hitCollider.tag)) {
hitCollider.GetComponent().ReceiveMessage(message);
result = true;
}
@@ -67,6 +147,101 @@ public bool Communicate(string message) {
///
public void ReceiveMessage(string message) {
Debug.Log("Message received: " + message);
+ onReceiveMsg?.Invoke(message);
+ }
+
+
+ private void FreeFall() {
+ Rbody.useGravity = true;
+ //FreezePosition,FreezeRotationを解除
+ Rbody.constraints = RigidbodyConstraints.None;
+ }
+
+ private IEnumerator BatteryDrainCoroutine() {
+ while (batteryLevel > 0) {
+ yield return new WaitForSeconds(1);
+ batteryLevel -= batteryDrainRate;
+ Debug.Log($"Battery Level: {batteryLevel}%");
+ }
+ onEmptyBattery?.Invoke();
+ FreeFall();
+ }
+
+ //NOTE:以下はTello SDKを参考
+ private static Vector3 RenewPosLerp(Vector3 currentPos, Vector3 targetPos, float speed) {
+ return Vector3.Lerp(currentPos, targetPos, speed * Time.deltaTime);
+ }
+ ///
+ /// 機体を上昇させる
+ ///
+ /// どのくらいの座標上昇させるか
+ private void Up(float value) {
+ Vector3 newPos = new Vector3(transform.localPosition.x, transform.localPosition.y + value, transform.localPosition.z);
+ transform.localPosition = RenewPosLerp(transform.localPosition, newPos, moveSpeed);
+ }
+
+ ///
+ /// 機体を下降させる
+ ///
+ /// どのくらいの座標下降させるか
+ private void Down(float value) {
+ Vector3 newPos = new Vector3(transform.localPosition.x, transform.localPosition.y - value, transform.localPosition.z);
+ transform.localPosition = RenewPosLerp(transform.localPosition, newPos, moveSpeed);
+ }
+
+ ///
+ /// Moves the aircraft forward based on its current orientation.
+ ///
+ /// How much to move the aircraft forward.
+ private void Forward(float value) {
+ Vector3 newPos = transform.position + transform.forward * value;
+ transform.position = RenewPosLerp(transform.position, newPos, moveSpeed);
+ }
+
+ ///
+ /// Moves the aircraft backward based on its current orientation.
+ ///
+ /// How much to move the aircraft backward.
+ private void Back(float value) {
+ Vector3 newPos = transform.position - transform.forward * value;
+ transform.position = RenewPosLerp(transform.position, newPos, moveSpeed);
+ }
+
+ ///
+ /// Moves the aircraft to the left based on its current orientation.
+ ///
+ /// How much to move the aircraft to the left.
+ private void Left(float value) {
+ Vector3 newPos = transform.position - transform.right * value;
+ transform.position = RenewPosLerp(transform.position, newPos, moveSpeed);
+ }
+
+ ///
+ /// Moves the aircraft to the right based on its current orientation.
+ ///
+ /// How much to move the aircraft to the right.
+ private void Right(float value) {
+ Vector3 newPos = transform.position + transform.right * value;
+ transform.position = RenewPosLerp(transform.position, newPos, moveSpeed);
+ }
+
+
+ ///
+ /// 時計回りに旋回
+ ///
+ /// How much to rotate the aircraft clockwise.
+ private void Cw(float value) {
+ transform.Rotate(Vector3.up * rotSpeed * Time.deltaTime);
+ }
+
+ ///
+ /// 反時計回りに機体を回転させる
+ ///
+ /// How much to rotate the aircraft counterclockwise.
+ private void Ccw(float value) {
+ transform.Rotate(Vector3.down * rotSpeed * Time.deltaTime);
}
+
+
}
diff --git a/MAEasySimulator/Assets/ML-Agents.meta b/MAEasySimulator/Assets/ML-Agents.meta
new file mode 100644
index 0000000..315d404
--- /dev/null
+++ b/MAEasySimulator/Assets/ML-Agents.meta
@@ -0,0 +1,8 @@
+fileFormatVersion: 2
+guid: d91a052ca07602946b08ecd447c647e3
+folderAsset: yes
+DefaultImporter:
+ externalObjects: {}
+ userData:
+ assetBundleName:
+ assetBundleVariant:
diff --git a/MAEasySimulator/Assets/NNParam.yaml b/MAEasySimulator/Assets/NNParam.yaml
new file mode 100644
index 0000000..bab3241
--- /dev/null
+++ b/MAEasySimulator/Assets/NNParam.yaml
@@ -0,0 +1,49 @@
+behaviors:
+ Surpplier:
+ trainer_type: ppo
+ hyperparameters:
+ batch_size: 5120
+ buffer_size: 10240
+ learning_rate: 1e-4
+ beta: 1e-4
+ epsilon: 0.1
+ lambd: 0.9
+ num_epoch: 5
+ learning_rate_schedule: linear
+ network_settings:
+ normalize: false
+ hidden_units: 512
+ num_layers: 3
+ vis_encode_type: simple
+ reward_signals:
+ extrinsic:
+ gamma: 0.8
+ strength: 0.1
+ keep_checkpoints: 5
+ max_steps: 500000
+ time_horizon: 120
+ summary_freq: 1000
+ Spy:
+ trainer_type: ppo
+ hyperparameters:
+ batch_size: 5120
+ buffer_size: 10240
+ learning_rate: 1e-4
+ beta: 1e-4
+ epsilon: 0.1
+ lambd: 0.9
+ num_epoch: 5
+ learning_rate_schedule: linear
+ network_settings:
+ normalize: false
+ hidden_units: 512
+ num_layers: 3
+ vis_encode_type: simple
+ reward_signals:
+ extrinsic:
+ gamma: 0.8
+ strength: 0.1
+ keep_checkpoints: 5
+ max_steps: 500000
+ time_horizon: 120
+ summary_freq: 1000
diff --git a/MAEasySimulator/Assets/NNParam.yaml.meta b/MAEasySimulator/Assets/NNParam.yaml.meta
new file mode 100644
index 0000000..944c4ea
--- /dev/null
+++ b/MAEasySimulator/Assets/NNParam.yaml.meta
@@ -0,0 +1,7 @@
+fileFormatVersion: 2
+guid: e64e07d733205e1428ea3b77b5ec7304
+TextScriptImporter:
+ externalObjects: {}
+ userData:
+ assetBundleName:
+ assetBundleVariant:
diff --git a/MAEasySimulator/Assets/Scenes/test0.4.unity b/MAEasySimulator/Assets/Scenes/test0.4.unity
index 9c76b10..cb24b43 100644
--- a/MAEasySimulator/Assets/Scenes/test0.4.unity
+++ b/MAEasySimulator/Assets/Scenes/test0.4.unity
@@ -1,3 +1,3 @@
version https://git-lfs.github.com/spec/v1
-oid sha256:8c9b5c1630a9653391cdc6535b34cfb2a14a1bfaf33f51898a71427078e79849
-size 62510
+oid sha256:81f2128db5ad367cb171244bfd49f161c8892a399e98f3642b102ae932c0bbb1
+size 78389
diff --git a/MAEasySimulator/Assets/Shelter.prefab b/MAEasySimulator/Assets/Shelter.prefab
index 4ef521e..123a63c 100644
--- a/MAEasySimulator/Assets/Shelter.prefab
+++ b/MAEasySimulator/Assets/Shelter.prefab
@@ -12,7 +12,7 @@ GameObject:
- component: {fileID: -2247916801560316409}
m_Layer: 0
m_Name: Shelter
- m_TagString: Untagged
+ m_TagString: Shelter
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
@@ -50,7 +50,7 @@ BoxCollider:
serializedVersion: 2
m_Bits: 0
m_LayerOverridePriority: 0
- m_IsTrigger: 0
+ m_IsTrigger: 1
m_ProvidesContacts: 0
m_Enabled: 1
serializedVersion: 3
diff --git a/MAEasySimulator/Assets/SpyAgent.cs b/MAEasySimulator/Assets/SpyAgent.cs
new file mode 100644
index 0000000..ca1dfb0
--- /dev/null
+++ b/MAEasySimulator/Assets/SpyAgent.cs
@@ -0,0 +1,83 @@
+using System.Collections;
+using System.Collections.Generic;
+using UnityEngine;
+using Unity.MLAgents;
+using Unity.MLAgents.Actuators;
+using Unity.MLAgents.Sensors;
+
+public class SpyAgent : Agent {
+
+ private Transform Sensor;
+ private float rayDistance = 40f; // レイキャストの距離
+ //TODO:以下複数の避難所を検出する場合の対応
+ private string targetTag = "Shelter";
+ private Vector3 targetPos = Vector3.zero;
+
+ private DroneController _controller;
+ private EnvManager _env;
+ private int _findCount = 0;
+
+ private delegate void OnFindShelter(Vector3 pos);
+ private OnFindShelter _onFindShelter;
+ private string LogPrefix = "[Agent Spy]";
+
+ void Start() {
+ _controller = GetComponent();
+ _env = GetComponentInParent();
+ _controller.RegisterTeam(gameObject.tag);
+ _controller.AddCommunicateTarget(targetTag);
+ Sensor = transform.Find("Sensor");
+ }
+
+ public override void OnEpisodeBegin() {
+ _env.InitializeRandomPositions();
+ }
+
+ ///
+ /// 観測情報
+ /// 1.自身の速度 Vector3
+ /// 2.偵察して得た避難所の位置 Vector3
+ ///
+ ///
+ public override void CollectObservations(VectorSensor sensor) {
+ sensor.AddObservation(_controller.Rbody.velocity);
+ RaycastHit hit;
+ // 子GameObjectの位置と方向からレイキャストを実行
+ if (Physics.Raycast(Sensor.transform.position, Sensor.forward, out hit, rayDistance)) {
+ if (hit.collider.CompareTag(targetTag)) {
+ targetPos = hit.point;
+ _onFindShelter?.Invoke(targetPos);
+ }
+ }
+ sensor.AddObservation(targetPos);
+ }
+
+ public override void OnActionReceived(ActionBuffers actions) {
+ _controller.FlyingCtrl(actions);
+ RewardDefinition();
+ }
+
+ private void RewardDefinition() {
+
+ }
+
+ public override void Heuristic(in ActionBuffers actionsOut) {
+ _controller.InHeuristicCtrl(actionsOut);
+ }
+
+ ///
+ /// レイキャストで避難所を検出した際のイベントハンドラー
+ ///
+ ///
+ private void _OnFindShelter(Vector3 pos) {
+ //検出情報を発信
+ _findCount++;
+ _controller.Communicate(pos.ToString());
+ Debug.Log(LogPrefix + "Find shelter at " + pos.ToString());
+ }
+
+
+
+
+
+}
diff --git a/MAEasySimulator/Assets/SpyAgent.cs.meta b/MAEasySimulator/Assets/SpyAgent.cs.meta
new file mode 100644
index 0000000..326df0d
--- /dev/null
+++ b/MAEasySimulator/Assets/SpyAgent.cs.meta
@@ -0,0 +1,11 @@
+fileFormatVersion: 2
+guid: 1b1cd394e4f17934dbf55f33e6c2502f
+MonoImporter:
+ externalObjects: {}
+ serializedVersion: 2
+ defaultReferences: []
+ executionOrder: 0
+ icon: {instanceID: 0}
+ userData:
+ assetBundleName:
+ assetBundleVariant:
diff --git a/MAEasySimulator/Assets/SpyAgent.prefab b/MAEasySimulator/Assets/SpyAgent.prefab
index 1e617a6..91f13be 100644
--- a/MAEasySimulator/Assets/SpyAgent.prefab
+++ b/MAEasySimulator/Assets/SpyAgent.prefab
@@ -1,5 +1,65 @@
%YAML 1.1
%TAG !u! tag:unity3d.com,2011:
+--- !u!1 &6291193101612035988
+GameObject:
+ m_ObjectHideFlags: 0
+ m_CorrespondingSourceObject: {fileID: 0}
+ m_PrefabInstance: {fileID: 0}
+ m_PrefabAsset: {fileID: 0}
+ serializedVersion: 6
+ m_Component:
+ - component: {fileID: 4346805486820663787}
+ - component: {fileID: 782739389039547031}
+ m_Layer: 0
+ m_Name: Sensor
+ m_TagString: Untagged
+ m_Icon: {fileID: 0}
+ m_NavMeshLayer: 0
+ m_StaticEditorFlags: 0
+ m_IsActive: 1
+--- !u!4 &4346805486820663787
+Transform:
+ m_ObjectHideFlags: 0
+ m_CorrespondingSourceObject: {fileID: 0}
+ m_PrefabInstance: {fileID: 0}
+ m_PrefabAsset: {fileID: 0}
+ m_GameObject: {fileID: 6291193101612035988}
+ m_LocalRotation: {x: 0.37497157, y: 0.000000059604638, z: 0.00000002235174, w: 0.92703635}
+ m_LocalPosition: {x: 0, y: -0.157, z: 1.046}
+ m_LocalScale: {x: 1, y: 1, z: 1}
+ m_ConstrainProportionsScale: 0
+ m_Children: []
+ m_Father: {fileID: 5917736595786903999}
+ m_RootOrder: -1
+ m_LocalEulerAnglesHint: {x: 44.045, y: 0, z: 0}
+--- !u!114 &782739389039547031
+MonoBehaviour:
+ m_ObjectHideFlags: 0
+ m_CorrespondingSourceObject: {fileID: 0}
+ m_PrefabInstance: {fileID: 0}
+ m_PrefabAsset: {fileID: 0}
+ m_GameObject: {fileID: 6291193101612035988}
+ m_Enabled: 1
+ m_EditorHideFlags: 0
+ m_Script: {fileID: 11500000, guid: 6bb6b867a41448888c1cd4f99643ad71, type: 3}
+ m_Name:
+ m_EditorClassIdentifier:
+ m_SensorName: RayPerceptionSensor
+ m_DetectableTags:
+ - Shelter
+ m_RaysPerDirection: 3
+ m_MaxRayDegrees: 70
+ m_SphereCastRadius: 0.5
+ m_RayLength: 40
+ m_RayLayerMask:
+ serializedVersion: 2
+ m_Bits: 4294967291
+ m_ObservationStacks: 1
+ m_AlternatingRayOrder: 1
+ rayHitColor: {r: 1, g: 0, b: 0, a: 1}
+ rayMissColor: {r: 1, g: 1, b: 1, a: 1}
+ m_StartVerticalOffset: 0
+ m_EndVerticalOffset: 0
--- !u!1 &6760585562241815342
GameObject:
m_ObjectHideFlags: 0
@@ -11,9 +71,14 @@ GameObject:
- component: {fileID: 5917736595786903999}
- component: {fileID: 2785089030330152451}
- component: {fileID: 1726398079756794906}
+ - component: {fileID: -781813917496609003}
+ - component: {fileID: -4717636981438990639}
+ - component: {fileID: 174229908787394523}
+ - component: {fileID: -646215098736134583}
+ - component: {fileID: 8559800387565644961}
m_Layer: 0
m_Name: SpyAgent
- m_TagString: Untagged
+ m_TagString: Spy
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
@@ -31,8 +96,10 @@ Transform:
m_ConstrainProportionsScale: 0
m_Children:
- {fileID: 8226043102162444679}
+ - {fileID: 4346805486820663787}
+ - {fileID: 4708222805887823008}
m_Father: {fileID: 0}
- m_RootOrder: -1
+ m_RootOrder: 0
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
--- !u!65 &2785089030330152451
BoxCollider:
@@ -77,6 +144,222 @@ NavMeshAgent:
m_BaseOffset: 0
m_WalkableMask: 4294967295
m_ObstacleAvoidanceType: 4
+--- !u!114 &-781813917496609003
+MonoBehaviour:
+ m_ObjectHideFlags: 0
+ m_CorrespondingSourceObject: {fileID: 0}
+ m_PrefabInstance: {fileID: 0}
+ m_PrefabAsset: {fileID: 0}
+ m_GameObject: {fileID: 6760585562241815342}
+ m_Enabled: 1
+ m_EditorHideFlags: 0
+ m_Script: {fileID: 11500000, guid: 68b4d1aa2cd0f934092f2e90fa44bf37, type: 3}
+ m_Name:
+ m_EditorClassIdentifier:
+ moveSpeed: 10
+ rotSpeed: 100
+ batteryLevel: 100
+ communicationRange: 10
+ communicateArea: {fileID: 0}
+ CrashTags:
+ - Surpplier
+ - Spy
+ Rbody: {fileID: 0}
+ CommunicateTargetTags:
+ - Surpplier
+--- !u!114 &-4717636981438990639
+MonoBehaviour:
+ m_ObjectHideFlags: 0
+ m_CorrespondingSourceObject: {fileID: 0}
+ m_PrefabInstance: {fileID: 0}
+ m_PrefabAsset: {fileID: 0}
+ m_GameObject: {fileID: 6760585562241815342}
+ m_Enabled: 1
+ m_EditorHideFlags: 0
+ m_Script: {fileID: 11500000, guid: 5d1c4e0b1822b495aa52bc52839ecb30, type: 3}
+ m_Name:
+ m_EditorClassIdentifier:
+ m_BrainParameters:
+ VectorObservationSize: 6
+ NumStackedVectorObservations: 1
+ m_ActionSpec:
+ m_NumContinuousActions: 4
+ BranchSizes:
+ VectorActionSize: 04000000
+ VectorActionDescriptions: []
+ VectorActionSpaceType: 1
+ hasUpgradedBrainParametersWithActionSpec: 1
+ m_Model: {fileID: 0}
+ m_InferenceDevice: 1
+ m_BehaviorType: 0
+ m_BehaviorName: Spy
+ TeamId: 1
+ m_UseChildSensors: 1
+ m_UseChildActuators: 1
+ m_DeterministicInference: 0
+ m_ObservableAttributeHandling: 0
+--- !u!114 &174229908787394523
+MonoBehaviour:
+ m_ObjectHideFlags: 0
+ m_CorrespondingSourceObject: {fileID: 0}
+ m_PrefabInstance: {fileID: 0}
+ m_PrefabAsset: {fileID: 0}
+ m_GameObject: {fileID: 6760585562241815342}
+ m_Enabled: 1
+ m_EditorHideFlags: 0
+ m_Script: {fileID: 11500000, guid: 1b1cd394e4f17934dbf55f33e6c2502f, type: 3}
+ m_Name:
+ m_EditorClassIdentifier:
+ agentParameters:
+ maxStep: 0
+ hasUpgradedFromAgentParameters: 1
+ MaxStep: 5000
+--- !u!114 &-646215098736134583
+MonoBehaviour:
+ m_ObjectHideFlags: 0
+ m_CorrespondingSourceObject: {fileID: 0}
+ m_PrefabInstance: {fileID: 0}
+ m_PrefabAsset: {fileID: 0}
+ m_GameObject: {fileID: 6760585562241815342}
+ m_Enabled: 1
+ m_EditorHideFlags: 0
+ m_Script: {fileID: 11500000, guid: 3a5c9d521e5ef4759a8246a07d52221e, type: 3}
+ m_Name:
+ m_EditorClassIdentifier:
+ DecisionPeriod: 5
+ TakeActionsBetweenDecisions: 1
+--- !u!54 &8559800387565644961
+Rigidbody:
+ m_ObjectHideFlags: 0
+ m_CorrespondingSourceObject: {fileID: 0}
+ m_PrefabInstance: {fileID: 0}
+ m_PrefabAsset: {fileID: 0}
+ m_GameObject: {fileID: 6760585562241815342}
+ serializedVersion: 4
+ m_Mass: 1
+ m_Drag: 0
+ m_AngularDrag: 0.05
+ m_CenterOfMass: {x: 0, y: 0, z: 0}
+ m_InertiaTensor: {x: 1, y: 1, z: 1}
+ m_InertiaRotation: {x: 0, y: 0, z: 0, w: 1}
+ m_IncludeLayers:
+ serializedVersion: 2
+ m_Bits: 0
+ m_ExcludeLayers:
+ serializedVersion: 2
+ m_Bits: 0
+ m_ImplicitCom: 1
+ m_ImplicitTensor: 1
+ m_UseGravity: 0
+ m_IsKinematic: 0
+ m_Interpolate: 0
+ m_Constraints: 126
+ m_CollisionDetection: 0
+--- !u!1 &7326297137937280723
+GameObject:
+ m_ObjectHideFlags: 0
+ m_CorrespondingSourceObject: {fileID: 0}
+ m_PrefabInstance: {fileID: 0}
+ m_PrefabAsset: {fileID: 0}
+ serializedVersion: 6
+ m_Component:
+ - component: {fileID: 4708222805887823008}
+ - component: {fileID: 6349270669969529134}
+ - component: {fileID: 2615060527395935412}
+ - component: {fileID: 8653900785797311662}
+ m_Layer: 0
+ m_Name: CommunicateArea
+ m_TagString: Untagged
+ m_Icon: {fileID: 0}
+ m_NavMeshLayer: 0
+ m_StaticEditorFlags: 0
+ m_IsActive: 1
+--- !u!4 &4708222805887823008
+Transform:
+ m_ObjectHideFlags: 0
+ m_CorrespondingSourceObject: {fileID: 0}
+ m_PrefabInstance: {fileID: 0}
+ m_PrefabAsset: {fileID: 0}
+ m_GameObject: {fileID: 7326297137937280723}
+ m_LocalRotation: {x: -0, y: 0.2916932, z: -0, w: 0.956512}
+ m_LocalPosition: {x: 0, y: 0, z: 0}
+ m_LocalScale: {x: 0.9999999, y: 1, z: 0.9999999}
+ m_ConstrainProportionsScale: 0
+ m_Children: []
+ m_Father: {fileID: 5917736595786903999}
+ m_RootOrder: -1
+ m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
+--- !u!33 &6349270669969529134
+MeshFilter:
+ m_ObjectHideFlags: 0
+ m_CorrespondingSourceObject: {fileID: 0}
+ m_PrefabInstance: {fileID: 0}
+ m_PrefabAsset: {fileID: 0}
+ m_GameObject: {fileID: 7326297137937280723}
+ m_Mesh: {fileID: 10207, guid: 0000000000000000e000000000000000, type: 0}
+--- !u!23 &2615060527395935412
+MeshRenderer:
+ m_ObjectHideFlags: 0
+ m_CorrespondingSourceObject: {fileID: 0}
+ m_PrefabInstance: {fileID: 0}
+ m_PrefabAsset: {fileID: 0}
+ m_GameObject: {fileID: 7326297137937280723}
+ m_Enabled: 0
+ m_CastShadows: 1
+ m_ReceiveShadows: 1
+ m_DynamicOccludee: 1
+ m_StaticShadowCaster: 0
+ m_MotionVectors: 1
+ m_LightProbeUsage: 1
+ m_ReflectionProbeUsage: 1
+ m_RayTracingMode: 2
+ m_RayTraceProcedural: 0
+ m_RenderingLayerMask: 1
+ m_RendererPriority: 0
+ m_Materials:
+ - {fileID: 2100000, guid: 31321ba15b8f8eb4c954353edc038b1d, type: 2}
+ 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: 3
+ m_MinimumChartSize: 4
+ m_AutoUVMaxDistance: 0.5
+ m_AutoUVMaxAngle: 89
+ m_LightmapParameters: {fileID: 0}
+ m_SortingLayerID: 0
+ m_SortingLayer: 0
+ m_SortingOrder: 0
+ m_AdditionalVertexStreams: {fileID: 0}
+--- !u!135 &8653900785797311662
+SphereCollider:
+ m_ObjectHideFlags: 0
+ m_CorrespondingSourceObject: {fileID: 0}
+ m_PrefabInstance: {fileID: 0}
+ m_PrefabAsset: {fileID: 0}
+ m_GameObject: {fileID: 7326297137937280723}
+ m_Material: {fileID: 0}
+ m_IncludeLayers:
+ serializedVersion: 2
+ m_Bits: 0
+ m_ExcludeLayers:
+ serializedVersion: 2
+ m_Bits: 0
+ m_LayerOverridePriority: 0
+ m_IsTrigger: 0
+ m_ProvidesContacts: 0
+ m_Enabled: 1
+ serializedVersion: 3
+ m_Radius: 0.5000002
+ m_Center: {x: 0.000015258793, y: 0, z: -0.0000033378597}
--- !u!1001 &3122581392483466709
PrefabInstance:
m_ObjectHideFlags: 0
diff --git a/MAEasySimulator/Assets/SurpplieAgent.cs b/MAEasySimulator/Assets/SurpplieAgent.cs
index 58f8d20..6d9ea78 100644
--- a/MAEasySimulator/Assets/SurpplieAgent.cs
+++ b/MAEasySimulator/Assets/SurpplieAgent.cs
@@ -12,7 +12,6 @@ public class SurpplieAgent : Agent {
[Header("Operation Targets")]
public GameObject DronePlatform; //ドローンの離着陸プラットフォーム
public GameObject Supplie; // 物資
- //public GameObject FieldFloor; // フィールド
public GameObject FieldArea;
[Header("State of Drone")]
@@ -22,20 +21,31 @@ public class SurpplieAgent : Agent {
private DroneController Ctrl;
private EnvManager env;
private int GetSupplieCount = 0;
+ private Vector3 shelterPosition = Vector3.zero;
+ private string LogPrefix = "[Agent Surpplier]";
+ private Vector3 StartPosition;
+
void Start() {
Ctrl = GetComponent();
env = GetComponentInParent();
+ Ctrl.onReceiveMsg += OnReceiveMessage;
+ Ctrl.onCrash += OnCrash;
+ Ctrl.onEmptyBattery += OnEmpty;
+ Ctrl.RegisterTeam(gameObject.tag);
+ StartPosition = transform.localPosition;
}
public override void OnEpisodeBegin() {
env.InitializeRandomPositions();
+ StartPosition = transform.localPosition;
+ Reset();
}
public override void CollectObservations(VectorSensor sensor) {
- //状態を観測
+ //自身の状態・速度を観測
sensor.AddObservation(isGetSupplie);
- //速度を観測
sensor.AddObservation(Ctrl.Rbody.velocity);
-
+ //偵察エージェントから受け取った情報を観測
+ sensor.AddObservation(shelterPosition);
}
public override void OnActionReceived(ActionBuffers actions) {
@@ -43,11 +53,11 @@ public override void OnActionReceived(ActionBuffers actions) {
var doRelease = actions.DiscreteActions[0] == 2 ? true : false;
var doGetSupplie = actions.DiscreteActions[0] == 1 ? true : false;
- var doSaving = actions.DiscreteActions[0] == 0 ? true : false;
+ var doNothing = actions.DiscreteActions[0] == 0 ? true : false;
if (doRelease) {
ReleaseSupplie();
- } else if (doGetSupplie) {
+ } else if (doGetSupplie && !isGetSupplie) { //TODO:物資が近くにあるかどうかの判定
GetSupplie();
}
@@ -55,17 +65,53 @@ public override void OnActionReceived(ActionBuffers actions) {
}
public override void Heuristic(in ActionBuffers actionsOut) {
- //todo: implement
+ Ctrl.InHeuristicCtrl(actionsOut);
+ if(Input.GetKey(KeyCode.R)) {
+ actionsOut.DiscreteActions.Array[0] = 2;
+ } else if (Input.GetKey(KeyCode.G)) {
+ actionsOut.DiscreteActions.Array[0] = 1;
+ } else {
+ actionsOut.DiscreteActions.Array[0] = 0;
+ }
}
///
- /// 報酬設計とエピソード終了定義
+ /// TODO:報酬設計とエピソード終了定義
///
private void RewardDefinition() {
}
+
+ ///
+ /// 他のドローンからメッセージを受信した時のイベントハンドラー
+ ///
+ ///
+ /// ShelterのXYZ座標
+ /// 例:(10.0, 0.0, 10.0)
+ ///
+ private void OnReceiveMessage(string message) {
+ //Vector3に変換
+ var shelterPos = message.Trim('(', ')').Split(',');
+ var x = float.Parse(shelterPos[0]);
+ var y = float.Parse(shelterPos[1]);
+ var z = float.Parse(shelterPos[2]);
+
+ //観察に追加
+ shelterPosition = new Vector3(x, y, z);
+ }
+
+ private void OnCrash(Vector3 position) {
+ Debug.Log(LogPrefix + "Crash at " + position);
+ EndEpisode();
+ }
+
+ private void OnEmpty() {
+ Debug.Log(LogPrefix + "Battery is empty");
+ //EndEpisode();
+ }
+
private void GetSupplie() {
Debug.Log("[Agent] Get Supplie");
//物資の重力を無効化
@@ -75,9 +121,9 @@ private void GetSupplie() {
// 物資の位置をドローンの下部に設定
Supplie.transform.localPosition = new Vector3(0, -4f, 0);
Supplie.transform.localRotation = Quaternion.Euler(0, 0, 0);
+ Supplie.transform.localRotation = Quaternion.Euler(0, 0, 0);
//位置を固定
Supplie.GetComponent().constraints = RigidbodyConstraints.FreezeAll;
-
isGetSupplie = true;
GetSupplieCount++;
//GetSupplieCounter.text = GetSupplieCount.ToString();
@@ -91,5 +137,20 @@ private void ReleaseSupplie() {
isGetSupplie = false;
}
+ private void Reset() {
+ /*
+ Vector3 pos = new Vector3(DronePlatform.transform.localPosition.x, DronePlatform.transform.localPosition.y + 3f, DronePlatform.transform.localPosition.z);
+ transform.localPosition = pos;
+ transform.localRotation = Quaternion.Euler(0, 0, 0);
+ */
+ transform.localPosition = StartPosition;
+ //Rigidbodyの状態をリセット
+ Ctrl.Rbody.useGravity = false;
+ Ctrl.Rbody.constraints = RigidbodyConstraints.FreezePosition | RigidbodyConstraints.FreezeRotation;
+ //バッテリーをリセット
+ Ctrl.batteryLevel = 100;
+ GetSupplie();
+ }
+
}
diff --git a/MAEasySimulator/Assets/SurpplieAgent.prefab b/MAEasySimulator/Assets/SurpplieAgent.prefab
index acd2d86..b7c654a 100644
--- a/MAEasySimulator/Assets/SurpplieAgent.prefab
+++ b/MAEasySimulator/Assets/SurpplieAgent.prefab
@@ -14,9 +14,12 @@ GameObject:
- component: {fileID: -6657309541605253924}
- component: {fileID: -1073448179587111684}
- component: {fileID: 6890476890023401154}
+ - component: {fileID: -3713612480836557185}
+ - component: {fileID: -2810409007917956328}
+ - component: {fileID: -7801201687882758552}
m_Layer: 0
m_Name: SurpplieAgent
- m_TagString: Untagged
+ m_TagString: Surpplier
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
@@ -28,13 +31,14 @@ Transform:
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 4567794751423368210}
- m_LocalRotation: {x: -0, y: -0.2916932, z: -0, w: 0.956512}
- m_LocalPosition: {x: -254.3, y: 55.18, z: -9.07}
+ m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
+ m_LocalPosition: {x: -254.331, y: 55.18, z: -9.023}
m_LocalScale: {x: 1, y: 1, z: 1}
m_ConstrainProportionsScale: 0
m_Children:
- {fileID: 5195557174291664800}
- - {fileID: 6147778203424681500}
+ - {fileID: 8983697745115193007}
+ - {fileID: 8141096457454617893}
m_Father: {fileID: 0}
m_RootOrder: 0
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
@@ -66,7 +70,7 @@ NavMeshAgent:
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 4567794751423368210}
- m_Enabled: 1
+ m_Enabled: 0
m_AgentTypeID: 0
m_Radius: 0.5
m_Speed: 3.5
@@ -94,13 +98,15 @@ MonoBehaviour:
m_Name:
m_EditorClassIdentifier:
moveSpeed: 10
- verticalForce: 10
- tiltAng: 10
- tiltVel: 5
rotSpeed: 100
- sidewaysTiltAmount: 0
- forwardTiltAmount: 0
- rotAmount: 0
+ batteryLevel: 100
+ communicationRange: 10
+ communicateArea: {fileID: 0}
+ CrashTags:
+ - Surpplier
+ - Spy
+ Rbody: {fileID: 0}
+ CommunicateTargetTags: []
--- !u!114 &-1073448179587111684
MonoBehaviour:
m_ObjectHideFlags: 0
@@ -114,11 +120,11 @@ MonoBehaviour:
m_Name:
m_EditorClassIdentifier:
m_BrainParameters:
- VectorObservationSize: 1
+ VectorObservationSize: 7
NumStackedVectorObservations: 1
m_ActionSpec:
- m_NumContinuousActions: 3
- BranchSizes: 01000000
+ m_NumContinuousActions: 4
+ BranchSizes: 03000000
VectorActionSize:
VectorActionDescriptions: []
VectorActionSpaceType: 0
@@ -147,13 +153,323 @@ MonoBehaviour:
agentParameters:
maxStep: 0
hasUpgradedFromAgentParameters: 1
- MaxStep: 0
- DronePlatform: {fileID: 0}
- Supplie: {fileID: 0}
- FieldFloor: {fileID: 0}
+ MaxStep: 5000
+ DronePlatform: {fileID: 2168808280500985780, guid: 0d6441937dd3d7f488adbb560c7f4c8b,
+ type: 3}
+ Supplie: {fileID: 1464484887366625871, guid: 973e30aed52df874a8a9b583c4cf06d6, type: 3}
FieldArea: {fileID: 0}
isGetSupplie: 0
- isOnShelter: 0
+--- !u!114 &-3713612480836557185
+MonoBehaviour:
+ m_ObjectHideFlags: 0
+ m_CorrespondingSourceObject: {fileID: 0}
+ m_PrefabInstance: {fileID: 0}
+ m_PrefabAsset: {fileID: 0}
+ m_GameObject: {fileID: 4567794751423368210}
+ m_Enabled: 1
+ m_EditorHideFlags: 0
+ m_Script: {fileID: 11500000, guid: 6bb6b867a41448888c1cd4f99643ad71, type: 3}
+ m_Name:
+ m_EditorClassIdentifier:
+ m_SensorName: ObstacleSensor
+ m_DetectableTags:
+ - Obstacle
+ m_RaysPerDirection: 3
+ m_MaxRayDegrees: 70
+ m_SphereCastRadius: 0.5
+ m_RayLength: 20
+ m_RayLayerMask:
+ serializedVersion: 2
+ m_Bits: 4294967291
+ m_ObservationStacks: 1
+ m_AlternatingRayOrder: 1
+ rayHitColor: {r: 1, g: 0, b: 0, a: 1}
+ rayMissColor: {r: 1, g: 1, b: 1, a: 1}
+ m_StartVerticalOffset: 0
+ m_EndVerticalOffset: 0
+--- !u!114 &-2810409007917956328
+MonoBehaviour:
+ m_ObjectHideFlags: 0
+ m_CorrespondingSourceObject: {fileID: 0}
+ m_PrefabInstance: {fileID: 0}
+ m_PrefabAsset: {fileID: 0}
+ m_GameObject: {fileID: 4567794751423368210}
+ m_Enabled: 1
+ m_EditorHideFlags: 0
+ m_Script: {fileID: 11500000, guid: 3a5c9d521e5ef4759a8246a07d52221e, type: 3}
+ m_Name:
+ m_EditorClassIdentifier:
+ DecisionPeriod: 5
+ TakeActionsBetweenDecisions: 1
+--- !u!54 &-7801201687882758552
+Rigidbody:
+ m_ObjectHideFlags: 0
+ m_CorrespondingSourceObject: {fileID: 0}
+ m_PrefabInstance: {fileID: 0}
+ m_PrefabAsset: {fileID: 0}
+ m_GameObject: {fileID: 4567794751423368210}
+ serializedVersion: 4
+ m_Mass: 1
+ m_Drag: 0
+ m_AngularDrag: 0.05
+ m_CenterOfMass: {x: 0, y: 0, z: 0}
+ m_InertiaTensor: {x: 1, y: 1, z: 1}
+ m_InertiaRotation: {x: 0, y: 0, z: 0, w: 1}
+ m_IncludeLayers:
+ serializedVersion: 2
+ m_Bits: 0
+ m_ExcludeLayers:
+ serializedVersion: 2
+ m_Bits: 0
+ m_ImplicitCom: 1
+ m_ImplicitTensor: 1
+ m_UseGravity: 0
+ m_IsKinematic: 0
+ m_Interpolate: 0
+ m_Constraints: 126
+ m_CollisionDetection: 0
+--- !u!1 &7551201119055863154
+GameObject:
+ m_ObjectHideFlags: 0
+ m_CorrespondingSourceObject: {fileID: 0}
+ m_PrefabInstance: {fileID: 0}
+ m_PrefabAsset: {fileID: 0}
+ serializedVersion: 6
+ m_Component:
+ - component: {fileID: 8983697745115193007}
+ - component: {fileID: 5900651902300955687}
+ - component: {fileID: 8924315156600755304}
+ - component: {fileID: 6910662737266330722}
+ m_Layer: 0
+ m_Name: Camera
+ m_TagString: Untagged
+ m_Icon: {fileID: 0}
+ m_NavMeshLayer: 0
+ m_StaticEditorFlags: 0
+ m_IsActive: 1
+--- !u!4 &8983697745115193007
+Transform:
+ m_ObjectHideFlags: 0
+ m_CorrespondingSourceObject: {fileID: 0}
+ m_PrefabInstance: {fileID: 0}
+ m_PrefabAsset: {fileID: 0}
+ m_GameObject: {fileID: 7551201119055863154}
+ m_LocalRotation: {x: -0, y: 0.026956853, z: -0, w: 0.99963665}
+ m_LocalPosition: {x: -0.37, y: 2.54, z: -6.64}
+ m_LocalScale: {x: 0.9999999, y: 1, z: 0.9999999}
+ m_ConstrainProportionsScale: 0
+ m_Children: []
+ m_Father: {fileID: 4663562311006893364}
+ m_RootOrder: -1
+ m_LocalEulerAnglesHint: {x: 0, y: 3.089, z: 0}
+--- !u!20 &5900651902300955687
+Camera:
+ m_ObjectHideFlags: 0
+ m_CorrespondingSourceObject: {fileID: 0}
+ m_PrefabInstance: {fileID: 0}
+ m_PrefabAsset: {fileID: 0}
+ m_GameObject: {fileID: 7551201119055863154}
+ m_Enabled: 1
+ serializedVersion: 2
+ m_ClearFlags: 1
+ m_BackGroundColor: {r: 0.19215687, g: 0.3019608, b: 0.4745098, a: 0}
+ m_projectionMatrixMode: 1
+ m_GateFitMode: 2
+ m_FOVAxisMode: 0
+ m_Iso: 200
+ m_ShutterSpeed: 0.005
+ m_Aperture: 16
+ m_FocusDistance: 10
+ m_FocalLength: 50
+ m_BladeCount: 5
+ m_Curvature: {x: 2, y: 11}
+ m_BarrelClipping: 0.25
+ m_Anamorphism: 0
+ m_SensorSize: {x: 36, y: 24}
+ m_LensShift: {x: 0, y: 0}
+ m_NormalizedViewPortRect:
+ serializedVersion: 2
+ x: 0
+ y: 0
+ width: 1
+ height: 1
+ near clip plane: 0.3
+ far clip plane: 1000
+ field of view: 60
+ orthographic: 0
+ orthographic size: 5
+ m_Depth: 0
+ m_CullingMask:
+ serializedVersion: 2
+ m_Bits: 4294967295
+ m_RenderingPath: -1
+ m_TargetTexture: {fileID: 0}
+ m_TargetDisplay: 1
+ m_TargetEye: 3
+ m_HDR: 1
+ m_AllowMSAA: 1
+ m_AllowDynamicResolution: 0
+ m_ForceIntoRT: 0
+ m_OcclusionCulling: 1
+ m_StereoConvergence: 10
+ m_StereoSeparation: 0.022
+--- !u!81 &8924315156600755304
+AudioListener:
+ m_ObjectHideFlags: 0
+ m_CorrespondingSourceObject: {fileID: 0}
+ m_PrefabInstance: {fileID: 0}
+ m_PrefabAsset: {fileID: 0}
+ m_GameObject: {fileID: 7551201119055863154}
+ m_Enabled: 1
+--- !u!114 &6910662737266330722
+MonoBehaviour:
+ m_ObjectHideFlags: 0
+ m_CorrespondingSourceObject: {fileID: 0}
+ m_PrefabInstance: {fileID: 0}
+ m_PrefabAsset: {fileID: 0}
+ m_GameObject: {fileID: 7551201119055863154}
+ m_Enabled: 1
+ m_EditorHideFlags: 0
+ m_Script: {fileID: 11500000, guid: a79441f348de89743a2939f4d699eac1, type: 3}
+ m_Name:
+ m_EditorClassIdentifier:
+ m_RenderShadows: 1
+ m_RequiresDepthTextureOption: 2
+ m_RequiresOpaqueTextureOption: 2
+ m_CameraType: 0
+ m_Cameras: []
+ m_RendererIndex: -1
+ m_VolumeLayerMask:
+ serializedVersion: 2
+ m_Bits: 1
+ m_VolumeTrigger: {fileID: 0}
+ m_VolumeFrameworkUpdateModeOption: 2
+ m_RenderPostProcessing: 0
+ m_Antialiasing: 0
+ m_AntialiasingQuality: 2
+ m_StopNaN: 0
+ m_Dithering: 0
+ m_ClearDepth: 1
+ m_AllowXRRendering: 1
+ m_AllowHDROutput: 1
+ m_UseScreenCoordOverride: 0
+ m_ScreenSizeOverride: {x: 0, y: 0, z: 0, w: 0}
+ m_ScreenCoordScaleBias: {x: 0, y: 0, z: 0, w: 0}
+ m_RequiresDepthTexture: 0
+ m_RequiresColorTexture: 0
+ m_Version: 2
+ m_TaaSettings:
+ quality: 3
+ frameInfluence: 0.1
+ jitterScale: 1
+ mipBias: 0
+ varianceClampScale: 0.9
+ contrastAdaptiveSharpening: 0
+--- !u!1 &8303635654864621995
+GameObject:
+ m_ObjectHideFlags: 0
+ m_CorrespondingSourceObject: {fileID: 0}
+ m_PrefabInstance: {fileID: 0}
+ m_PrefabAsset: {fileID: 0}
+ serializedVersion: 6
+ m_Component:
+ - component: {fileID: 8141096457454617893}
+ - component: {fileID: 3202019202187731792}
+ - component: {fileID: 8204467498397979531}
+ - component: {fileID: 3447869938172008056}
+ m_Layer: 0
+ m_Name: CommunicateArea
+ m_TagString: Untagged
+ m_Icon: {fileID: 0}
+ m_NavMeshLayer: 0
+ m_StaticEditorFlags: 0
+ m_IsActive: 1
+--- !u!4 &8141096457454617893
+Transform:
+ m_ObjectHideFlags: 0
+ m_CorrespondingSourceObject: {fileID: 0}
+ m_PrefabInstance: {fileID: 0}
+ m_PrefabAsset: {fileID: 0}
+ m_GameObject: {fileID: 8303635654864621995}
+ m_LocalRotation: {x: -0, y: 0.2916932, z: -0, w: 0.956512}
+ m_LocalPosition: {x: 0, y: 0, z: 0}
+ m_LocalScale: {x: 0.9999999, y: 1, z: 0.9999999}
+ m_ConstrainProportionsScale: 0
+ m_Children: []
+ m_Father: {fileID: 4663562311006893364}
+ m_RootOrder: -1
+ m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
+--- !u!33 &3202019202187731792
+MeshFilter:
+ m_ObjectHideFlags: 0
+ m_CorrespondingSourceObject: {fileID: 0}
+ m_PrefabInstance: {fileID: 0}
+ m_PrefabAsset: {fileID: 0}
+ m_GameObject: {fileID: 8303635654864621995}
+ m_Mesh: {fileID: 10207, guid: 0000000000000000e000000000000000, type: 0}
+--- !u!23 &8204467498397979531
+MeshRenderer:
+ m_ObjectHideFlags: 0
+ m_CorrespondingSourceObject: {fileID: 0}
+ m_PrefabInstance: {fileID: 0}
+ m_PrefabAsset: {fileID: 0}
+ m_GameObject: {fileID: 8303635654864621995}
+ m_Enabled: 0
+ m_CastShadows: 1
+ m_ReceiveShadows: 1
+ m_DynamicOccludee: 1
+ m_StaticShadowCaster: 0
+ m_MotionVectors: 1
+ m_LightProbeUsage: 1
+ m_ReflectionProbeUsage: 1
+ m_RayTracingMode: 2
+ m_RayTraceProcedural: 0
+ m_RenderingLayerMask: 1
+ m_RendererPriority: 0
+ m_Materials:
+ - {fileID: 2100000, guid: 31321ba15b8f8eb4c954353edc038b1d, type: 2}
+ 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: 3
+ m_MinimumChartSize: 4
+ m_AutoUVMaxDistance: 0.5
+ m_AutoUVMaxAngle: 89
+ m_LightmapParameters: {fileID: 0}
+ m_SortingLayerID: 0
+ m_SortingLayer: 0
+ m_SortingOrder: 0
+ m_AdditionalVertexStreams: {fileID: 0}
+--- !u!135 &3447869938172008056
+SphereCollider:
+ m_ObjectHideFlags: 0
+ m_CorrespondingSourceObject: {fileID: 0}
+ m_PrefabInstance: {fileID: 0}
+ m_PrefabAsset: {fileID: 0}
+ m_GameObject: {fileID: 8303635654864621995}
+ m_Material: {fileID: 0}
+ m_IncludeLayers:
+ serializedVersion: 2
+ m_Bits: 0
+ m_ExcludeLayers:
+ serializedVersion: 2
+ m_Bits: 0
+ m_LayerOverridePriority: 0
+ m_IsTrigger: 0
+ m_ProvidesContacts: 0
+ m_Enabled: 1
+ serializedVersion: 3
+ m_Radius: 0.5000002
+ m_Center: {x: 3.637979e-12, y: 0, z: 0.0000028610193}
--- !u!1001 &393291724298388612
PrefabInstance:
m_ObjectHideFlags: 0
@@ -233,82 +549,3 @@ Transform:
type: 3}
m_PrefabInstance: {fileID: 393291724298388612}
m_PrefabAsset: {fileID: 0}
---- !u!1001 &5352666860110110441
-PrefabInstance:
- m_ObjectHideFlags: 0
- serializedVersion: 2
- m_Modification:
- serializedVersion: 3
- m_TransformParent: {fileID: 4663562311006893364}
- m_Modifications:
- - target: {fileID: 1464484887366625871, guid: 973e30aed52df874a8a9b583c4cf06d6,
- type: 3}
- propertyPath: m_Name
- value: BoxReady
- objectReference: {fileID: 0}
- - target: {fileID: 2240881192534159605, guid: 973e30aed52df874a8a9b583c4cf06d6,
- type: 3}
- propertyPath: m_RootOrder
- value: 0
- objectReference: {fileID: 0}
- - target: {fileID: 2240881192534159605, guid: 973e30aed52df874a8a9b583c4cf06d6,
- type: 3}
- propertyPath: m_LocalPosition.x
- value: 0
- objectReference: {fileID: 0}
- - target: {fileID: 2240881192534159605, guid: 973e30aed52df874a8a9b583c4cf06d6,
- type: 3}
- propertyPath: m_LocalPosition.y
- value: -2.53
- objectReference: {fileID: 0}
- - target: {fileID: 2240881192534159605, guid: 973e30aed52df874a8a9b583c4cf06d6,
- type: 3}
- propertyPath: m_LocalPosition.z
- value: 0
- objectReference: {fileID: 0}
- - target: {fileID: 2240881192534159605, guid: 973e30aed52df874a8a9b583c4cf06d6,
- type: 3}
- propertyPath: m_LocalRotation.w
- value: 1
- objectReference: {fileID: 0}
- - target: {fileID: 2240881192534159605, guid: 973e30aed52df874a8a9b583c4cf06d6,
- type: 3}
- propertyPath: m_LocalRotation.x
- value: 0
- objectReference: {fileID: 0}
- - target: {fileID: 2240881192534159605, guid: 973e30aed52df874a8a9b583c4cf06d6,
- type: 3}
- propertyPath: m_LocalRotation.y
- value: -0
- objectReference: {fileID: 0}
- - target: {fileID: 2240881192534159605, guid: 973e30aed52df874a8a9b583c4cf06d6,
- type: 3}
- propertyPath: m_LocalRotation.z
- value: -0
- objectReference: {fileID: 0}
- - target: {fileID: 2240881192534159605, guid: 973e30aed52df874a8a9b583c4cf06d6,
- type: 3}
- propertyPath: m_LocalEulerAnglesHint.x
- value: 0
- objectReference: {fileID: 0}
- - target: {fileID: 2240881192534159605, guid: 973e30aed52df874a8a9b583c4cf06d6,
- type: 3}
- propertyPath: m_LocalEulerAnglesHint.y
- value: 0
- objectReference: {fileID: 0}
- - target: {fileID: 2240881192534159605, guid: 973e30aed52df874a8a9b583c4cf06d6,
- type: 3}
- propertyPath: m_LocalEulerAnglesHint.z
- value: 0
- objectReference: {fileID: 0}
- m_RemovedComponents: []
- m_RemovedGameObjects: []
- m_AddedGameObjects: []
- m_AddedComponents: []
- m_SourcePrefab: {fileID: 100100000, guid: 973e30aed52df874a8a9b583c4cf06d6, type: 3}
---- !u!4 &6147778203424681500 stripped
-Transform:
- m_CorrespondingSourceObject: {fileID: 2240881192534159605, guid: 973e30aed52df874a8a9b583c4cf06d6,
- type: 3}
- m_PrefabInstance: {fileID: 5352666860110110441}
- m_PrefabAsset: {fileID: 0}
diff --git a/MAEasySimulator/ProjectSettings/TagManager.asset b/MAEasySimulator/ProjectSettings/TagManager.asset
index 4e3f261..edb5f3e 100644
--- a/MAEasySimulator/ProjectSettings/TagManager.asset
+++ b/MAEasySimulator/ProjectSettings/TagManager.asset
@@ -8,6 +8,9 @@ TagManager:
- SOSArea
- Obstacle
- CommunicateTower
+ - Surpplier
+ - Spy
+ - Shelter
layers:
- Default
- TransparentFX