This commit is contained in:
parent
e0d6387ddc
commit
bd968e8e58
|
@ -32,8 +32,8 @@ Material:
|
||||||
- _dispStrength: 1
|
- _dispStrength: 1
|
||||||
- _overBright: 1
|
- _overBright: 1
|
||||||
m_Colors:
|
m_Colors:
|
||||||
- _AmbientTint: {r: 0, g: 0, b: 0, a: 1}
|
- _AmbientTint: {r: 1, g: 1, b: 1, a: 1}
|
||||||
- _Color: {r: 0.25, g: 0.25, b: 0.25, a: 0.040000003}
|
- _Color: {r: 0.5, g: 0.49803922, b: 0.49215686, a: 0.2}
|
||||||
- _GlowColor: {r: 0.5, g: 0.5, b: 0.5, a: 0.5}
|
- _GlowColor: {r: 0.5, g: 0.5, b: 0.5, a: 0.5}
|
||||||
- _PrimaryTint: {r: 1, g: 1, b: 1, a: 1}
|
- _PrimaryTint: {r: 1, g: 1, b: 1, a: 1}
|
||||||
- _TintColor: {r: 1, g: 1, b: 1, a: 1}
|
- _TintColor: {r: 1, g: 1, b: 1, a: 1}
|
||||||
|
|
|
@ -0,0 +1,215 @@
|
||||||
|
%YAML 1.1
|
||||||
|
%TAG !u! tag:unity3d.com,2011:
|
||||||
|
--- !u!1 &3870983289451212405
|
||||||
|
GameObject:
|
||||||
|
m_ObjectHideFlags: 0
|
||||||
|
m_CorrespondingSourceObject: {fileID: 0}
|
||||||
|
m_PrefabInstance: {fileID: 0}
|
||||||
|
m_PrefabAsset: {fileID: 0}
|
||||||
|
serializedVersion: 6
|
||||||
|
m_Component:
|
||||||
|
- component: {fileID: 3870983289451212404}
|
||||||
|
- component: {fileID: 3870983289451212410}
|
||||||
|
- component: {fileID: 3870983289451212411}
|
||||||
|
m_Layer: 0
|
||||||
|
m_Name: txt-ground
|
||||||
|
m_TagString: Untagged
|
||||||
|
m_Icon: {fileID: 0}
|
||||||
|
m_NavMeshLayer: 0
|
||||||
|
m_StaticEditorFlags: 0
|
||||||
|
m_IsActive: 1
|
||||||
|
--- !u!224 &3870983289451212404
|
||||||
|
RectTransform:
|
||||||
|
m_ObjectHideFlags: 0
|
||||||
|
m_CorrespondingSourceObject: {fileID: 0}
|
||||||
|
m_PrefabInstance: {fileID: 0}
|
||||||
|
m_PrefabAsset: {fileID: 0}
|
||||||
|
m_GameObject: {fileID: 3870983289451212405}
|
||||||
|
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_Children: []
|
||||||
|
m_Father: {fileID: 7915387065595347900}
|
||||||
|
m_RootOrder: 0
|
||||||
|
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
|
||||||
|
m_AnchorMin: {x: 0, y: 0}
|
||||||
|
m_AnchorMax: {x: 1, y: 1}
|
||||||
|
m_AnchoredPosition: {x: 2.710022, y: -0.000015258789}
|
||||||
|
m_SizeDelta: {x: -5.4245605, y: 0}
|
||||||
|
m_Pivot: {x: 0.5, y: 0.5}
|
||||||
|
--- !u!222 &3870983289451212410
|
||||||
|
CanvasRenderer:
|
||||||
|
m_ObjectHideFlags: 0
|
||||||
|
m_CorrespondingSourceObject: {fileID: 0}
|
||||||
|
m_PrefabInstance: {fileID: 0}
|
||||||
|
m_PrefabAsset: {fileID: 0}
|
||||||
|
m_GameObject: {fileID: 3870983289451212405}
|
||||||
|
m_CullTransparentMesh: 0
|
||||||
|
--- !u!114 &3870983289451212411
|
||||||
|
MonoBehaviour:
|
||||||
|
m_ObjectHideFlags: 0
|
||||||
|
m_CorrespondingSourceObject: {fileID: 0}
|
||||||
|
m_PrefabInstance: {fileID: 0}
|
||||||
|
m_PrefabAsset: {fileID: 0}
|
||||||
|
m_GameObject: {fileID: 3870983289451212405}
|
||||||
|
m_Enabled: 1
|
||||||
|
m_EditorHideFlags: 0
|
||||||
|
m_Script: {fileID: 11500000, guid: 5f7201a12d95ffc409449d95f23cf332, type: 3}
|
||||||
|
m_Name:
|
||||||
|
m_EditorClassIdentifier:
|
||||||
|
m_Material: {fileID: 0}
|
||||||
|
m_Color: {r: 1, g: 1, b: 1, a: 1}
|
||||||
|
m_RaycastTarget: 1
|
||||||
|
m_Maskable: 1
|
||||||
|
m_OnCullStateChanged:
|
||||||
|
m_PersistentCalls:
|
||||||
|
m_Calls: []
|
||||||
|
m_FontData:
|
||||||
|
m_Font: {fileID: 10102, guid: 0000000000000000e000000000000000, type: 0}
|
||||||
|
m_FontSize: 18
|
||||||
|
m_FontStyle: 0
|
||||||
|
m_BestFit: 0
|
||||||
|
m_MinSize: 1
|
||||||
|
m_MaxSize: 40
|
||||||
|
m_Alignment: 3
|
||||||
|
m_AlignByGeometry: 0
|
||||||
|
m_RichText: 1
|
||||||
|
m_HorizontalOverflow: 0
|
||||||
|
m_VerticalOverflow: 0
|
||||||
|
m_LineSpacing: 1
|
||||||
|
m_Text: "\u5730\u9762\u8BBE\u5907"
|
||||||
|
--- !u!1 &7915387065595347901
|
||||||
|
GameObject:
|
||||||
|
m_ObjectHideFlags: 0
|
||||||
|
m_CorrespondingSourceObject: {fileID: 0}
|
||||||
|
m_PrefabInstance: {fileID: 0}
|
||||||
|
m_PrefabAsset: {fileID: 0}
|
||||||
|
serializedVersion: 6
|
||||||
|
m_Component:
|
||||||
|
- component: {fileID: 7915387065595347900}
|
||||||
|
- component: {fileID: 7915387065595347902}
|
||||||
|
- component: {fileID: 7915387065595347903}
|
||||||
|
- component: {fileID: 633993627584584296}
|
||||||
|
- component: {fileID: 8125462804241330245}
|
||||||
|
m_Layer: 0
|
||||||
|
m_Name: DeviceBtn
|
||||||
|
m_TagString: Untagged
|
||||||
|
m_Icon: {fileID: 0}
|
||||||
|
m_NavMeshLayer: 0
|
||||||
|
m_StaticEditorFlags: 0
|
||||||
|
m_IsActive: 1
|
||||||
|
--- !u!224 &7915387065595347900
|
||||||
|
RectTransform:
|
||||||
|
m_ObjectHideFlags: 0
|
||||||
|
m_CorrespondingSourceObject: {fileID: 0}
|
||||||
|
m_PrefabInstance: {fileID: 0}
|
||||||
|
m_PrefabAsset: {fileID: 0}
|
||||||
|
m_GameObject: {fileID: 7915387065595347901}
|
||||||
|
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_Children:
|
||||||
|
- {fileID: 3870983289451212404}
|
||||||
|
m_Father: {fileID: 0}
|
||||||
|
m_RootOrder: 0
|
||||||
|
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
|
||||||
|
m_AnchorMin: {x: 0, y: 0}
|
||||||
|
m_AnchorMax: {x: 0, y: 0}
|
||||||
|
m_AnchoredPosition: {x: 0, y: 0}
|
||||||
|
m_SizeDelta: {x: 438.00037, y: 34.329895}
|
||||||
|
m_Pivot: {x: 0.5, y: 0.5}
|
||||||
|
--- !u!222 &7915387065595347902
|
||||||
|
CanvasRenderer:
|
||||||
|
m_ObjectHideFlags: 0
|
||||||
|
m_CorrespondingSourceObject: {fileID: 0}
|
||||||
|
m_PrefabInstance: {fileID: 0}
|
||||||
|
m_PrefabAsset: {fileID: 0}
|
||||||
|
m_GameObject: {fileID: 7915387065595347901}
|
||||||
|
m_CullTransparentMesh: 0
|
||||||
|
--- !u!114 &7915387065595347903
|
||||||
|
MonoBehaviour:
|
||||||
|
m_ObjectHideFlags: 0
|
||||||
|
m_CorrespondingSourceObject: {fileID: 0}
|
||||||
|
m_PrefabInstance: {fileID: 0}
|
||||||
|
m_PrefabAsset: {fileID: 0}
|
||||||
|
m_GameObject: {fileID: 7915387065595347901}
|
||||||
|
m_Enabled: 1
|
||||||
|
m_EditorHideFlags: 0
|
||||||
|
m_Script: {fileID: 11500000, guid: fe87c0e1cc204ed48ad3b37840f39efc, type: 3}
|
||||||
|
m_Name:
|
||||||
|
m_EditorClassIdentifier:
|
||||||
|
m_Material: {fileID: 0}
|
||||||
|
m_Color: {r: 1, g: 1, b: 1, a: 1}
|
||||||
|
m_RaycastTarget: 1
|
||||||
|
m_Maskable: 1
|
||||||
|
m_OnCullStateChanged:
|
||||||
|
m_PersistentCalls:
|
||||||
|
m_Calls: []
|
||||||
|
m_Sprite: {fileID: 21300000, guid: c9a842e0a0689914bbd1e3130cbd6333, type: 3}
|
||||||
|
m_Type: 0
|
||||||
|
m_PreserveAspect: 0
|
||||||
|
m_FillCenter: 1
|
||||||
|
m_FillMethod: 4
|
||||||
|
m_FillAmount: 1
|
||||||
|
m_FillClockwise: 1
|
||||||
|
m_FillOrigin: 0
|
||||||
|
m_UseSpriteMesh: 0
|
||||||
|
m_PixelsPerUnitMultiplier: 1
|
||||||
|
--- !u!114 &633993627584584296
|
||||||
|
MonoBehaviour:
|
||||||
|
m_ObjectHideFlags: 0
|
||||||
|
m_CorrespondingSourceObject: {fileID: 0}
|
||||||
|
m_PrefabInstance: {fileID: 0}
|
||||||
|
m_PrefabAsset: {fileID: 0}
|
||||||
|
m_GameObject: {fileID: 7915387065595347901}
|
||||||
|
m_Enabled: 1
|
||||||
|
m_EditorHideFlags: 0
|
||||||
|
m_Script: {fileID: 11500000, guid: 37fcf72b3c08834488f3ede57238ceb0, type: 3}
|
||||||
|
m_Name:
|
||||||
|
m_EditorClassIdentifier:
|
||||||
|
selfBtn: {fileID: 8125462804241330245}
|
||||||
|
id:
|
||||||
|
selfName:
|
||||||
|
--- !u!114 &8125462804241330245
|
||||||
|
MonoBehaviour:
|
||||||
|
m_ObjectHideFlags: 0
|
||||||
|
m_CorrespondingSourceObject: {fileID: 0}
|
||||||
|
m_PrefabInstance: {fileID: 0}
|
||||||
|
m_PrefabAsset: {fileID: 0}
|
||||||
|
m_GameObject: {fileID: 7915387065595347901}
|
||||||
|
m_Enabled: 1
|
||||||
|
m_EditorHideFlags: 0
|
||||||
|
m_Script: {fileID: 11500000, guid: 4e29b1a8efbd4b44bb3f3716e73f07ff, type: 3}
|
||||||
|
m_Name:
|
||||||
|
m_EditorClassIdentifier:
|
||||||
|
m_Navigation:
|
||||||
|
m_Mode: 3
|
||||||
|
m_SelectOnUp: {fileID: 0}
|
||||||
|
m_SelectOnDown: {fileID: 0}
|
||||||
|
m_SelectOnLeft: {fileID: 0}
|
||||||
|
m_SelectOnRight: {fileID: 0}
|
||||||
|
m_Transition: 1
|
||||||
|
m_Colors:
|
||||||
|
m_NormalColor: {r: 1, g: 1, b: 1, a: 1}
|
||||||
|
m_HighlightedColor: {r: 0.9607843, g: 0.9607843, b: 0.9607843, a: 1}
|
||||||
|
m_PressedColor: {r: 0.78431374, g: 0.78431374, b: 0.78431374, a: 1}
|
||||||
|
m_SelectedColor: {r: 0.9607843, g: 0.9607843, b: 0.9607843, a: 1}
|
||||||
|
m_DisabledColor: {r: 0.78431374, g: 0.78431374, b: 0.78431374, a: 0.5019608}
|
||||||
|
m_ColorMultiplier: 1
|
||||||
|
m_FadeDuration: 0.1
|
||||||
|
m_SpriteState:
|
||||||
|
m_HighlightedSprite: {fileID: 0}
|
||||||
|
m_PressedSprite: {fileID: 0}
|
||||||
|
m_SelectedSprite: {fileID: 0}
|
||||||
|
m_DisabledSprite: {fileID: 0}
|
||||||
|
m_AnimationTriggers:
|
||||||
|
m_NormalTrigger: Normal
|
||||||
|
m_HighlightedTrigger: Highlighted
|
||||||
|
m_PressedTrigger: Pressed
|
||||||
|
m_SelectedTrigger: Selected
|
||||||
|
m_DisabledTrigger: Disabled
|
||||||
|
m_Interactable: 1
|
||||||
|
m_TargetGraphic: {fileID: 7915387065595347903}
|
||||||
|
m_OnClick:
|
||||||
|
m_PersistentCalls:
|
||||||
|
m_Calls: []
|
|
@ -0,0 +1,7 @@
|
||||||
|
fileFormatVersion: 2
|
||||||
|
guid: fd27e404fb7dcc3499a0c8fabd75e0c1
|
||||||
|
PrefabImporter:
|
||||||
|
externalObjects: {}
|
||||||
|
userData:
|
||||||
|
assetBundleName:
|
||||||
|
assetBundleVariant:
|
File diff suppressed because it is too large
Load Diff
|
@ -0,0 +1,30 @@
|
||||||
|
using System.Collections;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using UnityEngine;
|
||||||
|
using UnityEngine.UI;
|
||||||
|
|
||||||
|
public class DeviceBtnItem : MonoBehaviour
|
||||||
|
{
|
||||||
|
public Button selfBtn;
|
||||||
|
public string id;
|
||||||
|
public string selfName;
|
||||||
|
|
||||||
|
// Start is called before the first frame update
|
||||||
|
void Start()
|
||||||
|
{
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
// Update is called once per frame
|
||||||
|
void Update()
|
||||||
|
{
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
public void SetInfo(string _id, string _selfName)
|
||||||
|
{
|
||||||
|
id = _id;
|
||||||
|
selfName = _selfName;
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
|
@ -0,0 +1,11 @@
|
||||||
|
fileFormatVersion: 2
|
||||||
|
guid: 37fcf72b3c08834488f3ede57238ceb0
|
||||||
|
MonoImporter:
|
||||||
|
externalObjects: {}
|
||||||
|
serializedVersion: 2
|
||||||
|
defaultReferences: []
|
||||||
|
executionOrder: 0
|
||||||
|
icon: {instanceID: 0}
|
||||||
|
userData:
|
||||||
|
assetBundleName:
|
||||||
|
assetBundleVariant:
|
|
@ -2,6 +2,7 @@
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using System.Linq;
|
using System.Linq;
|
||||||
using UnityEngine;
|
using UnityEngine;
|
||||||
|
using UnityEngine.UI;
|
||||||
|
|
||||||
public class PostureController : MonoBehaviour
|
public class PostureController : MonoBehaviour
|
||||||
{
|
{
|
||||||
|
@ -10,7 +11,7 @@ public class PostureController : MonoBehaviour
|
||||||
public DeviceManager deviceManager;
|
public DeviceManager deviceManager;
|
||||||
public Transform redContanier;
|
public Transform redContanier;
|
||||||
public Transform blueContanier;
|
public Transform blueContanier;
|
||||||
|
public DeviceBtnItem deviceBtnItem;
|
||||||
// Start is called before the first frame update
|
// Start is called before the first frame update
|
||||||
void Awake()
|
void Awake()
|
||||||
{
|
{
|
||||||
|
@ -32,6 +33,41 @@ public class PostureController : MonoBehaviour
|
||||||
{
|
{
|
||||||
redObjs = deviceManager.devices.Where(x => x != null && x.gameObject.layer == 11).ToList();
|
redObjs = deviceManager.devices.Where(x => x != null && x.gameObject.layer == 11).ToList();
|
||||||
blueObjs = deviceManager.devices.Where(x => x != null && x.gameObject.layer == 12).ToList();
|
blueObjs = deviceManager.devices.Where(x => x != null && x.gameObject.layer == 12).ToList();
|
||||||
|
if (redContanier.childCount > 0)
|
||||||
|
{
|
||||||
|
for (int i = 0; i < redContanier.childCount; i++)
|
||||||
|
{
|
||||||
|
Destroy(redContanier.GetChild(i).gameObject);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (blueContanier.childCount > 0)
|
||||||
|
{
|
||||||
|
for (int i = 0; i < blueContanier.childCount; i++)
|
||||||
|
{
|
||||||
|
Destroy(blueContanier.GetChild(i).gameObject);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
for (int i = 0; i < redObjs.Count; i++)
|
||||||
|
{
|
||||||
|
DeviceBtnItem obj = Instantiate(deviceBtnItem, redContanier);
|
||||||
|
obj.selfBtn.onClick.AddListener(() =>
|
||||||
|
{
|
||||||
|
OnDeviceBtn(obj.id);
|
||||||
|
});
|
||||||
|
}
|
||||||
|
for (int i = 0; i < blueObjs.Count; i++)
|
||||||
|
{
|
||||||
|
DeviceBtnItem obj = Instantiate(deviceBtnItem, blueContanier);
|
||||||
|
obj.selfBtn.onClick.AddListener(() =>
|
||||||
|
{
|
||||||
|
OnDeviceBtn(obj.id);
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private void OnDeviceBtn(string id)
|
||||||
|
{
|
||||||
|
Debug.Log(id);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue