Difference between revisions of "State exit/ja"

From Second Life Wiki
Jump to navigation Jump to search
 
Line 6: Line 6:
|caveats=
|caveats=
* {{LSLG/ja|state_exit}} の間にキューに入ったイベントは、次の state に入る前に捨てられます。これを避けるために、なるべく {{LSLG/ja|state_entry}} を使いましょう。 {{LSLG/ja|state}} にさらに警告が載っています。
* {{LSLG/ja|state_exit}} の間にキューに入ったイベントは、次の state に入る前に捨てられます。これを避けるために、なるべく {{LSLG/ja|state_entry}} を使いましょう。 {{LSLG/ja|state}} にさらに警告が載っています。
|examples=<lsl>default
|examples=<source lang="lsl2">default
{
{
     state_entry()
     state_entry()
Line 36: Line 36:
         llOwnerSay("leaving state \"other\"");
         llOwnerSay("leaving state \"other\"");
     }
     }
}</lsl>
}</source>
|helpers
|helpers
|also_header
|also_header

Latest revision as of 10:21, 21 February 2016

説明

イベント: state_exit( ){ ; }

state を遷移させるときに発生します。


警告

  • state_exit の間にキューに入ったイベントは、次の state に入る前に捨てられます。これを避けるために、なるべく state_entry を使いましょう。 state にさらに警告が載っています。

サンプル

default
{
    state_entry()
    {
        llOwnerSay("in default state");
    }
    touch_start(integer detected)
    {
        state other;
    }
    state_exit()
    {
        llOwnerSay("leaving default state");
    }
}

state other
{
    state_entry()
    {
        llOwnerSay("in state \"other\"");
    }
    touch_start(integer detected)
    {
        state default;
    }
    state_exit()
    {
        llOwnerSay("leaving state \"other\"");
    }
}

注意点

スクリプトがリセットされたときに defaultstate_entry が発生しますが、リセットの前に state_exit は発生しません。

この翻訳は 原文 と比べて古いですか?間違いがありますか?読みにくいですか?みんなで 修正 していきましょう! (手順はこちら)
この項目はあなたにとって参考にならない項目ですか?もしかしたらLSL Wikiの関連した項目が参考になるかもしれません。