This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using UnityEngine; | |
public class MyComponent : MonoBehaviour { | |
void Update() { | |
Debug.Log("Update was called"); | |
} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <iostream> | |
using namespace std; | |
class GenericGreeter { | |
public: | |
void Greet(const char* name) { | |
cout << "Hi " << name << "." << endl; | |
} | |
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <iostream> | |
using namespace std; | |
class GenericGreeter { | |
public: | |
virtual void Greet(const char* name) { | |
cout << "Hi " << name << "." << endl; | |
} | |
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <iostream> | |
using namespace std; | |
struct GenericGreeterVTable { | |
void (*GreetFn) (void*, const char*) | |
}; | |
class GenericGreeter { | |
public: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <iostream> | |
using namespace std; | |
class GenericGreeter { | |
public: | |
void Greet(const char* name) { | |
cout << "Hi " << name << "." << endl; | |
} | |
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class GenericGreeter { | |
public: | |
virtual void Greet(const char* name) { | |
cout << "Hi " << name << "." << endl; | |
} | |
}; | |
class FriendlyGreeter : public GenericGreeter { | |
public: | |
virtual void Greet(const char* name) { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <iostream> | |
using namespace std; | |
// Our Greet function type. | |
typedef void (GreetFn)(void*, const char* name); | |
struct GenericGreeter_VTable { | |
GreetFn* greet; | |
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class GenericGreeter { | |
public: | |
virtual void Greet(const char* name) { | |
cout << "Hi " << name << "." << endl; | |
} | |
virtual void Dismiss(const char* name) { | |
cout << "Bye " << name << "." << endl; | |
} | |
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
typedef void (GreetFn)(void*, const char* name); | |
struct GenericGreeter_VTable { | |
GreetFn* greet; | |
GreetFn* dismiss; | |
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
GenericGreeter_VTable* GetVTable(GenericGreeter* obj) { | |
GenericGreeter_VTable** vtable_ptr = (GenericGreeter_VTable**)obj; | |
return *(vtable_ptr); | |
} |
OlderNewer