// Use this for initialization void Start() { cameraController = GameObject.Find("Main Camera").GetComponent <CameraController>(); scriptLoader = new ScriptLoader(); Verse = new Verse(); SpriteController spriteController = gameObject.AddComponent <SpriteController>(); spriteController.Load(); string pathXml = Path.Combine(Application.streamingAssetsPath, "Data/Prototypes/Parts.xml"); Verse.registry.partRegistry.ReadPrototypes(pathXml); pathXml = Path.Combine(Application.streamingAssetsPath, "Data/Prototypes/Entities.xml"); Verse.registry.entityRegistry.ReadPrototypes(pathXml); gameObject.AddComponent <GUIController>(); shipController = gameObject.AddComponent <ShipController>(); gameObject.AddComponent <InputController>(); VerseComponent verseComponent = gameObject.AddComponent <VerseComponent>(); Verse.register(verseComponent); GameObject overlay = new GameObject("Overlay"); overlay.transform.SetParent(cameraController.transform); overlayComponent = overlay.AddComponent <OverlayComponent>(); Verse.register(overlayComponent); galaxy = new GameObject("StarMap"); GalaxyComponent galaxyComponent = galaxy.AddComponent <GalaxyComponent>(); galaxyComponent.Camera = GameObject.Find("MapCamera").GetComponent <Camera>(); galaxyComponent.vert = starmapVertex; galaxyComponent.starPathMaterial = starmapEdgeMaterial; Verse.Galaxy.register(galaxyComponent); Verse.Create(); Verse.SetMap("Health"); SetMode(ViewMode.Ship); }
public override bool Run() { List <ObjectListPickerInfo> Entries = ListExpressions(); string text = (string)ObjectListPickerDialog.Show("Expression", Entries); if (text != null && text != "") { ReactionTypes reaction = (ReactionTypes)Enum.Parse(typeof(ReactionTypes), text); Array reactionTypes = Enum.GetValues(typeof(ReactionTypes)); CustomOverlayData data = null; CmoPoseBox box = PoseManager.FindPoseBox(); string poseData = PoseManager.GetCurrentPose(Actor); if (poseData == null) { return(false); } Actor.LookAtManager.DisableLookAts(); PoseManager.SetCurrentPose(Actor, poseData); box.PlaySoloAnimation(Actor.SimDescription.IsHuman, Actor, poseData, true, ProductVersion.BaseGame); Actor.ResetAllAnimation(); Actor.OverlayComponent.UpdateInteractionFreeParts(AwarenessLevel.OverlayFace);//OverlayUpperbody); StateMachineClient stateMachineClient = StateMachineClient.Acquire(Actor.ObjectId, "facial_idle", AnimationPriority.kAPDefault, true); data = (CustomOverlayData)OverlayComponent.GetOverlayData(reaction, Actor); stateMachineClient.UseActorBridgeOrigins = false; stateMachineClient.SetActor("x", Actor); stateMachineClient.RemoveEventHandler(new SacsEventHandler(Actor.OverlayComponent.InteractionPartLevelCallback)); stateMachineClient.RemoveEventHandler(new SacsEventHandler(Actor.OverlayComponent.ClearInteractionPartLevelCallback)); stateMachineClient.EnterState("x", "Enter"); stateMachineClient.SetProductVersion(data.ProductVersion); stateMachineClient.RequestState("x", data.AnimClipName); //Actor.OverlayComponent.UpdateInteractionFreeParts(AwarenessLevel.OverlayFace); box.PlaySoloAnimation(Actor.SimDescription.IsHuman, Actor, poseData, true, ProductVersion.BaseGame); Actor.ResetAllAnimation(); Actor.WaitForExitReason(3.40282347E+38f, ExitReason.UserCanceled); Actor.LookAtManager.EnableLookAts(); return(true); } return(false); }
// Use this for initialization void Start() { PreInit(); World = new World(200, 200); world.SetRegistry(); GameObject worldObject = new GameObject(); WorldComponent worldComponent = worldObject.AddComponent <WorldComponent>(); GameObject overlayObject = new GameObject(); OverlayComponent overlayComponent = overlayObject.AddComponent <OverlayComponent>(); world.Connect(worldComponent); world.Connect(overlayComponent); world.Generate(); cameraController.Center(); }
public Text(KeybinderCore core) { _core = core; _overlayComponent = core.GetComponent <OverlayComponent>(); _id = -1; _value = String.Empty; _oldValue = String.Empty; _valueBeforeEdit = String.Empty; _exampleValue = String.Empty; _color = 0xFFFFFFFF; _size = 12; _x = 0; _y = 0; _active = false; _useMaxWidth = false; _useMaxHeight = false; _maxWidth = 0; _maxHeight = 0; }
private bool DoSingleRouteEx(Route r, bool bAllowOverlays) { Common.StringBuilder msg = new Common.StringBuilder("DoSingleRouteEx"); try { mbRouteLeadInPlaying = false; if ((bAllowOverlays && (r.GetDistanceRemaining() > TraitTuning.RouteDistanceForIdle)) && !r.GetOption(Route.RouteOption.DisableRouteLeadIns)) { if (!mOwnerSim.IsHoldingAnything() && RandomUtil.RandomChance01(TraitTuning.ChanceForRouteLeadIn)) { mOwnerSim.OverlayComponent.UpdateInteractionFreeParts(AwarenessLevel.OverlayUpperbody); uint segmentAtDistanceBeforeEnd = r.GetSegmentAtDistanceBeforeEnd(SimScriptAdaptor.DistanceToStopOverlay, true); r.RegisterCallback(OnAboutToFinishRoute, RouteCallbackType.TriggerOnce, RouteCallbackConditions.EnteringSegment(segmentAtDistanceBeforeEnd)); r.RegisterCallback(OnRouteFinished, RouteCallbackType.TriggerOnce, new RouteCallbackCondition(RouteCallbackConditions.Ended)); mbRouteLeadInPlaying = mOwnerSim.IdleManager.PlayRouteLeadIn(); if (mbRouteLeadInPlaying) { OverlayComponent overlayComponent = mOwnerSim.OverlayComponent; overlayComponent.OverlaysEnded += OnOverlaysEnded; } } if (mOwnerSim.IsHuman) { mOwnerSim.OverlayComponent.PlayReaction(ReactionTypes.FacialAutoSelect, null); } } if (mOwnerSim.IsHorse || mOwnerSim.IsDeer) { r.RegisterCallback(HorseDeerRoutingEffectsCallback, RouteCallbackType.TriggerWhileTrue, new RouteCallbackCondition(RouteCallbackConditions.AnimationTriggeredEvent)); } else if ((mOwnerSim.IsPuppy || mOwnerSim.IsKitten) && SeasonsManager.Enabled) { r.RegisterCallback(PuppyKittenSnowLevelCallback, RouteCallbackType.TriggerOnTrue, new RouteCallbackCondition(RouteCallbackConditions.InDeepSnow)); r.RegisterCallback(PuppyKittenSnowLevelCallback, RouteCallbackType.TriggerOnTrue, new RouteCallbackCondition(RouteCallbackConditions.InShallowSnow)); } bool flag = false; IHasScriptProxy destObj = r.DestObj; try { flag = RoutingComponentEx.DoRoute(this, r); float maxMinutesToWaitForRouteLeadIn = SimScriptAdaptor.MaxMinutesToWaitForRouteLeadIn; DateAndTime previousDateAndTime = SimClock.CurrentTime(); while (mbRouteLeadInPlaying && (SimClock.ElapsedTime(TimeUnit.Minutes, previousDateAndTime) < maxMinutesToWaitForRouteLeadIn)) { SpeedTrap.Sleep(); } if (UsingStroller) { new GetOutOfStrollerRouteAction(mOwnerSim, r).PerformAction(); } } finally { if (mbRouteLeadInPlaying) { mbRouteLeadInPlaying = false; OverlayComponent component2 = mOwnerSim.OverlayComponent; component2.OverlaysEnded -= OnOverlaysEnded; mOwnerSim.OverlayComponent.StopAllOverlays(); } try { mOwnerSim.IdleManager.StopFacialIdle(true); } catch (Exception e) { Common.Exception(mOwnerSim, e); } if (UsingStroller) { new GetOutOfStrollerRouteAction(mOwnerSim, r).PerformAction(); } } if (!flag || !mOwnerSim.HasExitReason(ExitReason.ObjectStateChanged)) { return(flag); } if (r.DoRouteFail) { InteractionInstance currentInteraction = mOwnerSim.CurrentInteraction; if ((currentInteraction != null) && (currentInteraction.Target != null)) { mOwnerSim.PlayRouteFailure(currentInteraction.Target.GetThoughtBalloonThumbnailKey()); } else { mOwnerSim.PlayRouteFailure(); } } } catch (ResetException) { throw; } catch (Exception e) { Common.Exception(mOwnerSim, e); } return(false); }