fyrox_animation/spritesheet/
signal.rs

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
//! Animation signal is used as a point at which to notify external observers that animation just
//! started to play a specific frame.

use crate::core::{reflect::prelude::*, visitor::prelude::*};
use fyrox_core::uuid_provider;

/// Animation signal is used as a point at which to notify external observers that animation just
/// started to play a specific frame.
#[derive(Visit, Reflect, Debug, Clone)]
pub struct Signal {
    /// Signal id. It should be used to distinguish different signals. For example, `JUMP` signal
    /// can have `id = 0`, while `CROUCH` signal - `id = 1`, etc.
    pub id: u64,

    /// Index of a frame at which to notify external observers.
    pub frame: u32,

    /// Is the signal enabled or not. Disabled signals won't produce any events.
    pub enabled: bool,
}

uuid_provider!(Signal = "30fd963f-4ce7-4dcc-bdff-691897267420");

impl Default for Signal {
    fn default() -> Self {
        Self {
            id: 0,
            frame: 0,
            enabled: true,
        }
    }
}