local _Target = vci.assets.GetTransform("Target") function update() -- 軸入力を取得する。 local axis = vci.me.GetAxisInput() -- 入力ログ if axis.x ~= 0 then print(" X : "..tostring(axis.x)) end if axis.y ~= 0 then print(" Y : "..tostring(axis.y)) end if axis.z ~= 0 then print(" Z : "..tostring(axis.z)) end -- Targetの移動 local pos = 0.01 * axis + _Target.GetLocalPosition() _Target.SetLocalPosition(pos) -- 入力取得 if vci.me.GetButtonInput(1) then print(" Button1 が押されました。") -- 回転処理 local rot = _Target.GetLocalRotation() rot = rot * Quaternion.AngleAxis(-30, Vector3.forward) _Target.SetLocalRotation(rot) end -- 入力取得 if vci.me.GetButtonInput(2) then print(" Button2 が押されました。") -- 回転処理 local rot = _Target.GetLocalRotation() rot = rot * Quaternion.AngleAxis(30, Vector3.forward) _Target.SetLocalRotation(rot) end -- 入力取得 if vci.me.GetButtonInput(3) then print(" Button3 が押されました。") -- 拡縮処理 local scale = _Target.GetLocalScale() if scale.x < 0.2 then return end scale = scale + Vector3.__new(-0.1, -0.1, -0.1) _Target.SetLocalScale(scale) end -- 入力取得 if vci.me.GetButtonInput(4) then print(" Button4 が押されました。") -- 拡縮処理 local scale = _Target.GetLocalScale() scale = scale + Vector3.__new(0.2, 0.2, 0.2) _Target.SetLocalScale(scale) end end