zoukankan      html  css  js  c++  java
  • Unity Collider Bounds and extents 调试

    using System;
    using System.Collections;
    using System.Collections.Generic;
    using UnityEngine;
    
    public class TestPhyCollider : MonoBehaviour
    {
        public Collider tree;
    
        public Vector3 scale = new Vector3(0.3f, 0.3f, 0.3f);
        public bool isExtent;
        public bool isSize;
    
        public void OnCollisionEnter(Collision other)
        {
        }
    
        public void OnDrawGizmos()
        {
            Gizmos.DrawCube(tree.bounds.center, scale);
    
            Gizmos.color = Color.blue;
            Gizmos.DrawCube(tree.bounds.max, scale);
            Gizmos.color = Color.yellow;
            Gizmos.DrawCube(tree.bounds.min, scale);
    
            if (isExtent)
            {
                Gizmos.color = Color.magenta;
                Gizmos.DrawCube(tree.bounds.center, tree.bounds.extents);
            }
    
            if (isSize)
            {
                Gizmos.color = Color.gray;
                Gizmos.DrawCube(tree.bounds.center, tree.bounds.size);
            }
    
            //下面一个点
            var center = tree.bounds.center;
            center.y = tree.bounds.min.y;
            Gizmos.DrawCube(center, scale);
            
            //后面一个点
            var center2 = tree.bounds.center;
            center2.z = tree.bounds.min.z;
            Gizmos.DrawCube(center2, scale);
            
            //前面一个点
            var center3 = tree.bounds.center;
            center3.z = tree.bounds.max.z;
            Gizmos.DrawCube(center3, scale);
            
            //左边一个点
            var center4 = tree.bounds.center;
            center4.x = tree.bounds.min.x;
            Gizmos.DrawCube(center4, scale);
            
            //右边一个点
            var center5 = tree.bounds.center;
            center5.x = tree.bounds.max.x;
            Gizmos.DrawCube(center5, scale);
            
        }
    }
    

      

  • 相关阅读:
    InputStream,String相互转化
    HttpGet
    MySQL重复数据
    JS获取地址栏参数的方法
    Java解析采集模块
    按键精灵多机型定时秒杀综合版提交脚本
    按键精灵手机版监控像素变换点击脚本
    按键精灵手机版定时点击脚本
    按键精灵获取系统时间定时点击
    window时间服务器 国内可用
  • 原文地址:https://www.cnblogs.com/plateFace/p/14177395.html
Copyright © 2011-2022 走看看