public class MyScript : Bolt.EntityBehaviour{ private Rigidbody rb; public override void Attached() { rb = GetComponent (); if (rb == null) { BoltLog.Warn("Rigidbody not found on entity"); } } }
public class MyScript : Bolt.EntityBehaviourIn this example, the script retrieves a custom component called 'MyCustomComponent' attached to the entity. If the component is not found, a warning message is printed to the console. Package/library: Bolt.{ private MyCustomComponent customComponent; public override void Attached() { customComponent = GetComponent (); if (customComponent == null) { BoltLog.Warn("Custom component not found on entity"); } } }