npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

dragv-cli-service-3d

v0.0.27

Published

服务

Downloads

29

Readme

unity3D接口记录

各类型id前缀

如果模型id是 model-uLve0o9pKn

model,//远程模型
heatingArea,//热力区
signModel,//标识
flyLine,//单条飞线
rflyLine,//辐射飞线
cflyLine,//连续飞线
routPoint,//路径点
fproutPoint,//第一人称路径点
circleZone,//圆形区域
squareZone,//长方形区域
polygonZone,//多边形区域

场景配置

方法:ChangeEnvironment(string data) 场景还可以新增preview参数,preview:true 场景事件/操作正常、preview:flase 场景事件/无法操作。 push到 gui场景配置数组 中,gui场景配置数组.push({name:"preview", value: false})。

unityProvider.send('ReceiveFrontManager', 'ChangeEnvironment', JSON.stringify(gui场景配置数组))

配置分辨率

方法:SetResolution(string size)

unityProvider.send('ReceiveFrontManager', 'SetResolution', '1920x1080');

点击生成某个物体 新增单个模型 返回物体信息

方法:CreateObject(string json) 回调:ClickCreateObject(string json)

// 新增
unityProvider.send('ReceiveFrontManager', 'CreateObject', JSON.stringify({
    components:{"模型id":"模型配置对象"}, //只传输创建的这个模型对象,非所有
    layout:[{当前模型层}] //只传输创建的这个模型层,非所有
}));


// 返回物体信息 回调下载模型后,新增的这个模型参数
unityProvider.on("ClickCreateObject",(string json)=>{
    json为上面传输的数据再返回过来,回来后,再调用 CreateAllObject(string json)//生成全部物体 
})

设置多个或者单个物体显隐

方法:SetShowHide(string json: {string[] ids,int type}) ids:["model-1213213"] type:1显示 2隐藏 3显隐切换 time:1 //渐隐渐显时间

unityProvider.send('ReceiveFrontManager', 'SetShowHide', JSON.stringify({
    ids:["model-1213213"], 
    type:1,
    time:1
}));

设置场景视角

方法:SetCamera(int type) type:1上帝视角 2第一人称

unityProvider.send('ReceiveFrontManager', 'SetCamera', 1);

注视某个物体

方法:SetLookTartget(string id)

unityProvider.send('ReceiveFrontManager', 'SetLookTartget', '"model-1213213"');

二维 / 三维界面选中某个模型

方法:FrontSelectObject(string id) 回调:SelectObject(string id)

// 二维界面选中某个模型
unityProvider.send('ReceiveFrontManager', 'FrontSelectObject', 'model-1213213');

// 三维界面选中某个模型
unityProvider.on("SelectObject",(string id))=>{
    返回的选中id
})

二维界面修改某个模型配置信息

方法:UpdateObjectInfo(string data)

unityProvider.send('ReceiveFrontManager', 'UpdateObjectInfo', JSON.stringify({
    components:{"模型id":"模型配置对象"}, //只传输创建的这个模型对象,非所有
    layout:[{当前模型层}] //只传输创建的这个模型层,非所有,可以为空数组
}));

三维界面修改某个模型配置信息 返回物体修改后的最新数据

回调:UpdateObject(string json)

unityProvider.on("UpdateObject",(string json)=>{
    json为上面传输的数据一样
})

触发事件

回调:EventTrigger(string data) 目前事件有 onclick 、 ondblclick、onmouseover、onmouseout

unityProvider.on("EventTrigger ,(string data)=>{
    id 是当前事件触发的模型id
    eventname 事件名称
})

触发回调

回调:EventCallBack(string data) 目前事件有 onclick 、 ondblclick、onmouseover、onmouseout

unityProvider.on("EventCallBack ,(string data)=>{
    id 是当前事件触发的模型id
    eventname 事件名称
})

生成所有三维物体

方法:CreateAllObject(string data)

unityProvider.send('ReceiveFrontManager', 'CreateAllObject', JSON.stringify({
    components:{"模型id":"模型配置对象",...}, //所有模型对象
    layout:[{当前模型层},...] //所有模型层
}));

设置快捷键

方法:GetInputKey(string key) key参数为 KeyboardEvent 中的 e.key

unityProvider.send('ReceiveFrontManager', 'GetInputKey', e.key)

unity初始化成功后执行

回调:UnityInit()

unityProvider.on("UnityInit",()=>{
    // 这里面才能执行unity定义的方法
})

设置选中的模型 移动、旋转、缩放

方法:SetTransformGizo(int type) type : 类型1移动2旋转3缩放

unityProvider.send('ReceiveFrontManager', 'SetTransformGizo', 1)

设置某个物体文字修改

方法:ObjectText(string data) data : { id:string, text:string }

unityProvider.send('ReceiveFrontManager', 'ObjectText', JSON.stringify({
    id:string, 
    text:string
}))

进度条进度

回调:UpdateProcess(float value) value:0.25

unityProvider.on("UpdateProcess" ,(value)=>{
    value //数字进度
})

三维物体创建完成后回调,一般用于创建后 选中组件

回调:ObjCreateComplete(string str) value:0.25

unityProvider.on("ObjCreateComplete" ,(str)=>{
    str //id
})

多条飞线的话,需要返回新的飞线数据,方便下一次点击创建新的飞线

方法:FlyLineCreate(string data)

unityProvider.send('ReceiveFrontManager', 'FlyLineCreate', JSON.stringify({
    components:{"模型id":"模型配置对象",...}, //所有模型对象
    layout:[{当前模型层},...] //所有模型层
}));

切换场景

方法:CreateScene(string name) TestScene Build ChengDuScene

unityProvider.send('ReceiveFrontManager', 'CreateScene', 'TestScene');

切换场景距离

方法:SetCameraDistance(string dis)

unityProvider.on("SetCameraDistance" ,(dis)=>{
    str //数字
})

开启debug

方法:SetDebug(string on)

unityProvider.send('ReceiveFrontManager', 'SetDebug', 'false');

如果开启gis数据后,需要发送gis数据

方法:GISPos(string data)

unityProvider.send('ReceiveFrontManager', 'GISPos', JSON.stringify({
    id:"模型id",   //模型id
    data:[{},...]  //当前模型gis数据
}));