- OS: Windows 7
Build: as shipped
Version Number: 5.4 build 164
Standart Sky
Code: Select all
[code]
#include "StdAfx.h"
#include "WeaponComponent.h"
#include <CrySchematyc/Env/IEnvRegistrar.h>
#include <CrySchematyc/Env/Elements/EnvComponent.h>
///You must register your component first
static void RegisterMuhWayponComponent(Schematyc::IEnvRegistrar& registrar)
{
Schematyc::CEnvRegistrationScope scope = registrar.Scope(IEntity::GetEntityScopeGUID());
{
Schematyc::CEnvRegistrationScope componentScope = scope.Register(SCHEMATYC_MAKE_ENV_COMPONENT(CWeaponComponent));
}
}
CRY_STATIC_AUTO_REGISTER_FUNCTION(&RegisterMuhWayponComponent);
void CWeaponComponent::Initialize()
{
}
uint64 CWeaponComponent::GetEventMask() const
{
///EventMasks' must be registeredto be effective. Their types (timer,collision etc) must be described here
/// Start with the game and keep updating
return BIT64(ENTITY_EVENT_START_GAME) | BIT64(ENTITY_EVENT_UPDATE);
}
void CWeaponComponent::ProcessEvent(SEntityEvent & Event)
{
}
void CWeaponComponent::ReflectType(Schematyc::CTypeDesc<CWeaponComponent>& desc)
{
desc.SetGUID("{10FCE876-2D76-4084-BBD4-FBBBAD562791}"_cry_guid);
////Place and decriptions in Editor
desc.SetEditorCategory("Tutorial Component");
desc.SetLabel("Weapon Component");
desc.SetDescription("This is a tutorial weapon component desu");
////Basic behavior as an Component. You can move it around, put it into "sockets" and attach it
desc.SetComponentFlags({ IEntityComponent::EFlags::Transform, IEntityComponent::EFlags::Socket, IEntityComponent::EFlags::Attach });
desc.AddMember(&CWeaponComponent::sWeaponProps,'swp', "Weapon Properties", "Weapon Properties", "", SWeaponProperties());
}
void ReflectType(Schematyc::CTypeDesc<SWeaponProperties>& desc)
{
desc.SetGUID("{5C573F40-73B7-4F2D-8352-ED1FA32D27B0}"_cry_guid);
desc.SetLabel("Weapon Properties");
desc.SetDescription("Very Adjustable Values");
desc.AddMember(&SWeaponProperties::iRecoil, 'irec', "Recoil", "Recoil Amount", "Recoil amount of the weapon", 0);
desc.AddMember(&SWeaponProperties::iReloadSpeed, 'irel', "Reload", "Reload Speed", "Reload speed of the weapon", 0);
desc.AddMember(&SWeaponProperties::sGeom, 'sgeo', "Geomoetry", "Geometry File", "Please chose a cgf file", "");
}
void CWeaponComponent::StartFire()
{
}
void CWeaponComponent::StopFire()
{
}
void CWeaponComponent::Reload()
{
}[/code]
Return to “CRYENGINE Feedback”
Users browsing this forum: No registered users and 1 guest