void Start() { lineRenderer = gameObject.AddComponent <LineRenderer>(); colliderSphere = GetComponent <_ColliderSphere>(); rigidbody = GetComponent <_Rigidbody>(); lineRenderer.startWidth = 0; lineRenderer.endWidth = 0.2f; lineRenderer.enabled = false; lineRenderer.material = lineMaterial; }
public _Collision(Vector3 collisionPoint, float collisionRange, Vector3 normalUnit, _Collider other) { this.collisionPoint = collisionPoint; this.collisionRange = collisionRange; this.normalUnit = normalUnit; collider = other; gameObject = other.gameObject; transform = other.transform; rigidbody = other.GetComponent <_Rigidbody>(); if (rigidbody != null && !rigidbody.enabled) { rigidbody = null; } }
// --|-- Metodos --|-- // --> Unity protected virtual void Awake() { rigidBody = GetComponent <_Rigidbody>(); _CollisionManager.getInstance().AddCollider(this); }