Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

How to realize Flying to object completion event in TE

2025-02-24 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Internet Technology >

Share

Shulou(Shulou.com)06/01 Report--

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!

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Internet Technology

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report