public UndoState(VoosActor actor) { position = actor.GetPosition(); rotation = actor.GetRotation(); spawnPosition = actor.GetSpawnPosition(); spawnRotation = actor.GetSpawnRotation(); enablePhysics = actor.GetEnablePhysics(); }
void UpdateScale(VoosActor actor, Vector3 newscale) { actor.SetLocalScale(newscale); if (actor.GetLocalScale().x < MIN_SCALE) { actor.SetLocalScale(Vector3.one * MIN_SCALE); } }
public void SetActorsWithOffsets(VoosActor _actorA, Vector3 _localOffsetA, VoosActor _actorB, Vector3 _localOffsetB) { actorA = _actorA; actorB = _actorB; offsetA = _localOffsetA; offsetB = _localOffsetB; }
private void HandleBehaviorException(VoosEngine.BehaviorLogItem item) { MaybeNotifyUserOfBehaviorError(item); VoosActor actor = voosEngine.GetActor(item.actorId); string behDesc = GetBehaviorTitle(actor.GetBrainName(), item.useId); CommandTerminal.HeadlessTerminal.Buffer.HandleLog($"<color=yellow>[{actor.GetDisplayName()} '{behDesc}' on{item.messageName}:{item.lineNum}]</color> <color=red>{item.message}</color>", TerminalLogType.Error, null); }
private void UpdateHoverActor(VoosActor newActor) { hoverActor = newActor; hoverFeedback.SetActor(newActor); currentTool?.SetHoverActor(hoverActor); UpdatetReticleLabel(); }
void OnCloseContent(bool noActor) { content.Close(); if (noActor) { this.currActor = null; } }
private void AttemptRemovePanel(VoosActor actor) { if (currentPanels.ContainsKey(actor)) { currentPanels[actor].RequestDestruct(); currentPanels.Remove(actor); } }
public void PushTo(VoosActor actor) { string[] tags = joinedTags.Split(new char[] { ' ', ',', '\n' }); tags = Array.FindAll(tags, tag => tag != ""); actor.SetTags(tags); // HACK FOR CLONES actor.ApplyPropertiesToClones(); }
public void SetActor(VoosActor actor, int indent = 0) { Clear(); this.actor = actor; this.indent = indent; UpdateUi(); UpdateActorLocked(); }
private void SetActor(VoosActor actor) { SetCurrActor(actor); logicSidebarUI.label.text = actor?.GetDisplayName(); if (usingCardView) { cardTab.Open(actor); } }
private void SetActorInternal(VoosActor actor) { currActor = actor; if (currActor != null) { BreakLinkIfCloneParentMissing(); } RefreshUI(); }
void SetActorOffset(VoosActor actor, Vector3 vec) { Vector3 oldPos = actor.GetRenderableOffset(); undoStack.PushUndoForActor(actor, $"Set actor offset", (undoActor) => undoActor.SetRenderableOffset(vec), (undoActor) => undoActor.SetRenderableOffset(oldPos)); }
public void MaybeShow(VoosActor actor) { if (playerControllableWizard.WantToShow(actor)) { playerControllableWizard.Show(actor); } // Other wizards would go here as "else if"s. // Enemy wizard? Item wizard? }
private void OnActorDestroyedOrUncontrollable(VoosActor actor) { if (userMain != null && userMain.GetPlayerActor() == actor) { // Our current actor is destroyed, so migrate over to a placeholder for now, // until Update() figures out where we should move next. TransferUserTo(null); } }
private void UpdateIsPlayingAsRobot() { VoosActor playerActor = GetPlayerActor(); if (playerActor == null || userBody == null) { return; } userBody.SetIsPlayingAsRobot(playerActor.GetRenderableUri() == VoosActor.AVATAR_EXPLORER_URI); }
public void PushTo(VoosActor actor) { actor.SetSpawnPosition(position); actor.SetSpawnRotation(rotation); VoosActor parent = actor.GetEngine().GetActor(parentName); actor.SetSpawnTransformParent(IsValidSpawnParent(actor, parent) ? parentName : null); // NOTE: No need to call ApplyPropertiesToClones because that function // doesn't copy this anyway }
private void SetSpawnToCurrentPosition() { VoosActor actor = editMain.GetSingleTargetActor(); if (actor == null) { return; } SetActorSpawnPosition(actor, actor.GetPosition(), true, actor.GetTransformParent()); }
bool IsScriptReadyActor(Collider collider) { VoosActor actor = collider.GetComponentInParent <VoosActor>(); if (actor == null) { return(false); } return(true); }
public void Open(VoosActor actor) { currActor = actor; if (currActor == null) { throw new System.Exception("Actor not set"); } isShowing = true; currTabRef.tabController.Open(currActor); }
public void PushTo(VoosActor actor) { Vector3 rotEuler = actor.GetRenderableRotation().eulerAngles; rotEuler.y = yaw; actor.SetRenderableRotation(Quaternion.Euler(rotEuler.x, rotEuler.y, rotEuler.z)); actor.SetRenderableOffset(offset); // HACK FOR CLONES actor.ApplyPropertiesToClones(); }
/* * private void SetMassDrag(float value) * { * actor.SetDrag(value); * RefreshClones(); * } * * private void SetMassDrag(string value) * { * float numValue; * if (float.TryParse(value, out numValue)) * { * numValue = Mathf.Clamp01(numValue); * actor.SetDrag(numValue); * RefreshClones(); * } * } */ public override void Open(VoosActor actor, Dictionary <string, object> props) { base.Open(actor, props); this.actor = actor; if (actor != null) { UpdateActorValues(); } }
private void SetCurrentParent() { VoosActor actor = editMain.GetSingleTargetActor(); SelectActor((selectedActor) => { bool autosetParent = AutosetSpawn(); SetCurrentParentForActor(actor, selectedActor, undoStack, autosetParent); }); }
void OnActorCreated(VoosActor actor) { if (!monitoringActors) { Debug.LogError("Shouldn't get OnActorCreated when not monitoring actors..."); return; } StartMonitoringActor(actor); listNeedsRefresh = true; }
public void PlaySoundEffect(SoundEffect sfx, VoosActor actor, Vector3 position) { PlaySoundEffectLocal(sfx, actor, position); unreliableMessageSystem.Send <SfxPlayRequest>(NetworkingEventCodes.SFX, new SfxPlayRequest { actorName = actor != null ? actor.GetName() : null, sfxId = sfx.id, position = position }); }
private InWorldLogPanel GetOrAddPanel(VoosActor actor) { if (!currentPanels.ContainsKey(actor)) { InWorldLogPanel newPanel = Instantiate(logPanelPrefab, canvasRect); newPanel.Setup(actor, this); currentPanels[actor] = newPanel; } return(currentPanels[actor]); }
private void SelectActor(VoosActor actor, bool forceShowInfo = false) { if (forceShowInfo) { editMain.SelectInfoTool(); } listNeedsRefresh = true; selectedActors.Clear(); selectedActors.Add(actor); editMain.TryForceSelectingActor(actor); }
void SetActorOffset(VoosActor actor, Vector3 vec) { Quaternion oldRot = actor.GetRenderableRotation(); undoStack.PushUndoForActor( actor, $"Set actor offset", (undoActor) => undoActor.SetRenderableRotation(Quaternion.Euler(vec)), (undoActor) => undoActor.SetRenderableRotation(oldRot) ); }
public void Scan(VoosActor actor) { Debug.Assert(actor != null); if (scanRoutine != null) { StopCoroutine(scanRoutine); } scanRoutine = StartCoroutine(ScanRoutine(actor)); audioSource.Play(); }
bool IsActorCenterOnScreen(VoosActor actor) { Vector3 viewportPosition = mainCamera.WorldToViewportPoint(actor.GetWorldRenderBoundsCenter()); // Debug.Log(actor.GetDisplayName() + ":" + viewportPosition); return(viewportPosition.x >= 0 && viewportPosition.x <= 1 && viewportPosition.y >= 0 && viewportPosition.y <= 1 && viewportPosition.z > 0); }
private void SetSpawnToCurrentPosition() { VoosActor actor = editMain.GetSingleTargetActor(); if (actor == null) { return; } SetActorSpawnRotation(actor, GetActorRotation(actor)); }