Method crash for load Particle System in the C# Code

#1
I use CryEngine 5.4.0 Build 164 Final

Problem :
*I wrote this code , also my resource is exist / ff.pfx and *.cgf

using System;
using CryEngine.UI;
using CryEngine.UI.Components;
using CryEngine.Resources;

namespace CryEngine.Game
{
// [EntityClass("","Game",null,"prompt.bmp",false)]
public class MyRock:EntityComponent
{

public ParticleManager pm;

public string _prock2="ff.pfx";
[EntityProperty(EntityPropertyType.Particle)]
public string Rock2
{
set{
_prock2 = value;
ReloadRock();
}
get{

return _prock2;
}
}




public string _rock="objects/default/primitive_box.cgf";
[EntityProperty(EntityPropertyType.Geometry)]
public string Rock
{
set{
_rock = value;
ReloadRock();
}
get{

return _rock;
}
}



public float _mass=21f;
[EntityProperty]
public float Mass
{
set{
_mass = value;
ReloadRock();
}
get{

return _mass;
}
}


public void OnInitialize()
{
ReloadRock ();

}

public void OnGameplayStart()
{
ReloadRock ();
}

public void ReloadRock()
{
Mouse.ShowCursor ();
Entity.LoadGeometry(0,_rock);
Entity.LoadParticleEmitter (0, pm.FindEffect (_prock2), 3f);
Entity.Physics.Physicalize (_mass,Common.EPhysicalizationType.ePT_Rigid);

}



}

}

please solve it

thank you
C++ Programmer
https://www.youtube.com/AhmadKarami

Who is online

Users browsing this forum: No registered users and 1 guest

cron