// Use this for initialization void Start() { EventReportsManager.Subscribe <SetLocation>(SetLocationCallback); EventReportsManager.Subscribe <SetDestroy>(SetDestroyCallback); EventReportsManager.Subscribe <DamageResultLite>(SetDamageResultLiteCallback); EventReportsManager.Subscribe <SetRestore>(SetRestoreCallback); EventReportsManager.Subscribe <SetPosture>(SetPostureCallback); //delete and put a reference in the inspector if this script is only used for the infantry. WalkingModel = PublishedEntity.GetComponent <WalkingModel>(); }
private void Awake() { infantryLife = PublishedEntity.GetComponent <InfantryLife>(); device = gameObject.GetComponent <Device>(); infantryLife.OnDeath += () => { if (device.Selected) { SendDeployFoldStruct(EventReports.DeployFoldDevice.Action.START_FOLD); SendDeployFoldStruct(EventReports.DeployFoldDevice.Action.END_FOLD); } }; }