public virtual Platform_motor find_child_platforms() { Platform_motor motor = null; if (transform.childCount < 1) { debug.warning("la plataforma no tiene hijos"); } else { Transform platform = transform.GetChild(0); motor = platform.GetComponent <Platform_motor>(); } return(motor); }
public virtual void prepare_motor() { if (!motor) { motor = find_child_platforms(); } if (!motor) { debug.warning("no tiene un platform motor"); } else { controller = motor.GetComponent < chibi.controller.Controller_motor>(); } }