Get the App
SLTechnology News&Howtos  ›  Internet Technology  › 

How to realize Flying to object completion event in TE

Shulou Source: shulou.com Published: 2022-06-01 03:37:54 10月03日 Update

This article is about how to implement the fly-to-object completion event in TE. The editor thinks it is very practical, so share it with you as a reference and follow the editor to have a look.

In the secondary development of TE, you can select an object and fly to the position of the object, in which you can add some other program operations. If you want to fly to the object and carry out a series of program operations, you need to define the object event of TE in the secondary development.

The following is an example of developing a fly-to-object completion event in CS. The specific code is as follows:

/ / define the event of the object

_ sgworld = new SGWorld66 ()

_ sgworld.OnObjectAction + = _ sgworld_OnObjectAction

/ / implementation of the event

String _ tempLabel = string.Empty; / / ID of the temporary record object

Void _ sgworld_OnObjectAction (string ObjectID, IAction66 Action)

{

/ / events judge all objects, so operate on temporary objects, and only if the object stops / /

If (_ tempLabel = = ObjectID & & Action.Code = = ActionCode.AC_STOP)

{

/ / get the object to stop and perform the next step

Dynamic _ lab = _ sgworld.Creator.GetObject (ObjectID)

_ tempLabel = string.Empty

}

}

/ / execute the fly to object event

{

Var _ tPos = _ sgworld.Creator.CreatePosition (_ disPint.X, _ disPint.Y, 0, AltitudeTypeCode.ATC_TERRAIN_RELATIVE, 0,-89,0500)

_ tempLabel = _ sgworld.Creator.CreateLabel (_ tPos, "", string.Empty) .ID

_ sgworld.Navigate.FlyTo (_ tempLabel)

}

This event also applies to flying to a location, and you need your own program to create a temporary object to judge that you have flown to a location.

Thank you for reading! This is the end of the article on "how to fly to the object completion event in TE". I hope the above content can be of some help to you, so that you can learn more knowledge. if you think the article is good, you can share it out for more people to see!

Tags: Object event location program development content more article good practical code situation article is in see knowledge Yu Fei reference help related Apple Docker Huawei Linux macOS MariaDB Microsoft MySQL NVidia OPPO Reno Shulou Tech Info vpn Huawei MySQL Linux