Jump to content
Search In
  • More options...
Find results that contain...
Find results in...

Call a custom function on hitinfo entity


Recommended Posts

I want to call the custom function in a c++ class ... I have one more question. I don't know which is better. I've created a custom actor class. This class creates an entity within itself and attaches itself to it. Should I use this, or should I create an entity, also create a custom actor and then assign that actor to that entity? I gave an example below.

//Header
class EnemyBaseActor : public Actor {
public:
    EnemyBaseActor();
};
//CPP
EnemyBaseActor::EnemyBaseActor(){
    this->entity = Model::Load("Models/Zombie.mdl"); 
    this->entity->SetActor(this);   
}

OR

// In the main ex.
Entity* myEntity = Model::Load("Models/Zombie.mdl");
Actor* zombieActor = new EnemyBaseActor(); //My custom actor.
myEntity->SetActor(zombieActor);
//zombieActor->Release(); // It's doesn't work. So i didn'n write it.

it works in two ways, but which one is right?

Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...