示例#1
0
 // Start is called before the first frame update
 void Start()
 {
     av                   = transform.parent.GetComponent <Avoidance>();
     col                  = GetComponent <BoxCollider>();
     detectRect           = gameObject.AddComponent <RectTransform>();
     detectRect.sizeDelta = new Vector2(col.size.x, col.size.z);
 }
示例#2
0
 void Awake()
 {
     rb         = gameObject.GetComponent <Rigidbody>();
     mechDriver = GetComponent <MechDriver>();
     avoid      = GetComponent <Avoidance>();;
 }