"use strict";exports.__esModule=!0,exports.createPoint=exports.PointEffectType=void 0;var _tool=require("../../../unity/tool"),_modelApi=require("../../../unity/model-api"),_lodash=require("lodash");const defaultWarningSetting={size:5,offsetY:5,intensity:1,frequency:2,animSpeed:.5,color:(0,_tool.createUnityColor)("#ff0000ff")},defaultFireSetting={intension:1,color:(0,_tool.createUnityColor)("#ff0000ff")};let PointEffectType=exports.PointEffectType=function(a){return a.Fire="Fire",a.Warning="Warning",a}({});const createPoint=async(a,b)=>{var c,d;let e;if(a.effectType===PointEffectType.Fire)e=(0,_lodash.merge)(defaultFireSetting,a.setting?a.setting:{});else if(a.effectType===PointEffectType.Warning)e=(0,_lodash.merge)(defaultWarningSetting,a.setting?a.setting:{});else throw new Error("\u672A\u77E5 `\u70B9\u7279\u6548` \u7C7B\u578B\uFF1A"+a.effectType);const{ID:f}=await b.unity.invoke(_modelApi.REQUEST_TYPE.CreatPointEffect,{EffectType:a.effectType,SpaceID:a.spaceID,Position:{X:a.position.x,Y:a.position.y,Z:a.position.z},Setting:{Size:e.size,OffsetY:e.offsetY,Intensity:e.intensity,Frequency:e.frequency,AnimSpeed:e.animSpeed,Intension:e.intension,Color:null!==(c=a.setting)&&void 0!==c&&c.color?(0,_tool.createUnityColor)(null===(d=a.setting)||void 0===d?void 0:d.color):e.color}});return{id:f,remove:()=>{b.unity.invoke(_modelApi.REQUEST_TYPE.RemovePointEffect,{Ids:[f]})}}};exports.createPoint=createPoint;