mirror of
https://github.com/FlightControl-Master/MOOSE.git
synced 2025-10-29 16:58:06 +00:00
Final
This commit is contained in:
@@ -32,6 +32,7 @@
|
|||||||
do
|
do
|
||||||
|
|
||||||
--- @type SPOT
|
--- @type SPOT
|
||||||
|
-- @extends BASE
|
||||||
SPOT = {
|
SPOT = {
|
||||||
ClassName = "SPOT",
|
ClassName = "SPOT",
|
||||||
}
|
}
|
||||||
@@ -49,6 +50,7 @@ do
|
|||||||
|
|
||||||
self:SetStartState( "Off" )
|
self:SetStartState( "Off" )
|
||||||
self:AddTransition( "Off", "LaseOn", "On" )
|
self:AddTransition( "Off", "LaseOn", "On" )
|
||||||
|
self:AddTransition( "On", "Lasing", "On" )
|
||||||
self:AddTransition( "On" , "LaseOff", "Off" )
|
self:AddTransition( "On" , "LaseOff", "Off" )
|
||||||
|
|
||||||
self.Recce = Recce
|
self.Recce = Recce
|
||||||
@@ -64,23 +66,38 @@ do
|
|||||||
-- @param From
|
-- @param From
|
||||||
-- @param Event
|
-- @param Event
|
||||||
-- @param To
|
-- @param To
|
||||||
-- @param Core.Point#POINT_VEC3 PointVec3
|
-- @param Wrapper.Positionable#POSITIONABLE Target
|
||||||
-- @param #number LaserCode
|
-- @param #number LaserCode
|
||||||
-- @param #number Duration
|
-- @param #number Duration
|
||||||
-- @return #SPOT
|
function SPOT:onafterLaseOn( From, Event, To, Target, LaserCode, Duration )
|
||||||
function SPOT:onafterLaseOn( From, Event, To, PointVec3, LaserCode, Duration )
|
|
||||||
|
|
||||||
local function StopLase( self )
|
local function StopLase( self )
|
||||||
self:LaseOff()
|
self:LaseOff()
|
||||||
end
|
end
|
||||||
|
|
||||||
|
self.Target = Target
|
||||||
|
self.LaserCode = LaserCode
|
||||||
|
|
||||||
local RecceDcsUnit = self.Recce:GetDCSObject()
|
local RecceDcsUnit = self.Recce:GetDCSObject()
|
||||||
local TargetVec3 = PointVec3:GetVec3()
|
self.Spot = Spot.createInfraRed( RecceDcsUnit, { x = 0, y = 2, z = 0 }, Target:GetPointVec3():AddY(1):GetVec3(), LaserCode )
|
||||||
self:E("lasing")
|
self.Spot:setCode( LaserCode )
|
||||||
self.Spot = Spot.createInfraRed( RecceDcsUnit, { x = 0, y = 2, z = 0 }, TargetVec3, LaserCode )
|
|
||||||
if Duration then
|
if Duration then
|
||||||
self.ScheduleID = self.LaseScheduler:Schedule( self, StopLase, {self}, Duration )
|
self.ScheduleID = self.LaseScheduler:Schedule( self, StopLase, {self}, Duration )
|
||||||
end
|
end
|
||||||
|
|
||||||
|
self:__Lasing( -0.2 )
|
||||||
|
end
|
||||||
|
|
||||||
|
--- @param #SPOT self
|
||||||
|
-- @param From
|
||||||
|
-- @param Event
|
||||||
|
-- @param To
|
||||||
|
function SPOT:onafterLasing( From, Event, To )
|
||||||
|
|
||||||
|
self:__Lasing( -0.2 )
|
||||||
|
self.Spot:setPoint( self.Target:GetPointVec3():AddY(1):GetVec3() )
|
||||||
|
|
||||||
end
|
end
|
||||||
|
|
||||||
--- @param #SPOT self
|
--- @param #SPOT self
|
||||||
@@ -97,6 +114,9 @@ do
|
|||||||
end
|
end
|
||||||
self.ScheduleID = nil
|
self.ScheduleID = nil
|
||||||
|
|
||||||
|
self.Target = nil
|
||||||
|
self.LaserCode = nil
|
||||||
|
|
||||||
return self
|
return self
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user