// ----------------------------------
// RSDK Project: Sonic 2
// Script Description: Object Activator Object
// Script Author: Christian Whitehead/Simon Thomley
// Unpacked by Rubberduckycooly's script unpacker
// ----------------------------------

// This object's name isn't very descriptive, so while it does "activate" objects,
// it's usually used on both sides of a Spiral Path obj to make sure its active

// ========================
// Events
// ========================

event ObjectUpdate
	arrayPos0 = object.propertyValue
	object[+arrayPos0].priority = PRIORITY_ACTIVE
end event


// ========================
// Editor Events
// ========================

event RSDKDraw
	DrawSprite(0)
	
	if editor.showGizmos == true
		editor.drawingOverlay = true
		
		// Draw a line to the object that'll be activated
		
		arrayPos0 = object.propertyValue
		DrawArrow(object.xpos, object.ypos, object[+arrayPos0].xpos, object[+arrayPos0].ypos, 252, 252, 0)
		
		editor.drawingOverlay = false
	end if
end event


event RSDKLoad
	LoadSpriteSheet("Global/Display.gif")
	SpriteFrame(-8, -8, 16, 16, 168, 18) // "Trigger" - #0
	
	SetVariableAlias(ALIAS_VAR_PROPVAL, "activateSlot")
end event
