Example #1
0
            private void UpdateIntensity(bool inserted, HipThrust hipAction)
            {
                float hipIntensity = hipAction.GetHipIntensity() * 0.08f;

                float addIntensity = 0.0f;

                if (hipIntensity > 0)
                {
                    addIntensity += hipIntensity;
                    addIntensity -= activity.intensityDecay * 0.2f * 1.0f / (1.4f - activity.intensity);
                }
                else
                {
                    addIntensity -= activity.intensityDecay * 1.5f;
                }

                activity.desiredIntensity = hipIntensity * 10.0f;

                activity.intensity += addIntensity * Time.deltaTime;
                activity.intensity  = Mathf.Clamp(activity.intensity, 0, activity.maxIntensity);
            }
Example #2
0
        public override void Init()
        {
            try
            {
                emotionEngine = Utils.GetPluginStorableById(containingAtom, "EmotionEngine") as EmotionEngine;

                hipAction = Utils.GetPluginStorableById(containingAtom, "HipThrust") as HipThrust;

                breatheAction = Utils.GetPluginStorableById(containingAtom, "Breathe") as Breathe;

                gaze = Utils.GetPluginStorableById(containingAtom, "Gaze") as Gaze;

                oMeter = Utils.GetPluginStorableById(containingAtom, "OMeter") as OMeter;

                gaze.SetReference(containingAtom.name, "eyeTargetControl");
                gaze.SetLookAtPlayer(-0.10f * Vector3.up);
                gaze.SetGazeDuration(0.2f);

                idle       = new Idle(this);
                sex        = new Sex(this);
                climax     = new Climax(this);
                refractory = new Refractory(this);

                hipState = new StateMachine();

                JSONStorableString debugState = new JSONStorableString("debugState", "");
                CreateTextField(debugState);

                hipState.onStateChanged += (State previous, State next) =>
                {
                    debugState.val = next.ToString();
                };

                hipState.Switch(idle);
            }
            catch (Exception e)
            {
                SuperController.LogError("Exception caught: " + e);
            }
        }