AirCraft Class Reference

In this example class we have three variables that are used to compute the effective lift. Since the effective lift computation is potentially expensive, we don't want to perform it every single update. So we use the DeltaAttributes to check for a change in the factor used to determine the effective lift. Only when one of these factors has changed, do we need to recompute the effective lift. If the factors don't change, the effective lift will remain constant, so we have no need to recompute.

Public Attributes

Atmosphere atmosphere
 
float effectiveLift
 
Rigidbody rigidBody
 
float wingLiftArea
 
- Public Attributes inherited from MonoDeltaDetectorUnityBase
DeltaMonitorUnityObject changeMonitor
 [SnippetDeltaMonitorUnityConstructor]
 

Protected Member Functions

override void DeltaDetected ()
 Derived classes should override this to define what happens when a change is detected.
 
override void Reset ()
 Instantiates the changeMonitor class.
 
override void Start ()
 Stores initial values for changeMonitor on Start. Also invokes DetectChanges() once, and resets changeMonitor's changeResult flag.
 
override void Update ()
 checks if any DeltaAttributed variables have changed, and if so calls the abstract DelktaDetected function. It then resets the changed state of all variables for next update.
 

Properties

float CurrentAltitude [get, set]
 
+ Inheritance diagram for AirCraft:
+ Collaboration diagram for AirCraft: