public override void OnEnter() { activity.gaze.SetLookAtPlayer(-1.4f * Vector3.up); activity.gaze.SetGazeDuration(0.2f); EmotionEngine em = activity.emotionEngine; em.panting.Stop(); em.breathingActive.Stop(); em.breathingIdle.Stop(); activity.emotionEngine.eyelidControl.SetBoolParamValue("blinkEnabled", false); }
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); } }
public override void OnUpdate() { UpdateIntensity(activity.inserted, activity.hipAction); EmotionEngine em = activity.emotionEngine; if (em.CanPlay()) { em.SelectExpression(activity.intensity, activity.maxIntensity, activity.desiredIntensity); } if (activity.intensity >= (activity.maxIntensity - 0.005f)) { stateMachine.Switch(activity.climax); } if (activity.intensity <= 0.8f && activity.hipAction.GetHipIntensity() < 0.01f) { stateMachine.Switch(activity.idle); } bool headSelected = false; FreeControllerV3 control = activity.containingAtom.GetStorableByID("headControl") as FreeControllerV3; if (control != null && control.currentPositionState == FreeControllerV3.PositionState.ParentLink) { headSelected = true; } if (headSelected == false) { activity.gaze.SetReference(activity.containingAtom.name, "eyeTargetControl"); activity.gaze.SetLookAtPlayer(-0.1f * Vector3.up); activity.gaze.SetGazeDuration(0.3f); } }