2010-01-09 11:20:14 -08:00
|
|
|
function TestScript1A() {}
|
|
|
|
|
|
2025-12-30 00:57:37 -08:00
|
|
|
TestScript1A.prototype.Init = function()
|
|
|
|
|
{
|
2010-01-09 11:20:14 -08:00
|
|
|
this.x = 100;
|
|
|
|
|
};
|
|
|
|
|
|
2025-12-30 00:57:37 -08:00
|
|
|
TestScript1A.prototype.GetX = function()
|
|
|
|
|
{
|
2010-01-09 11:20:14 -08:00
|
|
|
var test2 = Engine.QueryInterface(this.entity, IID_Test2);
|
|
|
|
|
return test2.GetX() + (test2.x || 0);
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
Engine.RegisterComponentType(IID_Test1, "TestScript1A", TestScript1A);
|
|
|
|
|
|
|
|
|
|
// -------- //
|
|
|
|
|
|
|
|
|
|
function TestScript2A() {}
|
|
|
|
|
|
2025-12-30 00:57:37 -08:00
|
|
|
TestScript2A.prototype.Init = function()
|
|
|
|
|
{
|
2010-01-09 11:20:14 -08:00
|
|
|
this.x = 200;
|
|
|
|
|
};
|
|
|
|
|
|
2025-12-30 00:57:37 -08:00
|
|
|
TestScript2A.prototype.GetX = function()
|
|
|
|
|
{
|
2010-01-09 11:20:14 -08:00
|
|
|
return this.x;
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
Engine.RegisterComponentType(IID_Test2, "TestScript2A", TestScript2A);
|