public void Read(BinaryReader reader) { Log.Detail("reading profile " + name); String nameOfBehavior = reader.ReadString(); Log.Trace("profile behavior name read: " + nameOfBehavior); behaviour = ProfileBehaviour.GetProfileBehaviourForName(nameOfBehavior); if (behaviour == null) { Log.Warning("behavior '" + nameOfBehavior + "' not found"); behaviour = ProfileBehaviour.NOTHING; } enabled = reader.ReadBoolean(); }
private void SwitchProfile(Profile profile) { // no gauges, no profile... if (NanoGauges.gauges == null) { return; } // Log.Info("switching to profile " + profile.name); if (enabled && profile.enabled) { ProfileBehaviour behaviour = profile.GetBehaviour(); behaviour.ActivateProfile(); } }
private void Start() { GameObject canvas = GameObject.Find("Canvas"); profile = canvas.GetComponentInChildren <ProfileBehaviour>(); settings = canvas.GetComponentInChildren <SettingsBehaviour>(); level_choice = canvas.GetComponentInChildren <LevelChoice>(); key_binding_options = canvas.GetComponentInChildren <KeyBindingOptions>(); settings.Start_(); profile.Shown = false; settings.Shown = false; level_choice.Shown = false; key_binding_options.Shown = false; }
private void ChangeProfile(Profile profile) { ProfileBehaviour behaviour = profile.GetBehaviour(); if (Event.current.button == 0) { // left mouse button Log.Detail("choosing next behaviour for profile " + profile.name); profile.SetBehaviour(behaviour.next); } else { // not left mouse button Log.Detail("choosing previous behaviour for profile " + profile.name); profile.SetBehaviour(behaviour.prev); } }
public void SetBehaviour(ProfileBehaviour behaviour) { this.behaviour = behaviour; }