// 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);
 }
Exemple #2
0
 void Awake()
 {
     rb         = gameObject.GetComponent <Rigidbody>();
     mechDriver = GetComponent <MechDriver>();
     avoid      = GetComponent <Avoidance>();;
 }