protected void Awake() { if (cldr == null) { Debug.Log("Add a collider", this); } if (damageable == null) { damageable = GetComponent <Damageable>(); } if (damager == null) { damager = GetComponent <Damager>(); } if (obstComp == null) { obstComp = GetComponent <ObstacleComponent>(); } if (pusher == null) { pusher = GetComponent <Pusher>(); } if (rb == null) { rb = GetComponent <Rigidbody2D>(); } initialPos = this.transform.localPosition; }
private void Awake() { if (component == null) { component = GetComponent <ObstacleComponent>(); Debug.Log("Forgot to reference", this); } if (damager == null) { damager = GetComponent <Damager>(); Debug.Log("Forgot to reference", this); } if (pusher == null) { pusher = GetComponent <Pusher>(); Debug.Log("Forgot to reference", this); } }