#[auto_system]Expand description
Automatically adds the fn as a system for bevy app. (See below for additional options) Automatically registers a system to be added to the app.
§Parameters
plugin = PluginType- Required. Specifies which plugin should register this system.schedule = ScheduleName- Required. Specifies which schedule to add the system to.generics(T1, T2, ...)- Optional. Specifies concrete types for generic parameters.config(..)in_set = SetName- Optional. Seebevy IntoScheduleConfigs in_setbefore = SetName or system- Optional. Seebevy IntoScheduleConfigs beforeafter = SetName or system- Optional. Seebevy IntoScheduleConfigs afterrun_if = Condition- Optional. Seebevy IntoScheduleConfigs run_ifdistributive_run_if = Condition- Optional. Seebevy IntoScheduleConfigs run_if_innerambiguous_with = System- Optional. Seebevy IntoScheduleConfigs ambiguous_withambiguous_with_all = bool- Optional. Seebevy IntoScheduleConfigs ambiguous_with_allafter_ignore_deferred = SetName or system- Optional. Seebevy IntoScheduleConfigs after_ignore_deferredbefore_ignore_deferred = SetName or system- Optional. Seebevy IntoScheduleConfigs before_ignore_deferred
§Example
use bevy::prelude::*;
use bevy_auto_plugin::prelude::*;
#[derive(AutoPlugin)]
#[auto_plugin(impl_plugin_trait)]
struct MyPlugin;
#[derive(Resource, Debug, Default)]
struct FooResource(usize);
#[auto_system(plugin = MyPlugin, schedule = Update)]
fn foo_system(mut foo_res: ResMut<FooResource>) {
foo_res.0 += 1;
}§Example (with system set)
use bevy::prelude::*;
use bevy_auto_plugin::prelude::*;
#[derive(SystemSet, Debug, Hash, PartialEq, Eq, Clone)]
enum TestSet { First, Second }
#[derive(AutoPlugin)]
#[auto_plugin(impl_plugin_trait)]
struct MyPlugin;
#[derive(Resource, Debug, Default)]
struct FooResource(usize);
#[auto_system(plugin = MyPlugin, schedule = Update, config(in_set = TestSet::First))]
fn foo_system(mut foo_res: ResMut<FooResource>) {
foo_res.0 += 1;
}