wireframe cube added & pose cam added to main brain
This commit is contained in:
@@ -29,6 +29,7 @@ public class CameraManager : MonoBehaviour
|
||||
public LayerMask m_Bodies;
|
||||
public LayerMask m_Environment;
|
||||
public LayerMask m_Actuations;
|
||||
public LayerMask m_Compare;
|
||||
|
||||
[Header("Text Objects")]
|
||||
public GameObject m_Rewards;
|
||||
@@ -131,6 +132,10 @@ public class CameraManager : MonoBehaviour
|
||||
case "vc_Actuations":
|
||||
m_Camera.cullingMask = m_Actuations;
|
||||
m_Rewards.SetActive(true);
|
||||
break;
|
||||
case "vc_Compare":
|
||||
m_Camera.cullingMask = m_Compare;
|
||||
m_Rewards.SetActive(true);
|
||||
break;
|
||||
}
|
||||
|
||||
@@ -205,7 +210,8 @@ public class CameraManager : MonoBehaviour
|
||||
|
||||
if (AreDifferentPairs(pastCamera.tag, m_ActiveCamera.tag, "vc_Body", "vc_Agent") || AreDifferentPairs(pastCamera.tag, m_ActiveCamera.tag, "vc_Environment", "vc_Agent") || AreDifferentPairs(pastCamera.tag, m_ActiveCamera.tag, "vc_Environment", "vc_Body")
|
||||
|| AreDifferentPairs(pastCamera.tag, m_ActiveCamera.tag, "vc_Environment", "vc_Environment") || AreDifferentPairs(pastCamera.tag, m_ActiveCamera.tag, "vc_Body", "vc_Body") || AreDifferentPairs(pastCamera.tag, m_ActiveCamera.tag, "vc_Actuations", "vc_Body")
|
||||
|| AreDifferentPairs(pastCamera.tag, m_ActiveCamera.tag, "vc_Actuations", "vc_Environment") || AreDifferentPairs(pastCamera.tag, m_ActiveCamera.tag, "vc_Actuations", "vc_Agent") || AreDifferentPairs(pastCamera.tag, m_ActiveCamera.tag, "vc_Actuations", "vc_Actuations"))
|
||||
|| AreDifferentPairs(pastCamera.tag, m_ActiveCamera.tag, "vc_Actuations", "vc_Environment") || AreDifferentPairs(pastCamera.tag, m_ActiveCamera.tag, "vc_Actuations", "vc_Agent") || AreDifferentPairs(pastCamera.tag, m_ActiveCamera.tag, "vc_Actuations", "vc_Actuations") || AreDifferentPairs(pastCamera.tag, m_ActiveCamera.tag, "vc_Actuations", "vc_Compare")
|
||||
|| AreDifferentPairs(pastCamera.tag, m_ActiveCamera.tag, "vc_Compare", "vc_Compare") || AreDifferentPairs(pastCamera.tag, m_ActiveCamera.tag, "vc_Environment", "vc_Compare") || AreDifferentPairs(pastCamera.tag, m_ActiveCamera.tag, "vc_Body", "vc_Compare"))
|
||||
blendtime = 0;
|
||||
|
||||
cmBrain.m_DefaultBlend.m_Time = blendtime;
|
||||
|
||||
55
Assets/8_Scripts/1_Managers/GizmoManager.cs
Normal file
55
Assets/8_Scripts/1_Managers/GizmoManager.cs
Normal file
@@ -0,0 +1,55 @@
|
||||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using UnityEngine;
|
||||
using UnityEngine.VFX;
|
||||
|
||||
[ExecuteInEditMode]
|
||||
public class GizmoManager : MonoBehaviour
|
||||
{
|
||||
public GameObject m_VFX;
|
||||
private LineRenderer lineRenderer;
|
||||
|
||||
void Start(){
|
||||
lineRenderer = this.GetComponent<LineRenderer>();
|
||||
lineRenderer.startWidth = 0.2f;
|
||||
lineRenderer.endWidth = 0.2f;
|
||||
//lineRenderer.material = new Material(Shader.Find("Sprites/Default"));
|
||||
//lineRenderer.material.color = Color.yellow;
|
||||
}
|
||||
|
||||
void Update(){
|
||||
DrawWireframe(m_VFX);
|
||||
}
|
||||
|
||||
void DrawWireframe(GameObject m_Smoke){
|
||||
|
||||
Bounds m_SmokeBounds = m_Smoke.GetComponent<Renderer>().bounds;
|
||||
|
||||
Vector3[] vertices = new Vector3[16];
|
||||
|
||||
// Calculate the vertices of the box
|
||||
vertices[0] = new Vector3(m_SmokeBounds.min.x, m_SmokeBounds.min.y, m_SmokeBounds.min.z);
|
||||
vertices[1] = new Vector3(m_SmokeBounds.max.x, m_SmokeBounds.min.y, m_SmokeBounds.min.z);
|
||||
vertices[2] = new Vector3(m_SmokeBounds.max.x, m_SmokeBounds.min.y, m_SmokeBounds.max.z);
|
||||
vertices[3] = new Vector3(m_SmokeBounds.min.x, m_SmokeBounds.min.y, m_SmokeBounds.max.z);
|
||||
vertices[4] = new Vector3(m_SmokeBounds.min.x, m_SmokeBounds.min.y, m_SmokeBounds.min.z);
|
||||
|
||||
vertices[5] = new Vector3(m_SmokeBounds.min.x, m_SmokeBounds.max.y, m_SmokeBounds.min.z);
|
||||
vertices[6] = new Vector3(m_SmokeBounds.max.x, m_SmokeBounds.max.y, m_SmokeBounds.min.z);
|
||||
vertices[7] = new Vector3(m_SmokeBounds.max.x, m_SmokeBounds.min.y, m_SmokeBounds.min.z);
|
||||
vertices[8] = new Vector3(m_SmokeBounds.max.x, m_SmokeBounds.max.y, m_SmokeBounds.min.z);
|
||||
|
||||
vertices[9] = new Vector3(m_SmokeBounds.max.x, m_SmokeBounds.max.y, m_SmokeBounds.max.z);
|
||||
vertices[10] = new Vector3(m_SmokeBounds.max.x, m_SmokeBounds.min.y, m_SmokeBounds.max.z);
|
||||
vertices[11] = new Vector3(m_SmokeBounds.max.x, m_SmokeBounds.max.y, m_SmokeBounds.max.z);
|
||||
vertices[12] = new Vector3(m_SmokeBounds.min.x, m_SmokeBounds.max.y, m_SmokeBounds.max.z);
|
||||
vertices[13] = new Vector3(m_SmokeBounds.min.x, m_SmokeBounds.min.y, m_SmokeBounds.max.z);
|
||||
vertices[14] = new Vector3(m_SmokeBounds.min.x, m_SmokeBounds.max.y, m_SmokeBounds.max.z);
|
||||
vertices[15] = new Vector3(m_SmokeBounds.min.x, m_SmokeBounds.max.y, m_SmokeBounds.min.z);
|
||||
|
||||
|
||||
lineRenderer.positionCount = vertices.Length;
|
||||
lineRenderer.SetPositions(vertices);
|
||||
|
||||
}
|
||||
}
|
||||
11
Assets/8_Scripts/1_Managers/GizmoManager.cs.meta
generated
Normal file
11
Assets/8_Scripts/1_Managers/GizmoManager.cs.meta
generated
Normal file
@@ -0,0 +1,11 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 2ea15476715398c499869b7cdc74bfa5
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
Reference in New Issue
Block a user