if vci.assets.IsMine then -- 呼び出したユーザーが代表して初期化する vci.state.Set('switch', 0) end function updateAll() -- 所有権に関係なく全ユーザーに来る --print(vci.state.Get('switch')) if vci.state.Get('switch')==1 then vci.assets.SetMaterialColorFromIndex(4, Color.__new(1, 0, 0, 1)) else vci.assets.SetMaterialColorFromIndex(4, Color.__new(0.5, 0.5, 0.5, 1)) end end function onUse(use) print('use') vci.state.Set('switch', 1) end function onUnuse(use) print('unuse') vci.state.Set('switch', 0) end