// Use this for initialization void Awake () { roboController = GetComponentInParent<RobotController> (); if (roboController == null) { Debug.LogWarning("Robot component '" + name + "' is not attached to a robot controller!"); } else { powerSource = roboController.GetComponentInChildren<AbstractPowerSource>(); } if (roboController == null) { Debug.LogWarning("Robot component '" + name + "' has no power source!"); } }
// Use this for initialization void Awake() { roboController = GetComponentInParent <RobotController> (); if (roboController == null) { Debug.LogWarning("Robot component '" + name + "' is not attached to a robot controller!"); } else { powerSource = roboController.GetComponentInChildren <AbstractPowerSource>(); } if (roboController == null) { Debug.LogWarning("Robot component '" + name + "' has no power source!"); } }