Exemplo n.º 1
0
            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();
            }
Exemplo n.º 2
0
 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();
     }
 }
Exemplo n.º 3
0
    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;
    }
Exemplo n.º 4
0
            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);
                }
            }
Exemplo n.º 5
0
 public void SetBehaviour(ProfileBehaviour behaviour)
 {
     this.behaviour = behaviour;
 }