From 16ccc6ca68b2833a08f16fd9f53a6c526c5fd9f5 Mon Sep 17 00:00:00 2001 From: chenyulin Date: Thu, 13 Jun 2024 19:50:02 +0800 Subject: [PATCH] feat. add network and object manager --- Assets/Import/arrow.obj | 480 ++++++++++++++++++ Assets/Import/arrow.obj.meta | 107 ++++ Assets/Material/Mesh/BlueArrow.mat | 113 +++++ Assets/Material/Mesh/BlueArrow.mat.meta | 8 + Assets/Material/Mesh/BoxMesh.mat | 81 +++ Assets/Material/Mesh/BoxMesh.mat.meta | 8 + Assets/Material/Mesh/GreenArrow.mat | 113 +++++ Assets/Material/Mesh/GreenArrow.mat.meta | 8 + Assets/Material/Mesh/RedArrow.mat | 113 +++++ Assets/Material/Mesh/RedArrow.mat.meta | 8 + Assets/Prefab.meta | 8 + Assets/Prefab/ObjectFrame.prefab | 99 ++++ Assets/Prefab/ObjectFrame.prefab.meta | 7 + Assets/Scenes/SampleScene.unity | 443 +++++++++++++++- Assets/Script/Network/UdpSocket.cs | 135 +++++ Assets/Script/Network/UdpSocket.cs.meta | 11 + .../{Detection.meta => ObjectDetection.meta} | 0 .../Detector.cs | 0 .../Detector.cs.meta | 0 .../Extensions.cs | 0 .../Extensions.cs.meta | 0 .../HoloCanCapture.cs | 0 .../HoloCanCapture.cs.meta | 0 .../{Detection => ObjectDetection}/NN.meta | 0 .../NN/BarracudaUtils.cs | 0 .../NN/BarracudaUtils.cs.meta | 0 .../NN/DuplicatesSupressor.cs | 0 .../NN/DuplicatesSupressor.cs.meta | 0 .../NN/IntersectionOverUnion.cs | 0 .../NN/IntersectionOverUnion.cs.meta | 0 .../NN/NNHandler.cs | 0 .../NN/NNHandler.cs.meta | 0 .../NN/ResultBox.cs | 0 .../NN/ResultBox.cs.meta | 0 .../NN/YOLOv8.cs | 0 .../NN/YOLOv8.cs.meta | 0 .../NN/YOLOv8OutputReader.cs | 0 .../NN/YOLOv8OutputReader.cs.meta | 0 .../NN/YOLOv8SegmentationOutputReader.cs | 0 .../NN/YOLOv8SegmentationOutputReader.cs.meta | 0 .../TextToTexture.cs | 0 .../TextToTexture.cs.meta | 0 .../TextureProviders.meta | 0 .../TextureProviders/TextureProvider.cs | 0 .../TextureProviders/TextureProvider.cs.meta | 0 .../TextureProviders/VideoTextureProvider.cs | 0 .../VideoTextureProvider.cs.meta | 0 .../TextureProviders/WebCamTextureProvider.cs | 0 .../WebCamTextureProvider.cs.meta | 0 .../TextureTools.cs | 0 .../TextureTools.cs.meta | 0 Assets/Script/ObjectSpaceManager.cs | 93 ++++ Assets/Script/ObjectSpaceManager.cs.meta | 11 + Assets/Script/UI/ObjectFrame.cs | 48 ++ Assets/Script/UI/ObjectFrame.cs.meta | 11 + Assets/Shader.meta | 8 + Assets/Shader/CubeFrame.shader | 65 +++ Assets/Shader/CubeFrame.shader.meta | 10 + Assets/arrow.mtl | 10 + Assets/arrow.mtl.meta | 7 + 60 files changed, 1991 insertions(+), 14 deletions(-) create mode 100644 Assets/Import/arrow.obj create mode 100644 Assets/Import/arrow.obj.meta create mode 100644 Assets/Material/Mesh/BlueArrow.mat create mode 100644 Assets/Material/Mesh/BlueArrow.mat.meta create mode 100644 Assets/Material/Mesh/BoxMesh.mat create mode 100644 Assets/Material/Mesh/BoxMesh.mat.meta create mode 100644 Assets/Material/Mesh/GreenArrow.mat create mode 100644 Assets/Material/Mesh/GreenArrow.mat.meta create mode 100644 Assets/Material/Mesh/RedArrow.mat create mode 100644 Assets/Material/Mesh/RedArrow.mat.meta create mode 100644 Assets/Prefab.meta create mode 100644 Assets/Prefab/ObjectFrame.prefab create mode 100644 Assets/Prefab/ObjectFrame.prefab.meta create mode 100644 Assets/Script/Network/UdpSocket.cs create mode 100644 Assets/Script/Network/UdpSocket.cs.meta rename Assets/Script/{Detection.meta => ObjectDetection.meta} (100%) rename Assets/Script/{Detection => ObjectDetection}/Detector.cs (100%) rename Assets/Script/{Detection => ObjectDetection}/Detector.cs.meta (100%) rename Assets/Script/{Detection => ObjectDetection}/Extensions.cs (100%) rename Assets/Script/{Detection => ObjectDetection}/Extensions.cs.meta (100%) rename Assets/Script/{Detection => ObjectDetection}/HoloCanCapture.cs (100%) rename Assets/Script/{Detection => ObjectDetection}/HoloCanCapture.cs.meta (100%) rename Assets/Script/{Detection => ObjectDetection}/NN.meta (100%) rename Assets/Script/{Detection => ObjectDetection}/NN/BarracudaUtils.cs (100%) rename Assets/Script/{Detection => ObjectDetection}/NN/BarracudaUtils.cs.meta (100%) rename Assets/Script/{Detection => ObjectDetection}/NN/DuplicatesSupressor.cs (100%) rename Assets/Script/{Detection => ObjectDetection}/NN/DuplicatesSupressor.cs.meta (100%) rename Assets/Script/{Detection => ObjectDetection}/NN/IntersectionOverUnion.cs (100%) rename Assets/Script/{Detection => ObjectDetection}/NN/IntersectionOverUnion.cs.meta (100%) rename Assets/Script/{Detection => ObjectDetection}/NN/NNHandler.cs (100%) rename Assets/Script/{Detection => ObjectDetection}/NN/NNHandler.cs.meta (100%) rename Assets/Script/{Detection => ObjectDetection}/NN/ResultBox.cs (100%) rename Assets/Script/{Detection => ObjectDetection}/NN/ResultBox.cs.meta (100%) rename Assets/Script/{Detection => ObjectDetection}/NN/YOLOv8.cs (100%) rename Assets/Script/{Detection => ObjectDetection}/NN/YOLOv8.cs.meta (100%) rename Assets/Script/{Detection => ObjectDetection}/NN/YOLOv8OutputReader.cs (100%) rename Assets/Script/{Detection => ObjectDetection}/NN/YOLOv8OutputReader.cs.meta (100%) rename Assets/Script/{Detection => ObjectDetection}/NN/YOLOv8SegmentationOutputReader.cs (100%) rename Assets/Script/{Detection => ObjectDetection}/NN/YOLOv8SegmentationOutputReader.cs.meta (100%) rename Assets/Script/{Detection => ObjectDetection}/TextToTexture.cs (100%) rename Assets/Script/{Detection => ObjectDetection}/TextToTexture.cs.meta (100%) rename Assets/Script/{Detection => ObjectDetection}/TextureProviders.meta (100%) rename Assets/Script/{Detection => ObjectDetection}/TextureProviders/TextureProvider.cs (100%) rename Assets/Script/{Detection => ObjectDetection}/TextureProviders/TextureProvider.cs.meta (100%) rename Assets/Script/{Detection => ObjectDetection}/TextureProviders/VideoTextureProvider.cs (100%) rename Assets/Script/{Detection => ObjectDetection}/TextureProviders/VideoTextureProvider.cs.meta (100%) rename Assets/Script/{Detection => ObjectDetection}/TextureProviders/WebCamTextureProvider.cs (100%) rename Assets/Script/{Detection => ObjectDetection}/TextureProviders/WebCamTextureProvider.cs.meta (100%) rename Assets/Script/{Detection => ObjectDetection}/TextureTools.cs (100%) rename Assets/Script/{Detection => ObjectDetection}/TextureTools.cs.meta (100%) create mode 100644 Assets/Script/ObjectSpaceManager.cs create mode 100644 Assets/Script/ObjectSpaceManager.cs.meta create mode 100644 Assets/Script/UI/ObjectFrame.cs create mode 100644 Assets/Script/UI/ObjectFrame.cs.meta create mode 100644 Assets/Shader.meta create mode 100644 Assets/Shader/CubeFrame.shader create mode 100644 Assets/Shader/CubeFrame.shader.meta create mode 100644 Assets/arrow.mtl create mode 100644 Assets/arrow.mtl.meta diff --git a/Assets/Import/arrow.obj b/Assets/Import/arrow.obj new file mode 100644 index 0000000..f663851 --- /dev/null +++ b/Assets/Import/arrow.obj @@ -0,0 +1,480 @@ +# Blender v2.93.5 OBJ File: '' +# www.blender.org +mtllib arrow.mtl +o 柱体 +v 0.000000 0.001740 -0.050000 +v -0.000000 1.001740 -0.112012 +v 0.009755 0.001740 -0.049039 +v 0.022892 0.001740 -0.044695 +v 0.034536 1.001764 -0.107054 +v 0.035355 0.001740 -0.035355 +v 0.071255 1.001757 -0.086824 +v 0.041573 0.001740 -0.027779 +v 0.093135 1.001740 -0.062231 +v 0.046194 0.001740 -0.019134 +v 0.049039 0.001740 -0.009755 +v 0.107483 1.001757 -0.032605 +v 0.050053 0.001740 0.004045 +v 0.112120 1.001768 0.009061 +v 0.046194 0.001740 0.019134 +v 0.103486 1.001740 0.042865 +v 0.041573 0.001740 0.027779 +v 0.035355 0.001740 0.035355 +v 0.086823 1.001760 0.071254 +v 0.027779 0.001740 0.041573 +v 0.019134 0.001740 0.046194 +v 0.053122 1.001765 0.099384 +v 0.009755 0.001740 0.049039 +v -0.000000 0.001740 0.050000 +v 0.009061 1.001768 0.112120 +v -0.009755 0.001740 0.049039 +v -0.019134 0.001740 0.046194 +v -0.034536 1.001764 0.107054 +v -0.031171 0.001740 0.039370 +v -0.062231 1.001740 0.093135 +v -0.041573 0.001740 0.027779 +v -0.086822 1.001764 0.071253 +v -0.046194 0.001740 0.019134 +v -0.103486 1.001740 0.042865 +v -0.049039 0.001740 0.009755 +v -0.050000 0.001740 -0.000000 +v -0.112122 1.001764 0.009061 +v -0.049039 0.001740 -0.009755 +v -0.046194 0.001740 -0.019134 +v -0.107054 1.001764 -0.034536 +v -0.041573 0.001740 -0.027779 +v -0.093135 1.001740 -0.062231 +v -0.035355 0.001740 -0.035355 +v -0.027779 0.001740 -0.041573 +v -0.069824 1.001768 -0.088190 +v -0.019134 0.001740 -0.046194 +v -0.009755 0.001740 -0.049039 +v -0.032604 1.001760 -0.107482 +v 0.009755 1.001740 -0.049039 +v 0.000000 1.001740 -0.050000 +v 0.019134 1.001740 -0.046194 +v 0.027779 1.001740 -0.041573 +v 0.035355 1.001740 -0.035355 +v 0.044695 1.001740 -0.022892 +v 0.049039 1.001740 -0.009755 +v 0.050000 1.001740 0.000000 +v 0.049039 1.001740 0.009755 +v 0.046194 1.001740 0.019134 +v 0.041573 1.001740 0.027779 +v 0.035355 1.001740 0.035355 +v 0.027779 1.001740 0.041573 +v 0.019134 1.001740 0.046194 +v 0.009755 1.001740 0.049039 +v -0.005798 1.001740 0.049880 +v -0.019134 1.001740 0.046194 +v -0.027779 1.001740 0.041573 +v -0.035355 1.001740 0.035355 +v -0.041573 1.001740 0.027779 +v -0.046194 1.001740 0.019134 +v -0.049039 1.001740 0.009755 +v -0.050000 1.001740 -0.000000 +v -0.049039 1.001740 -0.009755 +v -0.043865 1.001740 -0.024445 +v -0.035355 1.001740 -0.035355 +v -0.027779 1.001740 -0.041573 +v -0.019134 1.001740 -0.046194 +v -0.009755 1.001740 -0.049039 +v 0.000895 1.276776 -0.000209 +v -0.001012 1.276544 0.000236 +vt 1.000000 1.000000 +vt 0.968750 0.500000 +vt 1.000000 0.500000 +vt 0.968750 1.000000 +vt 0.924683 0.500000 +vt 0.906250 1.000000 +vt 0.875000 0.500000 +vt 0.875000 1.000000 +vt 0.843750 0.500000 +vt 0.825317 1.000000 +vt 0.812500 0.500000 +vt 0.781250 0.500000 +vt 0.781250 1.000000 +vt 0.737183 0.500000 +vt 0.718750 1.000000 +vt 0.687500 0.500000 +vt 0.687500 1.000000 +vt 0.656250 0.500000 +vt 0.656250 1.000000 +vt 0.625000 0.500000 +vt 0.625000 1.000000 +vt 0.593750 0.500000 +vt 0.593750 1.000000 +vt 0.562500 0.500000 +vt 0.562500 1.000000 +vt 0.531250 0.500000 +vt 0.531250 1.000000 +vt 0.500000 0.500000 +vt 0.481567 1.000000 +vt 0.468750 0.500000 +vt 0.437500 0.500000 +vt 0.437500 1.000000 +vt 0.393433 0.500000 +vt 0.375000 1.000000 +vt 0.343750 0.500000 +vt 0.343750 1.000000 +vt 0.312500 0.500000 +vt 0.312500 1.000000 +vt 0.281250 0.500000 +vt 0.281250 1.000000 +vt 0.250000 0.500000 +vt 0.250000 1.000000 +vt 0.218750 0.500000 +vt 0.218750 1.000000 +vt 0.187500 0.500000 +vt 0.169067 1.000000 +vt 0.156250 0.500000 +vt 0.125000 0.500000 +vt 0.125000 1.000000 +vt 0.093750 0.500000 +vt 0.093750 1.000000 +vt 0.062500 0.500000 +vt 0.062500 1.000000 +vt 0.031250 0.500000 +vt 0.031250 1.000000 +vt 0.000000 0.500000 +vt 0.985388 0.296822 +vt 0.796822 0.014612 +vt 0.514612 0.203178 +vt 0.314292 0.449183 +vt 0.250000 0.490000 +vt 0.250000 0.460282 +vt 0.382759 0.411767 +vt 0.341844 0.471731 +vt 0.462634 0.358863 +vt 0.419706 0.419706 +vt 0.450258 0.310748 +vt 0.424843 0.366826 +vt 0.490000 0.250000 +vt 0.485388 0.296822 +vt 0.444275 0.169529 +vt 0.485388 0.203178 +vt 0.458625 0.233173 +vt 0.411767 0.117241 +vt 0.471731 0.158156 +vt 0.348649 0.065441 +vt 0.419706 0.080294 +vt 0.296822 0.014612 +vt 0.341844 0.028269 +vt 0.185708 0.050817 +vt 0.222382 0.012720 +vt 0.266827 0.041375 +vt 0.133174 0.075157 +vt 0.158156 0.028269 +vt 0.080294 0.080294 +vt 0.116663 0.050447 +vt 0.088232 0.117241 +vt 0.050447 0.116663 +vt 0.055725 0.169529 +vt 0.041375 0.233173 +vt 0.028269 0.158156 +vt 0.050817 0.314292 +vt 0.010000 0.250000 +vt 0.041351 0.366318 +vt 0.014612 0.296822 +vt 0.075157 0.366826 +vt 0.080294 0.419706 +vt 0.189252 0.450258 +vt 0.116663 0.449553 +vt 0.120104 0.414117 +vt 0.203178 0.485388 +vt 0.158156 0.471731 +vt 0.110254 0.217988 +vt 0.371030 0.281199 +vt 0.937500 1.000000 +vt 0.750000 1.000000 +vt 0.406250 1.000000 +vt 0.000000 1.000000 +vt 0.703178 0.485388 +vt 0.750000 0.490000 +vt 0.796822 0.485388 +vt 0.858863 0.462634 +vt 0.919706 0.419706 +vt 0.949553 0.383337 +vt 0.971731 0.341844 +vt 0.988109 0.230796 +vt 0.971731 0.158156 +vt 0.949553 0.116663 +vt 0.919706 0.080294 +vt 0.883337 0.050447 +vt 0.841844 0.028269 +vt 0.750000 0.010000 +vt 0.703178 0.014612 +vt 0.658156 0.028269 +vt 0.601746 0.062689 +vt 0.550447 0.116663 +vt 0.528269 0.158156 +vt 0.510000 0.250000 +vt 0.514612 0.296822 +vt 0.528269 0.341844 +vt 0.550447 0.383337 +vt 0.580294 0.419706 +vt 0.616663 0.449553 +vt 0.658156 0.471731 +vt 0.296822 0.485388 +vt 0.383337 0.449553 +vt 0.449553 0.116663 +vt 0.383337 0.050447 +vt 0.014612 0.203178 +vn 0.0980 0.0000 -0.9952 +vn 0.3140 0.0000 -0.9494 +vn 0.5997 -0.0004 -0.8002 +vn 0.7730 0.0000 -0.6344 +vn 0.8819 -0.0004 -0.4714 +vn 0.9569 0.0003 -0.2903 +vn 0.9973 0.0000 -0.0733 +vn 0.9688 -0.0004 0.2478 +vn 0.8819 0.0000 0.4714 +vn 0.7730 0.0000 0.6344 +vn 0.6344 0.0000 0.7730 +vn 0.4714 0.0000 0.8819 +vn 0.2903 0.0000 0.9569 +vn 0.0980 0.0000 0.9952 +vn -0.0980 -0.0004 0.9952 +vn -0.2903 0.0003 0.9569 +vn -0.4932 0.0000 0.8699 +vn -0.7443 -0.0004 0.6679 +vn -0.8819 0.0000 0.4714 +vn -0.9569 0.0000 0.2903 +vn -0.9952 0.0000 0.0980 +vn -0.9952 0.0000 -0.0980 +vn -0.9569 0.0000 -0.2903 +vn -0.8819 -0.0004 -0.4714 +vn -0.7730 0.0003 -0.6344 +vn -0.6344 0.0000 -0.7730 +vn -0.4714 0.0000 -0.8819 +vn -0.2903 0.0000 -0.9569 +vn -0.0980 0.0000 -0.9952 +vn 0.0000 -1.0000 -0.0000 +vn 0.0007 -1.0000 -0.0000 +vn 0.0000 -1.0000 -0.0004 +vn 0.0002 -1.0000 -0.0002 +vn 0.0003 -1.0000 0.0004 +vn 0.0003 -1.0000 -0.0000 +vn 0.0004 -1.0000 -0.0007 +vn -0.0002 -1.0000 0.0006 +vn 0.0001 -1.0000 0.0003 +vn 0.0001 -1.0000 0.0004 +vn 0.0006 -1.0000 0.0005 +vn -0.0003 -1.0000 0.0002 +vn 0.0002 -1.0000 0.0007 +vn -0.0003 -1.0000 -0.0006 +vn -0.0004 -1.0000 -0.0000 +vn -0.0003 -1.0000 -0.0001 +vn -0.0005 -1.0000 0.0006 +vn -0.0004 -1.0000 -0.0003 +vn -0.0001 -1.0000 -0.0003 +vn -0.0006 -1.0000 -0.0001 +vn -0.8996 0.3712 0.2301 +vn 0.8006 0.3722 0.4696 +vn -0.9229 0.3697 -0.1073 +vn -0.8290 0.3727 -0.4170 +vn 0.1316 0.3729 -0.9185 +vn -0.6907 0.3724 -0.6198 +vn 0.2578 0.3719 0.8918 +vn 0.4482 0.3708 -0.8134 +vn -0.4271 0.3722 -0.8241 +vn -0.1072 0.3716 0.9222 +vn -0.4169 0.3731 0.8289 +vn 0.8355 0.3715 -0.4049 +vn -0.6169 0.3719 0.6937 +vn 0.2903 -0.0003 -0.9569 +vn 0.4714 0.0004 -0.8819 +vn 0.6344 0.0000 -0.7730 +vn 0.8002 0.0004 -0.5997 +vn 0.9494 0.0000 -0.3140 +vn 0.9952 -0.0003 -0.0980 +vn 0.9952 0.0004 0.0980 +vn 0.9569 0.0000 0.2903 +vn 0.0540 0.0004 0.9985 +vn -0.2664 0.0000 0.9639 +vn -0.4714 -0.0003 0.8819 +vn -0.6344 0.0004 0.7730 +vn -0.7730 0.0000 0.6344 +vn -0.9432 0.0004 -0.3322 +vn -0.7885 0.0000 -0.6150 +vn 0.0001 -1.0000 -0.0004 +vn 0.0001 -1.0000 -0.0003 +vn -0.0003 -1.0000 -0.0004 +vn 0.0003 -1.0000 -0.0001 +vn 0.0004 -1.0000 0.0002 +vn 0.0004 -1.0000 0.0000 +vn 0.0003 -1.0000 0.0001 +vn 0.0002 -1.0000 0.0002 +vn 0.0003 -1.0000 0.0003 +vn 0.0002 -1.0000 0.0003 +vn 0.0000 -1.0000 0.0004 +vn -0.0001 -1.0000 0.0004 +vn -0.0007 -1.0000 -0.0003 +vn -0.0004 -1.0000 0.0001 +vn 0.0003 -1.0000 -0.0007 +vn -0.0003 -1.0000 -0.0003 +vn -0.0002 -1.0000 -0.0003 +vn 0.9233 0.3700 -0.1029 +vn -0.8008 0.3715 0.4698 +vn 0.8995 0.3715 0.2300 +vn 0.5951 0.3712 0.7128 +vn 0.1666 0.3771 0.9111 +vn -0.2537 0.3782 -0.8903 +vn 0.6937 0.3718 -0.6169 +vn -0.1274 0.3739 -0.9187 +usemtl None +s off +f 50/1/1 3/2/1 1/3/1 +f 49/4/2 4/5/2 3/2/2 +f 52/6/3 6/7/3 4/5/3 +f 53/8/4 8/9/4 6/7/4 +f 54/10/5 10/11/5 8/9/5 +f 54/10/6 11/12/6 10/11/6 +f 55/13/7 13/14/7 11/12/7 +f 57/15/8 15/16/8 13/14/8 +f 58/17/9 17/18/9 15/16/9 +f 59/19/10 18/20/10 17/18/10 +f 60/21/11 20/22/11 18/20/11 +f 61/23/12 21/24/12 20/22/12 +f 62/25/13 23/26/13 21/24/13 +f 63/27/14 24/28/14 23/26/14 +f 64/29/15 26/30/15 24/28/15 +f 64/29/16 27/31/16 26/30/16 +f 65/32/17 29/33/17 27/31/17 +f 67/34/18 31/35/18 29/33/18 +f 68/36/19 33/37/19 31/35/19 +f 69/38/20 35/39/20 33/37/20 +f 70/40/21 36/41/21 35/39/21 +f 71/42/22 38/43/22 36/41/22 +f 72/44/23 39/45/23 38/43/23 +f 73/46/24 41/47/24 39/45/24 +f 73/46/25 43/48/25 41/47/25 +f 74/49/26 44/50/26 43/48/26 +f 75/51/27 46/52/27 44/50/27 +f 76/53/28 47/54/28 46/52/28 +f 77/55/29 1/56/29 47/54/29 +f 11/57/30 23/58/30 35/59/30 +f 5/60/31 50/61/31 2/62/31 +f 7/63/32 51/64/32 5/60/32 +f 7/63/33 54/65/33 53/66/33 +f 12/67/34 54/65/34 9/68/34 +f 12/67/35 56/69/35 55/70/35 +f 16/71/36 57/72/36 14/73/36 +f 19/74/37 58/75/37 16/71/37 +f 22/76/38 60/77/38 19/74/38 +f 22/76/39 63/78/39 62/79/39 +f 28/80/39 64/81/39 25/82/39 +f 30/83/40 65/84/40 28/80/40 +f 30/83/30 67/85/30 66/86/30 +f 32/87/41 68/88/41 67/85/41 +f 34/89/42 68/88/42 32/87/42 +f 37/90/43 69/91/43 34/89/43 +f 40/92/44 71/93/44 37/90/44 +f 40/92/45 73/94/45 72/95/45 +f 42/96/46 73/94/46 40/92/46 +f 42/96/30 74/97/30 73/94/30 +f 48/98/47 75/99/47 45/100/47 +f 48/98/48 77/101/48 76/102/48 +f 2/62/49 77/101/49 48/98/49 +f 34/89/50 79/103/50 37/90/50 +f 16/71/51 78/104/51 19/74/51 +f 37/90/52 79/103/52 40/92/52 +f 40/92/53 79/103/53 42/96/53 +f 2/62/54 78/104/54 5/60/54 +f 42/96/55 79/103/55 45/100/55 +f 22/76/56 78/104/56 25/82/56 +f 5/60/57 78/104/57 7/63/57 +f 45/100/58 79/103/58 48/98/58 +f 25/82/59 79/103/59 28/80/59 +f 28/80/60 79/103/60 30/83/60 +f 9/68/61 78/104/61 12/67/61 +f 30/83/62 79/103/62 32/87/62 +f 50/1/1 49/4/1 3/2/1 +f 49/4/63 51/105/63 4/5/63 +f 51/105/64 52/6/64 4/5/64 +f 52/6/65 53/8/65 6/7/65 +f 53/8/66 54/10/66 8/9/66 +f 54/10/67 55/13/67 11/12/67 +f 55/13/68 56/106/68 13/14/68 +f 56/106/69 57/15/69 13/14/69 +f 57/15/70 58/17/70 15/16/70 +f 58/17/9 59/19/9 17/18/9 +f 59/19/10 60/21/10 18/20/10 +f 60/21/11 61/23/11 20/22/11 +f 61/23/12 62/25/12 21/24/12 +f 62/25/13 63/27/13 23/26/13 +f 63/27/71 64/29/71 24/28/71 +f 64/29/72 65/32/72 27/31/72 +f 65/32/73 66/107/73 29/33/73 +f 66/107/74 67/34/74 29/33/74 +f 67/34/75 68/36/75 31/35/75 +f 68/36/19 69/38/19 33/37/19 +f 69/38/20 70/40/20 35/39/20 +f 70/40/21 71/42/21 36/41/21 +f 71/42/22 72/44/22 38/43/22 +f 72/44/76 73/46/76 39/45/76 +f 73/46/77 74/49/77 43/48/77 +f 74/49/26 75/51/26 44/50/26 +f 75/51/27 76/53/27 46/52/27 +f 76/53/28 77/55/28 47/54/28 +f 77/55/29 50/108/29 1/56/29 +f 47/109/30 1/110/30 3/111/30 +f 4/112/30 6/113/30 8/114/30 +f 8/114/30 10/115/30 11/57/30 +f 13/116/30 15/117/30 17/118/30 +f 17/118/30 18/119/30 20/120/30 +f 20/120/30 21/121/30 23/58/30 +f 23/58/30 24/122/30 26/123/30 +f 26/123/30 27/124/30 29/125/30 +f 31/126/30 33/127/30 35/59/30 +f 35/59/30 36/128/30 38/129/30 +f 38/129/30 39/130/30 35/59/30 +f 39/130/30 41/131/30 35/59/30 +f 41/131/30 43/132/30 44/133/30 +f 44/133/30 46/134/30 41/131/30 +f 46/134/30 47/109/30 41/131/30 +f 47/109/30 3/111/30 11/57/30 +f 3/111/30 4/112/30 11/57/30 +f 4/112/30 8/114/30 11/57/30 +f 11/57/30 13/116/30 17/118/30 +f 17/118/30 20/120/30 11/57/30 +f 20/120/30 23/58/30 11/57/30 +f 23/58/30 26/123/30 35/59/30 +f 26/123/30 29/125/30 35/59/30 +f 29/125/30 31/126/30 35/59/30 +f 35/59/30 41/131/30 47/109/30 +f 47/109/30 11/57/30 35/59/30 +f 5/60/32 49/135/32 50/61/32 +f 5/60/78 51/64/78 49/135/78 +f 7/63/79 52/136/79 51/64/79 +f 7/63/33 53/66/33 52/136/33 +f 7/63/80 9/68/80 54/65/80 +f 12/67/81 55/70/81 54/65/81 +f 12/67/82 14/73/82 56/69/82 +f 14/73/83 57/72/83 56/69/83 +f 16/71/30 58/75/30 57/72/30 +f 19/74/84 59/137/84 58/75/84 +f 19/74/85 60/77/85 59/137/85 +f 22/76/86 61/138/86 60/77/86 +f 22/76/87 62/79/87 61/138/87 +f 22/76/88 25/82/88 63/78/88 +f 25/82/88 64/81/88 63/78/88 +f 28/80/89 65/84/89 64/81/89 +f 30/83/30 66/86/30 65/84/30 +f 30/83/90 32/87/90 67/85/90 +f 34/89/30 69/91/30 68/88/30 +f 37/90/91 70/139/91 69/91/91 +f 37/90/44 71/93/44 70/139/44 +f 40/92/44 72/95/44 71/93/44 +f 42/96/92 45/100/92 74/97/92 +f 45/100/93 75/99/93 74/97/93 +f 48/98/94 76/102/94 75/99/94 +f 2/62/30 50/61/30 77/101/30 +f 14/73/95 12/67/95 78/104/95 +f 34/89/96 32/87/96 79/103/96 +f 16/71/97 14/73/97 78/104/97 +f 22/76/98 19/74/98 78/104/98 +f 25/82/99 78/104/99 79/103/99 +f 48/98/100 79/103/100 78/104/100 +f 9/68/101 7/63/101 78/104/101 +f 2/62/102 48/98/102 78/104/102 diff --git a/Assets/Import/arrow.obj.meta b/Assets/Import/arrow.obj.meta new file mode 100644 index 0000000..0f7405f --- /dev/null +++ b/Assets/Import/arrow.obj.meta @@ -0,0 +1,107 @@ +fileFormatVersion: 2 +guid: 510bb89745d42fb4cb16ba244be23d86 +ModelImporter: + serializedVersion: 21300 + internalIDToNameTable: [] + externalObjects: {} + materials: + materialImportMode: 2 + materialName: 0 + materialSearch: 1 + materialLocation: 1 + animations: + legacyGenerateAnimations: 4 + bakeSimulation: 0 + resampleCurves: 1 + optimizeGameObjects: 0 + removeConstantScaleCurves: 1 + motionNodeName: + rigImportErrors: + rigImportWarnings: + animationImportErrors: + animationImportWarnings: + animationRetargetingWarnings: + animationDoRetargetingWarnings: 0 + importAnimatedCustomProperties: 0 + importConstraints: 0 + animationCompression: 1 + animationRotationError: 0.5 + animationPositionError: 0.5 + animationScaleError: 0.5 + animationWrapMode: 0 + extraExposedTransformPaths: [] + extraUserProperties: [] + clipAnimations: [] + isReadable: 0 + meshes: + lODScreenPercentages: [] + globalScale: 1 + meshCompression: 0 + addColliders: 0 + useSRGBMaterialColor: 1 + sortHierarchyByName: 1 + importVisibility: 1 + importBlendShapes: 1 + importCameras: 1 + importLights: 1 + nodeNameCollisionStrategy: 1 + fileIdsGeneration: 2 + swapUVChannels: 0 + generateSecondaryUV: 0 + useFileUnits: 1 + keepQuads: 0 + weldVertices: 1 + bakeAxisConversion: 0 + preserveHierarchy: 0 + skinWeightsMode: 0 + maxBonesPerVertex: 4 + minBoneWeight: 0.001 + optimizeBones: 1 + meshOptimizationFlags: -1 + indexFormat: 0 + secondaryUVAngleDistortion: 8 + secondaryUVAreaDistortion: 15.000001 + secondaryUVHardAngle: 88 + secondaryUVMarginMethod: 1 + secondaryUVMinLightmapResolution: 40 + secondaryUVMinObjectScale: 1 + secondaryUVPackMargin: 4 + useFileScale: 1 + strictVertexDataChecks: 0 + tangentSpace: + normalSmoothAngle: 60 + normalImportMode: 0 + tangentImportMode: 3 + normalCalculationMode: 4 + legacyComputeAllNormalsFromSmoothingGroupsWhenMeshHasBlendShapes: 0 + blendShapeNormalImportMode: 1 + normalSmoothingSource: 0 + referencedClips: [] + importAnimation: 1 + humanDescription: + serializedVersion: 3 + human: [] + skeleton: [] + armTwist: 0.5 + foreArmTwist: 0.5 + upperLegTwist: 0.5 + legTwist: 0.5 + armStretch: 0.05 + legStretch: 0.05 + feetSpacing: 0 + globalScale: 1 + rootMotionBoneName: + hasTranslationDoF: 0 + hasExtraRoot: 0 + skeletonHasParents: 1 + lastHumanDescriptionAvatarSource: {instanceID: 0} + autoGenerateAvatarMappingIfUnspecified: 1 + animationType: 2 + humanoidOversampling: 1 + avatarSetup: 0 + addHumanoidExtraRootOnlyWhenUsingAvatar: 1 + remapMaterialsIfMaterialImportModeIsNone: 0 + additionalBone: 0 + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Material/Mesh/BlueArrow.mat b/Assets/Material/Mesh/BlueArrow.mat new file mode 100644 index 0000000..32f723f --- /dev/null +++ b/Assets/Material/Mesh/BlueArrow.mat @@ -0,0 +1,113 @@ +%YAML 1.1 +%TAG !u! tag:unity3d.com,2011: +--- !u!21 &2100000 +Material: + serializedVersion: 8 + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_Name: BlueArrow + m_Shader: {fileID: 211, guid: 0000000000000000f000000000000000, type: 0} + m_ValidKeywords: [] + m_InvalidKeywords: [] + m_LightmapFlags: 0 + m_EnableInstancingVariants: 0 + m_DoubleSidedGI: 0 + m_CustomRenderQueue: -1 + stringTagMap: {} + disabledShaderPasses: + - GRABPASS + m_SavedProperties: + serializedVersion: 3 + m_TexEnvs: + - _BumpMap: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _DetailAlbedoMap: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _DetailMask: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _DetailNormalMap: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _EmissionMap: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _MainBump: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _MainTex: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _MetallicGlossMap: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _OcclusionMap: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _ParallaxMap: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + m_Ints: [] + m_Floats: + - _BlendOp: 0 + - _BumpScale: 1 + - _CameraFadingEnabled: 0 + - _CameraFarFadeDistance: 2 + - _CameraNearFadeDistance: 1 + - _ColorMask: 15 + - _ColorMode: 0 + - _Cull: 2 + - _Cutoff: 0.5 + - _DetailNormalMapScale: 1 + - _DistortionBlend: 0.5 + - _DistortionEnabled: 0 + - _DistortionStrength: 1 + - _DistortionStrengthScaled: 0 + - _DstBlend: 0 + - _EmissionEnabled: 0 + - _FlipbookMode: 0 + - _GlossMapScale: 1 + - _Glossiness: 0.5 + - _GlossyReflections: 1 + - _LightingEnabled: 0 + - _Metallic: 0 + - _Mode: 0 + - _OcclusionStrength: 1 + - _Parallax: 0.02 + - _Shininess: 0.2 + - _SmoothnessTextureChannel: 0 + - _SoftParticlesEnabled: 0 + - _SoftParticlesFarFadeDistance: 1 + - _SoftParticlesNearFadeDistance: 0 + - _SpecularHighlights: 1 + - _SrcBlend: 1 + - _Stencil: 0 + - _StencilComp: 8 + - _StencilOp: 0 + - _StencilReadMask: 255 + - _StencilWriteMask: 255 + - _UVSec: 0 + - _UseUIAlphaClip: 0 + - _ZWrite: 1 + m_Colors: + - _CameraFadeParams: {r: 0, g: Infinity, b: 0, a: 0} + - _Color: {r: 0.0046520233, g: 0, b: 1, a: 1} + - _ColorAddSubDiff: {r: 0, g: 0, b: 0, a: 0} + - _EmissionColor: {r: 0, g: 0, b: 0, a: 1} + - _SoftParticleFadeParams: {r: 0, g: 0, b: 0, a: 0} + - _Specular: {r: 0, g: 0, b: 0, a: 0} + m_BuildTextureStacks: [] diff --git a/Assets/Material/Mesh/BlueArrow.mat.meta b/Assets/Material/Mesh/BlueArrow.mat.meta new file mode 100644 index 0000000..2f53779 --- /dev/null +++ b/Assets/Material/Mesh/BlueArrow.mat.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 934e5f9f94a057d42a91db054e114e4d +NativeFormatImporter: + externalObjects: {} + mainObjectFileID: 2100000 + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Material/Mesh/BoxMesh.mat b/Assets/Material/Mesh/BoxMesh.mat new file mode 100644 index 0000000..0dbc654 --- /dev/null +++ b/Assets/Material/Mesh/BoxMesh.mat @@ -0,0 +1,81 @@ +%YAML 1.1 +%TAG !u! tag:unity3d.com,2011: +--- !u!21 &2100000 +Material: + serializedVersion: 8 + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_Name: BoxMesh + m_Shader: {fileID: 4800000, guid: be14aa99895eb62478790277ada5f6a8, type: 3} + m_ValidKeywords: [] + m_InvalidKeywords: [] + m_LightmapFlags: 4 + m_EnableInstancingVariants: 0 + m_DoubleSidedGI: 0 + m_CustomRenderQueue: -1 + stringTagMap: {} + disabledShaderPasses: [] + m_SavedProperties: + serializedVersion: 3 + m_TexEnvs: + - _BumpMap: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _DetailAlbedoMap: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _DetailMask: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _DetailNormalMap: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _EmissionMap: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _MainTex: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _MetallicGlossMap: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _OcclusionMap: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _ParallaxMap: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + m_Ints: [] + m_Floats: + - _BumpScale: 1 + - _Cutoff: 0.5 + - _DetailNormalMapScale: 1 + - _DstBlend: 0 + - _GlossMapScale: 1 + - _Glossiness: 0.5 + - _GlossyReflections: 1 + - _Metallic: 0 + - _Mode: 0 + - _OcclusionStrength: 1 + - _Parallax: 0.02 + - _SmoothnessTextureChannel: 0 + - _SpecularHighlights: 1 + - _SrcBlend: 1 + - _UVSec: 0 + - _Width: 0.05 + - _ZWrite: 1 + m_Colors: + - _Color: {r: 0, g: 1, b: 0.8586402, a: 1} + - _EmissionColor: {r: 0, g: 0, b: 0, a: 1} + m_BuildTextureStacks: [] diff --git a/Assets/Material/Mesh/BoxMesh.mat.meta b/Assets/Material/Mesh/BoxMesh.mat.meta new file mode 100644 index 0000000..51a35fb --- /dev/null +++ b/Assets/Material/Mesh/BoxMesh.mat.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: c7d413f358d5beb489909afd879d05de +NativeFormatImporter: + externalObjects: {} + mainObjectFileID: 2100000 + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Material/Mesh/GreenArrow.mat b/Assets/Material/Mesh/GreenArrow.mat new file mode 100644 index 0000000..c6d8595 --- /dev/null +++ b/Assets/Material/Mesh/GreenArrow.mat @@ -0,0 +1,113 @@ +%YAML 1.1 +%TAG !u! tag:unity3d.com,2011: +--- !u!21 &2100000 +Material: + serializedVersion: 8 + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_Name: GreenArrow + m_Shader: {fileID: 211, guid: 0000000000000000f000000000000000, type: 0} + m_ValidKeywords: [] + m_InvalidKeywords: [] + m_LightmapFlags: 0 + m_EnableInstancingVariants: 0 + m_DoubleSidedGI: 0 + m_CustomRenderQueue: -1 + stringTagMap: {} + disabledShaderPasses: + - GRABPASS + m_SavedProperties: + serializedVersion: 3 + m_TexEnvs: + - _BumpMap: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _DetailAlbedoMap: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _DetailMask: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _DetailNormalMap: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _EmissionMap: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _MainBump: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _MainTex: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _MetallicGlossMap: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _OcclusionMap: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _ParallaxMap: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + m_Ints: [] + m_Floats: + - _BlendOp: 0 + - _BumpScale: 1 + - _CameraFadingEnabled: 0 + - _CameraFarFadeDistance: 2 + - _CameraNearFadeDistance: 1 + - _ColorMask: 15 + - _ColorMode: 0 + - _Cull: 2 + - _Cutoff: 0.5 + - _DetailNormalMapScale: 1 + - _DistortionBlend: 0.5 + - _DistortionEnabled: 0 + - _DistortionStrength: 1 + - _DistortionStrengthScaled: 0 + - _DstBlend: 0 + - _EmissionEnabled: 0 + - _FlipbookMode: 0 + - _GlossMapScale: 1 + - _Glossiness: 0.5 + - _GlossyReflections: 1 + - _LightingEnabled: 0 + - _Metallic: 0 + - _Mode: 0 + - _OcclusionStrength: 1 + - _Parallax: 0.02 + - _Shininess: 0.2 + - _SmoothnessTextureChannel: 0 + - _SoftParticlesEnabled: 0 + - _SoftParticlesFarFadeDistance: 1 + - _SoftParticlesNearFadeDistance: 0 + - _SpecularHighlights: 1 + - _SrcBlend: 1 + - _Stencil: 0 + - _StencilComp: 8 + - _StencilOp: 0 + - _StencilReadMask: 255 + - _StencilWriteMask: 255 + - _UVSec: 0 + - _UseUIAlphaClip: 0 + - _ZWrite: 1 + m_Colors: + - _CameraFadeParams: {r: 0, g: Infinity, b: 0, a: 0} + - _Color: {r: 0, g: 1, b: 0.042042732, a: 1} + - _ColorAddSubDiff: {r: 0, g: 0, b: 0, a: 0} + - _EmissionColor: {r: 0, g: 0, b: 0, a: 1} + - _SoftParticleFadeParams: {r: 0, g: 0, b: 0, a: 0} + - _Specular: {r: 0, g: 0, b: 0, a: 0} + m_BuildTextureStacks: [] diff --git a/Assets/Material/Mesh/GreenArrow.mat.meta b/Assets/Material/Mesh/GreenArrow.mat.meta new file mode 100644 index 0000000..930c49b --- /dev/null +++ b/Assets/Material/Mesh/GreenArrow.mat.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 53bab39c0c620204396a09ac301ed92d +NativeFormatImporter: + externalObjects: {} + mainObjectFileID: 2100000 + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Material/Mesh/RedArrow.mat b/Assets/Material/Mesh/RedArrow.mat new file mode 100644 index 0000000..ab0f33d --- /dev/null +++ b/Assets/Material/Mesh/RedArrow.mat @@ -0,0 +1,113 @@ +%YAML 1.1 +%TAG !u! tag:unity3d.com,2011: +--- !u!21 &2100000 +Material: + serializedVersion: 8 + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_Name: RedArrow + m_Shader: {fileID: 211, guid: 0000000000000000f000000000000000, type: 0} + m_ValidKeywords: [] + m_InvalidKeywords: [] + m_LightmapFlags: 0 + m_EnableInstancingVariants: 0 + m_DoubleSidedGI: 0 + m_CustomRenderQueue: -1 + stringTagMap: {} + disabledShaderPasses: + - GRABPASS + m_SavedProperties: + serializedVersion: 3 + m_TexEnvs: + - _BumpMap: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _DetailAlbedoMap: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _DetailMask: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _DetailNormalMap: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _EmissionMap: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _MainBump: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _MainTex: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _MetallicGlossMap: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _OcclusionMap: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _ParallaxMap: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + m_Ints: [] + m_Floats: + - _BlendOp: 0 + - _BumpScale: 1 + - _CameraFadingEnabled: 0 + - _CameraFarFadeDistance: 2 + - _CameraNearFadeDistance: 1 + - _ColorMask: 15 + - _ColorMode: 0 + - _Cull: 2 + - _Cutoff: 0.5 + - _DetailNormalMapScale: 1 + - _DistortionBlend: 0.5 + - _DistortionEnabled: 0 + - _DistortionStrength: 1 + - _DistortionStrengthScaled: 0 + - _DstBlend: 0 + - _EmissionEnabled: 0 + - _FlipbookMode: 0 + - _GlossMapScale: 1 + - _Glossiness: 0.5 + - _GlossyReflections: 1 + - _LightingEnabled: 0 + - _Metallic: 0 + - _Mode: 0 + - _OcclusionStrength: 1 + - _Parallax: 0.02 + - _Shininess: 0.2 + - _SmoothnessTextureChannel: 0 + - _SoftParticlesEnabled: 0 + - _SoftParticlesFarFadeDistance: 1 + - _SoftParticlesNearFadeDistance: 0 + - _SpecularHighlights: 1 + - _SrcBlend: 1 + - _Stencil: 0 + - _StencilComp: 8 + - _StencilOp: 0 + - _StencilReadMask: 255 + - _StencilWriteMask: 255 + - _UVSec: 0 + - _UseUIAlphaClip: 0 + - _ZWrite: 1 + m_Colors: + - _CameraFadeParams: {r: 0, g: Infinity, b: 0, a: 0} + - _Color: {r: 1, g: 0, b: 0, a: 1} + - _ColorAddSubDiff: {r: 0, g: 0, b: 0, a: 0} + - _EmissionColor: {r: 0, g: 0, b: 0, a: 1} + - _SoftParticleFadeParams: {r: 0, g: 0, b: 0, a: 0} + - _Specular: {r: 0, g: 0, b: 0, a: 0} + m_BuildTextureStacks: [] diff --git a/Assets/Material/Mesh/RedArrow.mat.meta b/Assets/Material/Mesh/RedArrow.mat.meta new file mode 100644 index 0000000..1d8565f --- /dev/null +++ b/Assets/Material/Mesh/RedArrow.mat.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: c63b340abfd902e4dbd6c1f59ea12432 +NativeFormatImporter: + externalObjects: {} + mainObjectFileID: 2100000 + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Prefab.meta b/Assets/Prefab.meta new file mode 100644 index 0000000..61e4cd2 --- /dev/null +++ b/Assets/Prefab.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 4f73ae4574c14624e9985aa2caead434 +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Prefab/ObjectFrame.prefab b/Assets/Prefab/ObjectFrame.prefab new file mode 100644 index 0000000..a4ff832 --- /dev/null +++ b/Assets/Prefab/ObjectFrame.prefab @@ -0,0 +1,99 @@ +%YAML 1.1 +%TAG !u! tag:unity3d.com,2011: +--- !u!1 &693515726500139600 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 3535969068774776561} + - component: {fileID: 5627667675678721262} + - component: {fileID: 1278812071073543517} + - component: {fileID: 1991177543470465731} + m_Layer: 0 + m_Name: ObjectFrame + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!4 &3535969068774776561 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 693515726500139600} + m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} + m_LocalPosition: {x: 1.175, y: 0.45980948, z: 0.285} + m_LocalScale: {x: 0.2, y: 0.2, z: 0.2} + m_ConstrainProportionsScale: 0 + m_Children: [] + m_Father: {fileID: 0} + m_RootOrder: 0 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!33 &5627667675678721262 +MeshFilter: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 693515726500139600} + m_Mesh: {fileID: 10202, guid: 0000000000000000e000000000000000, type: 0} +--- !u!23 &1278812071073543517 +MeshRenderer: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 693515726500139600} + 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: c7d413f358d5beb489909afd879d05de, 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!65 &1991177543470465731 +BoxCollider: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 693515726500139600} + 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} diff --git a/Assets/Prefab/ObjectFrame.prefab.meta b/Assets/Prefab/ObjectFrame.prefab.meta new file mode 100644 index 0000000..9a087b9 --- /dev/null +++ b/Assets/Prefab/ObjectFrame.prefab.meta @@ -0,0 +1,7 @@ +fileFormatVersion: 2 +guid: ccfa934dde2b1b745ba57d4aa87b4bdd +PrefabImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Scenes/SampleScene.unity b/Assets/Scenes/SampleScene.unity index 500d043..c20e7ca 100644 --- a/Assets/Scenes/SampleScene.unity +++ b/Assets/Scenes/SampleScene.unity @@ -1668,6 +1668,52 @@ Transform: m_Father: {fileID: 729208094} m_RootOrder: 0 m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!1 &91002362 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 91002363} + - component: {fileID: 91002364} + m_Layer: 0 + m_Name: ObjectDetectionSpace + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!4 &91002363 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 91002362} + 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: 3762444237361700491} + m_Father: {fileID: 0} + m_RootOrder: 9 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!114 &91002364 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 91002362} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: ac6e0f2ada881f84187b1b800334a3f7, type: 3} + m_Name: + m_EditorClassIdentifier: + framePrefab: {fileID: 3762444237361700492} --- !u!1 &92360373 GameObject: m_ObjectHideFlags: 0 @@ -2363,6 +2409,40 @@ BoxCollider: serializedVersion: 2 m_Size: {x: 0.032, y: 0.032, z: 0.016} m_Center: {x: 0, y: 0, z: 0} +--- !u!1 &145681186 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 145681187} + m_Layer: 0 + m_Name: Arrow + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!4 &145681187 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 145681186} + m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} + m_LocalPosition: {x: 0, y: 0, z: 0} + m_LocalScale: {x: 0.5, y: 0.5, z: 0.5} + m_ConstrainProportionsScale: 0 + m_Children: + - {fileID: 5505733255923575076} + - {fileID: 1715398006} + - {fileID: 1543849859} + m_Father: {fileID: 3762444237361700491} + m_RootOrder: 0 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} --- !u!1 &162186110 GameObject: m_ObjectHideFlags: 0 @@ -15469,7 +15549,7 @@ GameObject: serializedVersion: 6 m_Component: - component: {fileID: 1278946179} - - component: {fileID: 1278946178} + - component: {fileID: 1278946180} m_Layer: 0 m_Name: Network m_TagString: Untagged @@ -15477,18 +15557,6 @@ GameObject: m_NavMeshLayer: 0 m_StaticEditorFlags: 0 m_IsActive: 1 ---- !u!114 &1278946178 -MonoBehaviour: - m_ObjectHideFlags: 0 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - m_GameObject: {fileID: 1278946177} - m_Enabled: 1 - m_EditorHideFlags: 0 - m_Script: {fileID: 11500000, guid: ad0f25deb940dd845b46ca99eec23aae, type: 3} - m_Name: - m_EditorClassIdentifier: --- !u!4 &1278946179 Transform: m_ObjectHideFlags: 0 @@ -15504,6 +15572,23 @@ Transform: m_Father: {fileID: 0} m_RootOrder: 7 m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!114 &1278946180 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1278946177} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 84cea533f39f7994f8bc3914f7dfb8cb, type: 3} + m_Name: + m_EditorClassIdentifier: + isTxStarted: 0 + IP: 127.0.0.1 + rxPort: 8000 + txPort: 8001 + ObjectManager: {fileID: 91002364} --- !u!1 &1279699982 GameObject: m_ObjectHideFlags: 0 @@ -17642,6 +17727,89 @@ MonoBehaviour: m_Script: {fileID: 11500000, guid: 895f3bab7181f7340a30b55bf570f3c1, type: 3} m_Name: m_EditorClassIdentifier: +--- !u!1 &1543849858 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 1543849859} + - component: {fileID: 1543849861} + - component: {fileID: 1543849860} + m_Layer: 0 + m_Name: blue + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!4 &1543849859 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1543849858} + m_LocalRotation: {x: 0.7071068, y: 0, z: 0, w: 0.7071068} + m_LocalPosition: {x: 0, y: 0, z: 0} + m_LocalScale: {x: 1, y: 1, z: 1} + m_ConstrainProportionsScale: 0 + m_Children: [] + m_Father: {fileID: 145681187} + m_RootOrder: 2 + m_LocalEulerAnglesHint: {x: 90, y: 0, z: 0} +--- !u!23 &1543849860 +MeshRenderer: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1543849858} + 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: 934e5f9f94a057d42a91db054e114e4d, 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!33 &1543849861 +MeshFilter: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1543849858} + m_Mesh: {fileID: -2432090755550338912, guid: 510bb89745d42fb4cb16ba244be23d86, type: 3} --- !u!1 &1549906062 GameObject: m_ObjectHideFlags: 0 @@ -18713,6 +18881,89 @@ MeshFilter: m_PrefabAsset: {fileID: 0} m_GameObject: {fileID: 1700368087} m_Mesh: {fileID: 10210, guid: 0000000000000000e000000000000000, type: 0} +--- !u!1 &1715398005 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 1715398006} + - component: {fileID: 1715398008} + - component: {fileID: 1715398007} + m_Layer: 0 + m_Name: green + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!4 &1715398006 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1715398005} + 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: 145681187} + m_RootOrder: 1 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!23 &1715398007 +MeshRenderer: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1715398005} + 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: 53bab39c0c620204396a09ac301ed92d, 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!33 &1715398008 +MeshFilter: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1715398005} + m_Mesh: {fileID: -2432090755550338912, guid: 510bb89745d42fb4cb16ba244be23d86, type: 3} --- !u!1 &1718244463 GameObject: m_ObjectHideFlags: 0 @@ -20721,7 +20972,7 @@ MonoBehaviour: OnClick: m_PersistentCalls: m_Calls: - - m_Target: {fileID: 1278946178} + - m_Target: {fileID: 0} m_TargetAssemblyTypeName: HoloNetwork, Assembly-CSharp m_MethodName: BroadCast m_Mode: 1 @@ -24338,6 +24589,24 @@ MeshFilter: m_PrefabAsset: {fileID: 0} m_GameObject: {fileID: 372904778243614429} m_Mesh: {fileID: 9170960933396866087, guid: e4c40d2e061715d439b70505395eb626, type: 3} +--- !u!1 &3665477405629168159 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 5505733255923575076} + - component: {fileID: 7259631511853535342} + - component: {fileID: 6168487025673516282} + m_Layer: 0 + m_Name: red + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 --- !u!1 &3679528211328499291 GameObject: m_ObjectHideFlags: 0 @@ -24354,6 +24623,87 @@ GameObject: m_NavMeshLayer: 0 m_StaticEditorFlags: 0 m_IsActive: 1 +--- !u!1001 &3762444237361700490 +PrefabInstance: + m_ObjectHideFlags: 0 + serializedVersion: 2 + m_Modification: + m_TransformParent: {fileID: 91002363} + m_Modifications: + - target: {fileID: 693515726500139600, guid: ccfa934dde2b1b745ba57d4aa87b4bdd, type: 3} + propertyPath: m_Name + value: Cube + objectReference: {fileID: 0} + - target: {fileID: 3535969068774776561, guid: ccfa934dde2b1b745ba57d4aa87b4bdd, type: 3} + propertyPath: m_RootOrder + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 3535969068774776561, guid: ccfa934dde2b1b745ba57d4aa87b4bdd, type: 3} + propertyPath: m_LocalPosition.x + value: 0.434 + objectReference: {fileID: 0} + - target: {fileID: 3535969068774776561, guid: ccfa934dde2b1b745ba57d4aa87b4bdd, type: 3} + propertyPath: m_LocalPosition.y + value: 0.23124285 + objectReference: {fileID: 0} + - target: {fileID: 3535969068774776561, guid: ccfa934dde2b1b745ba57d4aa87b4bdd, type: 3} + propertyPath: m_LocalPosition.z + value: -0.243 + objectReference: {fileID: 0} + - target: {fileID: 3535969068774776561, guid: ccfa934dde2b1b745ba57d4aa87b4bdd, type: 3} + propertyPath: m_LocalRotation.w + value: 1 + objectReference: {fileID: 0} + - target: {fileID: 3535969068774776561, guid: ccfa934dde2b1b745ba57d4aa87b4bdd, type: 3} + propertyPath: m_LocalRotation.x + value: -0 + objectReference: {fileID: 0} + - target: {fileID: 3535969068774776561, guid: ccfa934dde2b1b745ba57d4aa87b4bdd, type: 3} + propertyPath: m_LocalRotation.y + value: -0 + objectReference: {fileID: 0} + - target: {fileID: 3535969068774776561, guid: ccfa934dde2b1b745ba57d4aa87b4bdd, type: 3} + propertyPath: m_LocalRotation.z + value: -0 + objectReference: {fileID: 0} + - target: {fileID: 3535969068774776561, guid: ccfa934dde2b1b745ba57d4aa87b4bdd, type: 3} + propertyPath: m_LocalEulerAnglesHint.x + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 3535969068774776561, guid: ccfa934dde2b1b745ba57d4aa87b4bdd, type: 3} + propertyPath: m_LocalEulerAnglesHint.y + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 3535969068774776561, guid: ccfa934dde2b1b745ba57d4aa87b4bdd, type: 3} + propertyPath: m_LocalEulerAnglesHint.z + value: 0 + objectReference: {fileID: 0} + m_RemovedComponents: [] + m_SourcePrefab: {fileID: 100100000, guid: ccfa934dde2b1b745ba57d4aa87b4bdd, type: 3} +--- !u!4 &3762444237361700491 stripped +Transform: + m_CorrespondingSourceObject: {fileID: 3535969068774776561, guid: ccfa934dde2b1b745ba57d4aa87b4bdd, type: 3} + m_PrefabInstance: {fileID: 3762444237361700490} + m_PrefabAsset: {fileID: 0} +--- !u!1 &3762444237361700492 stripped +GameObject: + m_CorrespondingSourceObject: {fileID: 693515726500139600, guid: ccfa934dde2b1b745ba57d4aa87b4bdd, type: 3} + m_PrefabInstance: {fileID: 3762444237361700490} + m_PrefabAsset: {fileID: 0} +--- !u!114 &3762444237361700493 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 3762444237361700492} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 01d16b7848e01184c9f24dbf1b5cb3e9, type: 3} + m_Name: + m_EditorClassIdentifier: + life: 50 + Category: --- !u!23 &3790005587756318970 MeshRenderer: m_ObjectHideFlags: 0 @@ -25245,6 +25595,21 @@ Transform: m_Father: {fileID: 4149943381104920082} m_RootOrder: 0 m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!4 &5505733255923575076 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 3665477405629168159} + m_LocalRotation: {x: 0, y: 0, z: -0.7071068, w: 0.7071068} + m_LocalPosition: {x: 0, y: 0, z: 0} + m_LocalScale: {x: 1, y: 1, z: 1} + m_ConstrainProportionsScale: 0 + m_Children: [] + m_Father: {fileID: 145681187} + m_RootOrder: 0 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: -90} --- !u!4 &5507809145014385221 Transform: m_ObjectHideFlags: 0 @@ -25580,6 +25945,48 @@ GameObject: m_NavMeshLayer: 0 m_StaticEditorFlags: 0 m_IsActive: 1 +--- !u!23 &6168487025673516282 +MeshRenderer: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 3665477405629168159} + 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: c63b340abfd902e4dbd6c1f59ea12432, 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!1 &6249942473796267184 GameObject: m_ObjectHideFlags: 0 @@ -25942,6 +26349,14 @@ Transform: m_Father: {fileID: 3996120393979639963} m_RootOrder: 0 m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!33 &7259631511853535342 +MeshFilter: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 3665477405629168159} + m_Mesh: {fileID: -2432090755550338912, guid: 510bb89745d42fb4cb16ba244be23d86, type: 3} --- !u!33 &7304707980563794272 MeshFilter: m_ObjectHideFlags: 0 diff --git a/Assets/Script/Network/UdpSocket.cs b/Assets/Script/Network/UdpSocket.cs new file mode 100644 index 0000000..4f52b92 --- /dev/null +++ b/Assets/Script/Network/UdpSocket.cs @@ -0,0 +1,135 @@ +/* +Created by Youssef Elashry to allow two-way communication between Python3 and Unity to send and receive strings + +Feel free to use this in your individual or commercial projects BUT make sure to reference me as: Two-way communication between Python 3 and Unity (C#) - Y. T. Elashry +It would be appreciated if you send me how you have used this in your projects (e.g. Machine Learning) at youssef.elashry@gmail.com + +Use at your own risk +Use under the Apache License 2.0 + +Modified by: +Youssef Elashry 12/2020 (replaced obsolete functions and improved further - works with Python as well) +Based on older work by Sandra Fang 2016 - Unity3D to MATLAB UDP communication - [url]http://msdn.microsoft.com/de-de/library/bb979228.aspx#ID0E3BAC[/url] +*/ + +using UnityEngine; +using System.Collections; +using System; +using System.Text; +using System.Net; +using System.Net.Sockets; +using System.Threading; + +public class UdpSocket : MonoBehaviour +{ + [HideInInspector] public bool isTxStarted = false; + + [SerializeField] string IP = "127.0.0.1"; // local host + [SerializeField] int rxPort = 8000; // port to receive data from Python on + [SerializeField] int txPort = 8001; // port to send data to Python on + + public ObjectSpaceManager ObjectManager; + + int i = 0; // DELETE THIS: Added to show sending data from Unity to Python via UDP + + // Create necessary UdpClient objects + UdpClient client; + IPEndPoint remoteEndPoint; + Thread receiveThread; // Receiving Thread + + IEnumerator SendDataCoroutine() // DELETE THIS: Added to show sending data from Unity to Python via UDP + { + while (true) + { + SendData("Sent from Unity: " + i.ToString()); + i++; + yield return new WaitForSeconds(1f); + } + } + + public void SendData(string message) // Use to send data to Python + { + try + { + byte[] data = Encoding.UTF8.GetBytes(message); + client.Send(data, data.Length, remoteEndPoint); + } + catch (Exception err) + { + print(err.ToString()); + } + } + + void Awake() + { + // Create remote endpoint (to Matlab) + remoteEndPoint = new IPEndPoint(IPAddress.Parse(IP), txPort); + + // Create local client + client = new UdpClient(rxPort); + + // local endpoint define (where messages are received) + // Create a new thread for reception of incoming messages + receiveThread = new Thread(new ThreadStart(ReceiveData)); + receiveThread.IsBackground = true; + receiveThread.Start(); + + // Initialize (seen in comments window) + print("UDP Comms Initialised"); + + //StartCoroutine(SendDataCoroutine()); // DELETE THIS: Added to show sending data from Unity to Python via UDP + } + + // Receive data, update packets received + private void ReceiveData() + { + while (true) + { + try + { + IPEndPoint anyIP = new IPEndPoint(IPAddress.Any, 0); + byte[] data = client.Receive(ref anyIP); + string text = Encoding.UTF8.GetString(data); + ProcessInput(text); + string[] lines = text.Split(new[] { '\n', '\r' }, StringSplitOptions.RemoveEmptyEntries); + if (lines[0] == "{Object Detection}") + { + //print("Receive Object"); + string cat = lines[1]; + float[] transform = new float[9]; + + // 将剩下的九行转换为整数存入数组 + for (int i = 0; i < 9; i++) + { + transform[i] = float.Parse(lines[i + 2]); + } + ObjectManager.AsyUpdateObject(cat, transform); + } + } + catch (Exception err) + { + print(err.ToString()); + } + } + } + + private void ProcessInput(string input) + { + // PROCESS INPUT RECEIVED STRING HERE + + if (!isTxStarted) // First data arrived so tx started + { + isTxStarted = true; + } + } + + //Prevent crashes - close clients and threads properly! + void OnDisable() + { + if (receiveThread != null) + receiveThread.Abort(); + + client.Close(); + } + +} \ No newline at end of file diff --git a/Assets/Script/Network/UdpSocket.cs.meta b/Assets/Script/Network/UdpSocket.cs.meta new file mode 100644 index 0000000..6336072 --- /dev/null +++ b/Assets/Script/Network/UdpSocket.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 84cea533f39f7994f8bc3914f7dfb8cb +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Script/Detection.meta b/Assets/Script/ObjectDetection.meta similarity index 100% rename from Assets/Script/Detection.meta rename to Assets/Script/ObjectDetection.meta diff --git a/Assets/Script/Detection/Detector.cs b/Assets/Script/ObjectDetection/Detector.cs similarity index 100% rename from Assets/Script/Detection/Detector.cs rename to Assets/Script/ObjectDetection/Detector.cs diff --git a/Assets/Script/Detection/Detector.cs.meta b/Assets/Script/ObjectDetection/Detector.cs.meta similarity index 100% rename from Assets/Script/Detection/Detector.cs.meta rename to Assets/Script/ObjectDetection/Detector.cs.meta diff --git a/Assets/Script/Detection/Extensions.cs b/Assets/Script/ObjectDetection/Extensions.cs similarity index 100% rename from Assets/Script/Detection/Extensions.cs rename to Assets/Script/ObjectDetection/Extensions.cs diff --git a/Assets/Script/Detection/Extensions.cs.meta b/Assets/Script/ObjectDetection/Extensions.cs.meta similarity index 100% rename from Assets/Script/Detection/Extensions.cs.meta rename to Assets/Script/ObjectDetection/Extensions.cs.meta diff --git a/Assets/Script/Detection/HoloCanCapture.cs b/Assets/Script/ObjectDetection/HoloCanCapture.cs similarity index 100% rename from Assets/Script/Detection/HoloCanCapture.cs rename to Assets/Script/ObjectDetection/HoloCanCapture.cs diff --git a/Assets/Script/Detection/HoloCanCapture.cs.meta b/Assets/Script/ObjectDetection/HoloCanCapture.cs.meta similarity index 100% rename from Assets/Script/Detection/HoloCanCapture.cs.meta rename to Assets/Script/ObjectDetection/HoloCanCapture.cs.meta diff --git a/Assets/Script/Detection/NN.meta b/Assets/Script/ObjectDetection/NN.meta similarity index 100% rename from Assets/Script/Detection/NN.meta rename to Assets/Script/ObjectDetection/NN.meta diff --git a/Assets/Script/Detection/NN/BarracudaUtils.cs b/Assets/Script/ObjectDetection/NN/BarracudaUtils.cs similarity index 100% rename from Assets/Script/Detection/NN/BarracudaUtils.cs rename to Assets/Script/ObjectDetection/NN/BarracudaUtils.cs diff --git a/Assets/Script/Detection/NN/BarracudaUtils.cs.meta b/Assets/Script/ObjectDetection/NN/BarracudaUtils.cs.meta similarity index 100% rename from Assets/Script/Detection/NN/BarracudaUtils.cs.meta rename to Assets/Script/ObjectDetection/NN/BarracudaUtils.cs.meta diff --git a/Assets/Script/Detection/NN/DuplicatesSupressor.cs b/Assets/Script/ObjectDetection/NN/DuplicatesSupressor.cs similarity index 100% rename from Assets/Script/Detection/NN/DuplicatesSupressor.cs rename to Assets/Script/ObjectDetection/NN/DuplicatesSupressor.cs diff --git a/Assets/Script/Detection/NN/DuplicatesSupressor.cs.meta b/Assets/Script/ObjectDetection/NN/DuplicatesSupressor.cs.meta similarity index 100% rename from Assets/Script/Detection/NN/DuplicatesSupressor.cs.meta rename to Assets/Script/ObjectDetection/NN/DuplicatesSupressor.cs.meta diff --git a/Assets/Script/Detection/NN/IntersectionOverUnion.cs b/Assets/Script/ObjectDetection/NN/IntersectionOverUnion.cs similarity index 100% rename from Assets/Script/Detection/NN/IntersectionOverUnion.cs rename to Assets/Script/ObjectDetection/NN/IntersectionOverUnion.cs diff --git a/Assets/Script/Detection/NN/IntersectionOverUnion.cs.meta b/Assets/Script/ObjectDetection/NN/IntersectionOverUnion.cs.meta similarity index 100% rename from Assets/Script/Detection/NN/IntersectionOverUnion.cs.meta rename to Assets/Script/ObjectDetection/NN/IntersectionOverUnion.cs.meta diff --git a/Assets/Script/Detection/NN/NNHandler.cs b/Assets/Script/ObjectDetection/NN/NNHandler.cs similarity index 100% rename from Assets/Script/Detection/NN/NNHandler.cs rename to Assets/Script/ObjectDetection/NN/NNHandler.cs diff --git a/Assets/Script/Detection/NN/NNHandler.cs.meta b/Assets/Script/ObjectDetection/NN/NNHandler.cs.meta similarity index 100% rename from Assets/Script/Detection/NN/NNHandler.cs.meta rename to Assets/Script/ObjectDetection/NN/NNHandler.cs.meta diff --git a/Assets/Script/Detection/NN/ResultBox.cs b/Assets/Script/ObjectDetection/NN/ResultBox.cs similarity index 100% rename from Assets/Script/Detection/NN/ResultBox.cs rename to Assets/Script/ObjectDetection/NN/ResultBox.cs diff --git a/Assets/Script/Detection/NN/ResultBox.cs.meta b/Assets/Script/ObjectDetection/NN/ResultBox.cs.meta similarity index 100% rename from Assets/Script/Detection/NN/ResultBox.cs.meta rename to Assets/Script/ObjectDetection/NN/ResultBox.cs.meta diff --git a/Assets/Script/Detection/NN/YOLOv8.cs b/Assets/Script/ObjectDetection/NN/YOLOv8.cs similarity index 100% rename from Assets/Script/Detection/NN/YOLOv8.cs rename to Assets/Script/ObjectDetection/NN/YOLOv8.cs diff --git a/Assets/Script/Detection/NN/YOLOv8.cs.meta b/Assets/Script/ObjectDetection/NN/YOLOv8.cs.meta similarity index 100% rename from Assets/Script/Detection/NN/YOLOv8.cs.meta rename to Assets/Script/ObjectDetection/NN/YOLOv8.cs.meta diff --git a/Assets/Script/Detection/NN/YOLOv8OutputReader.cs b/Assets/Script/ObjectDetection/NN/YOLOv8OutputReader.cs similarity index 100% rename from Assets/Script/Detection/NN/YOLOv8OutputReader.cs rename to Assets/Script/ObjectDetection/NN/YOLOv8OutputReader.cs diff --git a/Assets/Script/Detection/NN/YOLOv8OutputReader.cs.meta b/Assets/Script/ObjectDetection/NN/YOLOv8OutputReader.cs.meta similarity index 100% rename from Assets/Script/Detection/NN/YOLOv8OutputReader.cs.meta rename to Assets/Script/ObjectDetection/NN/YOLOv8OutputReader.cs.meta diff --git a/Assets/Script/Detection/NN/YOLOv8SegmentationOutputReader.cs b/Assets/Script/ObjectDetection/NN/YOLOv8SegmentationOutputReader.cs similarity index 100% rename from Assets/Script/Detection/NN/YOLOv8SegmentationOutputReader.cs rename to Assets/Script/ObjectDetection/NN/YOLOv8SegmentationOutputReader.cs diff --git a/Assets/Script/Detection/NN/YOLOv8SegmentationOutputReader.cs.meta b/Assets/Script/ObjectDetection/NN/YOLOv8SegmentationOutputReader.cs.meta similarity index 100% rename from Assets/Script/Detection/NN/YOLOv8SegmentationOutputReader.cs.meta rename to Assets/Script/ObjectDetection/NN/YOLOv8SegmentationOutputReader.cs.meta diff --git a/Assets/Script/Detection/TextToTexture.cs b/Assets/Script/ObjectDetection/TextToTexture.cs similarity index 100% rename from Assets/Script/Detection/TextToTexture.cs rename to Assets/Script/ObjectDetection/TextToTexture.cs diff --git a/Assets/Script/Detection/TextToTexture.cs.meta b/Assets/Script/ObjectDetection/TextToTexture.cs.meta similarity index 100% rename from Assets/Script/Detection/TextToTexture.cs.meta rename to Assets/Script/ObjectDetection/TextToTexture.cs.meta diff --git a/Assets/Script/Detection/TextureProviders.meta b/Assets/Script/ObjectDetection/TextureProviders.meta similarity index 100% rename from Assets/Script/Detection/TextureProviders.meta rename to Assets/Script/ObjectDetection/TextureProviders.meta diff --git a/Assets/Script/Detection/TextureProviders/TextureProvider.cs b/Assets/Script/ObjectDetection/TextureProviders/TextureProvider.cs similarity index 100% rename from Assets/Script/Detection/TextureProviders/TextureProvider.cs rename to Assets/Script/ObjectDetection/TextureProviders/TextureProvider.cs diff --git a/Assets/Script/Detection/TextureProviders/TextureProvider.cs.meta b/Assets/Script/ObjectDetection/TextureProviders/TextureProvider.cs.meta similarity index 100% rename from Assets/Script/Detection/TextureProviders/TextureProvider.cs.meta rename to Assets/Script/ObjectDetection/TextureProviders/TextureProvider.cs.meta diff --git a/Assets/Script/Detection/TextureProviders/VideoTextureProvider.cs b/Assets/Script/ObjectDetection/TextureProviders/VideoTextureProvider.cs similarity index 100% rename from Assets/Script/Detection/TextureProviders/VideoTextureProvider.cs rename to Assets/Script/ObjectDetection/TextureProviders/VideoTextureProvider.cs diff --git a/Assets/Script/Detection/TextureProviders/VideoTextureProvider.cs.meta b/Assets/Script/ObjectDetection/TextureProviders/VideoTextureProvider.cs.meta similarity index 100% rename from Assets/Script/Detection/TextureProviders/VideoTextureProvider.cs.meta rename to Assets/Script/ObjectDetection/TextureProviders/VideoTextureProvider.cs.meta diff --git a/Assets/Script/Detection/TextureProviders/WebCamTextureProvider.cs b/Assets/Script/ObjectDetection/TextureProviders/WebCamTextureProvider.cs similarity index 100% rename from Assets/Script/Detection/TextureProviders/WebCamTextureProvider.cs rename to Assets/Script/ObjectDetection/TextureProviders/WebCamTextureProvider.cs diff --git a/Assets/Script/Detection/TextureProviders/WebCamTextureProvider.cs.meta b/Assets/Script/ObjectDetection/TextureProviders/WebCamTextureProvider.cs.meta similarity index 100% rename from Assets/Script/Detection/TextureProviders/WebCamTextureProvider.cs.meta rename to Assets/Script/ObjectDetection/TextureProviders/WebCamTextureProvider.cs.meta diff --git a/Assets/Script/Detection/TextureTools.cs b/Assets/Script/ObjectDetection/TextureTools.cs similarity index 100% rename from Assets/Script/Detection/TextureTools.cs rename to Assets/Script/ObjectDetection/TextureTools.cs diff --git a/Assets/Script/Detection/TextureTools.cs.meta b/Assets/Script/ObjectDetection/TextureTools.cs.meta similarity index 100% rename from Assets/Script/Detection/TextureTools.cs.meta rename to Assets/Script/ObjectDetection/TextureTools.cs.meta diff --git a/Assets/Script/ObjectSpaceManager.cs b/Assets/Script/ObjectSpaceManager.cs new file mode 100644 index 0000000..4495a7c --- /dev/null +++ b/Assets/Script/ObjectSpaceManager.cs @@ -0,0 +1,93 @@ +using System.Collections; +using System.Collections.Generic; +using UnityEngine; +using System.Linq; + +public class ObjectSpaceManager : MonoBehaviour +{ + int id = 0; + public GameObject framePrefab; + + + public Dictionary objects = new Dictionary(); + + public class FrameInfo + { + public int id; + public string cat; + public Vector3 pos; + public Vector3 rot; + public Vector3 size; + public FrameInfo(int id, string cat, Vector3 pos, Vector3 rot, Vector3 size) + { + this.id = id; + this.cat = cat; + this.pos = pos; + this.rot = rot; + this.size = size; + } + } + + public Queue frameQueue = new Queue(); + + public void CreateObject(int id, string cat, Vector3 pos, Vector3 rot, Vector3 size) + { + GameObject Frame = Instantiate(framePrefab); + Frame.transform.parent = transform; + Frame.SetActive(true); + Frame.name = cat + id.ToString(); + objects.Add(Frame.name, Frame.GetComponent()); + ObjectFrame frame = objects[Frame.name]; + frame.UpdateFrame(cat, pos, rot, size); + } + + public void EnqueueUpdateObject(string cat, Vector3 pos, Vector3 rot, Vector3 size) + { + frameQueue.Enqueue(new FrameInfo(0, cat, pos, rot, size)); + } + + public void UpdateObject(string cat, Vector3 pos, Vector3 rot, Vector3 size) + { + bool pre_found = false; + foreach (var item in objects) + { + ObjectFrame frame = item.Value; + + if (Vector3.Distance(frame.transform.position, pos) < 0.05f) + { + pre_found = true; + item.Value.UpdateFrame(cat, pos, rot, size); + break; + } + + } + if (!pre_found) + { + CreateObject(id, cat, pos, rot, size); + id++; + } + } + + public void AsyUpdateObject(string cat, float[] transform) + { + Vector3 pos = new Vector3(transform[0], transform[1], transform[2]); + Vector3 rot = new Vector3(transform[3], transform[4], transform[5]); + Vector3 size = new Vector3(transform[6], transform[7], transform[8]); + EnqueueUpdateObject(cat, pos, rot, size); + } + + void Start() + { + framePrefab.SetActive(false); + } + + // Update is called once per frame + void Update() + { + while (frameQueue.Count > 0) + { + FrameInfo info = frameQueue.Dequeue(); + UpdateObject(info.cat, info.pos, info.rot, info.size); + } + } +} diff --git a/Assets/Script/ObjectSpaceManager.cs.meta b/Assets/Script/ObjectSpaceManager.cs.meta new file mode 100644 index 0000000..9866e24 --- /dev/null +++ b/Assets/Script/ObjectSpaceManager.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: ac6e0f2ada881f84187b1b800334a3f7 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Script/UI/ObjectFrame.cs b/Assets/Script/UI/ObjectFrame.cs new file mode 100644 index 0000000..2ed4c93 --- /dev/null +++ b/Assets/Script/UI/ObjectFrame.cs @@ -0,0 +1,48 @@ +using System.Collections; +using System.Collections.Generic; +using UnityEngine; + +public class ObjectFrame : MonoBehaviour +{ + + public enum Type + { + Detect, + Aim + } + + Transform arrows; + + Type type; + + public int life = 50; + public string Category; + + public void InitFrame(Type t, Vector3 pos, Vector3 rot, Vector3 scale) + { + type = t; + transform.position = pos; + transform.eulerAngles = rot; + transform.localScale = scale; + } + + + public void UpdateFrame(string cat, Vector3 pos, Vector3 rot, Vector3 scale) + { + Category = cat; + transform.position = pos; + transform.eulerAngles = rot; + transform.localScale = scale; + } + + void Start() + { + arrows = transform.Find("Arrow"); + } + + // Update is called once per frame + void Update() + { + arrows.localScale = new Vector3(1f/transform.lossyScale.x, 1f/transform.localScale.y, 1f/transform.lossyScale.z) * 0.5f * transform.localScale.magnitude; + } +} diff --git a/Assets/Script/UI/ObjectFrame.cs.meta b/Assets/Script/UI/ObjectFrame.cs.meta new file mode 100644 index 0000000..e69f2d5 --- /dev/null +++ b/Assets/Script/UI/ObjectFrame.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 01d16b7848e01184c9f24dbf1b5cb3e9 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Shader.meta b/Assets/Shader.meta new file mode 100644 index 0000000..bf29ca1 --- /dev/null +++ b/Assets/Shader.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: dedc6c4c04f293241941b78959451957 +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Shader/CubeFrame.shader b/Assets/Shader/CubeFrame.shader new file mode 100644 index 0000000..91c6dce --- /dev/null +++ b/Assets/Shader/CubeFrame.shader @@ -0,0 +1,65 @@ +Shader "MyUI/CubeFrame" +{ + Properties + { + _Color("Color", color) = (1,1,1,1) + _Width("Width", range(0,0.5)) = 0.1 + } + SubShader + { + Tags { "Queue"="Transparent" } + Pass { + + //Ҫʾ߿ȡעͼ + cull off + ZWrite off + //** + blend srcalpha oneminussrcalpha + CGPROGRAM + + #pragma vertex vert + #pragma fragment frag + #include "UnityCG.cginc" + uniform sampler2D _MainTex; + uniform float4 _MainTex_ST; + fixed4 _Color; + fixed _Width; + + struct a2v { + float4 vertex : POSITION; + float2 uv : TEXCOORD0; + }; + + struct v2f { + float4 pos : SV_POSITION; + float2 uv : TEXCOORD0; + }; + + v2f vert(a2v v) { + v2f o; + + o.pos = UnityObjectToClipPos(v.vertex); + o.uv = v.uv; + + return o; + } + + float4 frag(v2f i) : SV_Target { + + fixed4 col = fixed4(0,0,0,0);//CubeĻɫ + + col += saturate(step(i.uv.x, _Width) + step(1 - _Width, i.uv.x) + step(i.uv.y, _Width) + step(1 - _Width, i.uv.y)) * _Color; + + //if (i.uv.x < _Width || i.uv.x > 1 - _Width || i.uv.y < _Width || i.uv.y > 1 - _Width) + //{ + // col = _Color; + //} + + return col; + } + + ENDCG + } + } +} + diff --git a/Assets/Shader/CubeFrame.shader.meta b/Assets/Shader/CubeFrame.shader.meta new file mode 100644 index 0000000..aee9e60 --- /dev/null +++ b/Assets/Shader/CubeFrame.shader.meta @@ -0,0 +1,10 @@ +fileFormatVersion: 2 +guid: be14aa99895eb62478790277ada5f6a8 +ShaderImporter: + externalObjects: {} + defaultTextures: [] + nonModifiableTextures: [] + preprocessorOverride: 0 + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/arrow.mtl b/Assets/arrow.mtl new file mode 100644 index 0000000..f231bdf --- /dev/null +++ b/Assets/arrow.mtl @@ -0,0 +1,10 @@ +# Blender MTL File: 'None' +# Material Count: 1 + +newmtl None +Ns 500 +Ka 0.8 0.8 0.8 +Kd 0.8 0.8 0.8 +Ks 0.8 0.8 0.8 +d 1 +illum 2 diff --git a/Assets/arrow.mtl.meta b/Assets/arrow.mtl.meta new file mode 100644 index 0000000..b007ac3 --- /dev/null +++ b/Assets/arrow.mtl.meta @@ -0,0 +1,7 @@ +fileFormatVersion: 2 +guid: 4592baee5073b4e40aafbb803b9ec030 +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: