void Start() { groundController = GetComponentInChildren <GroundController>(); ceilingController = GetComponentInChildren <CeilingController>(); leftWallController = GetComponentInChildren <LeftWallController>(); rightWallController = GetComponentInChildren <RightWallController>(); frontWallController = GetComponentInChildren <FrontWallController>(); backWallController = GetComponentInChildren <BackWallController>(); }
///<summary> /// Get all components ///</summary> protected void GetComponents(Animator animator) { this.animator = animator; body = animator.gameObject.GetComponent <Rigidbody2D>(); playerController = animator.gameObject.GetComponent <PlayerController2D>(); groundController = animator.gameObject.GetComponent <GroundController>(); ceilingController = animator.gameObject.GetComponent <CeilingController>(); climbableController = animator.gameObject.GetComponent <ClimbableController>(); }