internal void Create(int objId, bool isPlayer) { m_ObjId = objId; m_Actor = GameObjectIdManager.Instance.GenNextId(); if (isPlayer) { GfxSystem.CreateGameObject(m_Actor, "BlueCylinder", m_ObjectInfo); } else { GfxSystem.CreateGameObject(m_Actor, "RedCylinder", m_ObjectInfo); } }
protected override ExecResult ExecCommand(IInstance instance, long delta) { if (instance.Target is GameEntity obj) { string effectPath = m_EffectPath; uint resId = IdSystem.Instance.GenId(IdEnum.Resource); Quaternion quaternion = Quaternion.Euler(0, Mathf.Rad2Deg * obj.rotation.Value, 0); if (string.IsNullOrEmpty(m_AttachPath)) { GfxSystem.CreateGameObject(resId, effectPath, obj.position.Value + quaternion * m_Pos, m_Euler + new Vector3(0, Mathf.Rad2Deg * obj.rotation.Value, 0), m_Scale, m_DeleteTime); } else { GfxSystem.CreateAndAttachGameObject(resId, effectPath, obj.resource.Value, m_AttachPath, m_IsAttach, quaternion * m_Pos, m_Euler, m_Scale, m_DeleteTime); } } return(ExecResult.Finished); }