Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- using System.Collections.Generic;
- using System.Linq;
- using System.Text;
- using UnityEngine;
- namespace Assets.Unity.Utils
- {
- public class TriggerAreaRender : MonoBehaviour
- {
- [SerializeField]
- private Material material;
- private Collider baseMesh;
- private void Start()
- {
- baseMesh = GetComponent<Collider>();
- }
- private void OnDrawGizmos()
- {
- if (material != null)
- {
- Gizmos.color = material.color;
- }
- else
- {
- Gizmos.color = new Color(1, 0, 0, 0.5F);
- }
- baseMesh = GetComponent<Collider>();
- Gizmos.DrawCube(transform.position, baseMesh.bounds.size);
- }
- }
- }
Add Comment
Please, Sign In to add comment