public override EFuncRet FuncExecHandler(HandleTarget Target, FuncData funcdata, FuncContext context) { try { ThriftVector3 pos = new ThriftVector3(); pos.X = funcdata.ParamIntList[0]; pos.Y = funcdata.ParamIntList[1]; pos.Z = funcdata.ParamIntList[2]; ThriftVector3 rot = new ThriftVector3(); rot.X = 0; rot.Y = funcdata.ParamIntList[3]; rot.Z = 0; ThriftVector3 scal = new ThriftVector3(); scal.X = funcdata.ParamIntList[4]; scal.Y = funcdata.ParamIntList[4]; scal.Z = funcdata.ParamIntList[4]; GameObject elem = EffectContainer.EffectFactory(funcdata.ParamStringList[0]); elem.transform.position = pos.GetVector3(); elem.transform.eulerAngles = rot.GetVector3(); elem.transform.localScale = scal.GetVector3(); } catch { } return(EFuncRet.Continue); }
public void CreateNpcById(int id, ThriftVector3 pos, ThriftVector3 rot, ThriftVector3 scale) { //check if (m_NpcMap.ContainsKey(id)) { Debuger.LogWarning("already exist npc id " + id); return; } Npc newNpc = new Npc(); newNpc.Initialize(id); newNpc.GetTransformData().SetPosition(pos.GetVector3()); newNpc.GetTransformData().SetRotation(rot.GetVector3()); newNpc.GetTransformData().SetScale(scale.GetVector3()); newNpc.SetAIStatus(true); m_NpcMap.Add(id, newNpc); }