mirror of
https://git.kittycat.homes/zoe/codename-routes.git
synced 2024-08-15 03:18:26 +00:00
setup native script
This commit is contained in:
parent
b0a9525111
commit
c8046a6e85
9 changed files with 44 additions and 4 deletions
|
@ -1 +1,9 @@
|
|||
use gdnative::prelude::*;
|
||||
|
||||
mod stateserver;
|
||||
|
||||
fn init(handle: InitHandle) {
|
||||
handle.add_class::<stateserver::StateServer>();
|
||||
}
|
||||
|
||||
godot_init!(init);
|
||||
|
|
18
routes-native/src/stateserver.rs
Normal file
18
routes-native/src/stateserver.rs
Normal file
|
@ -0,0 +1,18 @@
|
|||
use gdnative::prelude::*;
|
||||
|
||||
#[derive(NativeClass)]
|
||||
#[inherit(Node)]
|
||||
pub struct StateServer;
|
||||
|
||||
#[methods]
|
||||
impl StateServer {
|
||||
fn new(_owner: &Node) -> Self {
|
||||
StateServer
|
||||
}
|
||||
|
||||
#[export]
|
||||
fn _ready(&self, _owner: &Node) {
|
||||
godot_print!("hello, state")
|
||||
}
|
||||
}
|
||||
|
Loading…
Add table
Add a link
Reference in a new issue