コード例 #1
0
ファイル: MoveTool.cs プロジェクト: zachary2234/gamebuilder
 public UndoState(VoosActor actor)
 {
     position      = actor.GetPosition();
     rotation      = actor.GetRotation();
     spawnPosition = actor.GetSpawnPosition();
     spawnRotation = actor.GetSpawnRotation();
     enablePhysics = actor.GetEnablePhysics();
 }
コード例 #2
0
ファイル: ScaleTool.cs プロジェクト: zachary2234/gamebuilder
 void UpdateScale(VoosActor actor, Vector3 newscale)
 {
     actor.SetLocalScale(newscale);
     if (actor.GetLocalScale().x < MIN_SCALE)
     {
         actor.SetLocalScale(Vector3.one * MIN_SCALE);
     }
 }
コード例 #3
0
    public void SetActorsWithOffsets(VoosActor _actorA, Vector3 _localOffsetA, VoosActor _actorB, Vector3 _localOffsetB)
    {
        actorA = _actorA;
        actorB = _actorB;

        offsetA = _localOffsetA;
        offsetB = _localOffsetB;
    }
コード例 #4
0
    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);
    }
コード例 #5
0
ファイル: EditMain.cs プロジェクト: zachary2234/gamebuilder
    private void UpdateHoverActor(VoosActor newActor)
    {
        hoverActor = newActor;

        hoverFeedback.SetActor(newActor);
        currentTool?.SetHoverActor(hoverActor);
        UpdatetReticleLabel();
    }
コード例 #6
0
 void OnCloseContent(bool noActor)
 {
     content.Close();
     if (noActor)
     {
         this.currActor = null;
     }
 }
コード例 #7
0
 private void AttemptRemovePanel(VoosActor actor)
 {
     if (currentPanels.ContainsKey(actor))
     {
         currentPanels[actor].RequestDestruct();
         currentPanels.Remove(actor);
     }
 }
コード例 #8
0
 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();
 }
コード例 #9
0
 public void SetActor(VoosActor actor, int indent = 0)
 {
     Clear();
     this.actor  = actor;
     this.indent = indent;
     UpdateUi();
     UpdateActorLocked();
 }
コード例 #10
0
 private void SetActor(VoosActor actor)
 {
     SetCurrActor(actor);
     logicSidebarUI.label.text = actor?.GetDisplayName();
     if (usingCardView)
     {
         cardTab.Open(actor);
     }
 }
コード例 #11
0
 private void SetActorInternal(VoosActor actor)
 {
     currActor = actor;
     if (currActor != null)
     {
         BreakLinkIfCloneParentMissing();
     }
     RefreshUI();
 }
コード例 #12
0
    void SetActorOffset(VoosActor actor, Vector3 vec)
    {
        Vector3 oldPos = actor.GetRenderableOffset();

        undoStack.PushUndoForActor(actor,
                                   $"Set actor offset",
                                   (undoActor) => undoActor.SetRenderableOffset(vec),
                                   (undoActor) => undoActor.SetRenderableOffset(oldPos));
    }
コード例 #13
0
 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?
 }
コード例 #14
0
 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);
     }
 }
コード例 #15
0
    private void UpdateIsPlayingAsRobot()
    {
        VoosActor playerActor = GetPlayerActor();

        if (playerActor == null || userBody == null)
        {
            return;
        }
        userBody.SetIsPlayingAsRobot(playerActor.GetRenderableUri() == VoosActor.AVATAR_EXPLORER_URI);
    }
コード例 #16
0
ファイル: Transforms.cs プロジェクト: zachary2234/gamebuilder
        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
        }
コード例 #17
0
    private void SetSpawnToCurrentPosition()
    {
        VoosActor actor = editMain.GetSingleTargetActor();

        if (actor == null)
        {
            return;
        }
        SetActorSpawnPosition(actor, actor.GetPosition(), true, actor.GetTransformParent());
    }
コード例 #18
0
ファイル: Services.cs プロジェクト: zachary2234/gamebuilder
        bool IsScriptReadyActor(Collider collider)
        {
            VoosActor actor = collider.GetComponentInParent <VoosActor>();

            if (actor == null)
            {
                return(false);
            }
            return(true);
        }
コード例 #19
0
 public void Open(VoosActor actor)
 {
     currActor = actor;
     if (currActor == null)
     {
         throw new System.Exception("Actor not set");
     }
     isShowing = true;
     currTabRef.tabController.Open(currActor);
 }
コード例 #20
0
ファイル: Transforms.cs プロジェクト: zachary2234/gamebuilder
        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();
        }
コード例 #21
0
    /*
     * 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();
        }
    }
コード例 #22
0
    private void SetCurrentParent()
    {
        VoosActor actor = editMain.GetSingleTargetActor();

        SelectActor((selectedActor) =>
        {
            bool autosetParent = AutosetSpawn();
            SetCurrentParentForActor(actor, selectedActor, undoStack, autosetParent);
        });
    }
コード例 #23
0
 void OnActorCreated(VoosActor actor)
 {
     if (!monitoringActors)
     {
         Debug.LogError("Shouldn't get OnActorCreated when not monitoring actors...");
         return;
     }
     StartMonitoringActor(actor);
     listNeedsRefresh = true;
 }
コード例 #24
0
 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
     });
 }
コード例 #25
0
    private InWorldLogPanel GetOrAddPanel(VoosActor actor)
    {
        if (!currentPanels.ContainsKey(actor))
        {
            InWorldLogPanel newPanel = Instantiate(logPanelPrefab, canvasRect);
            newPanel.Setup(actor, this);
            currentPanels[actor] = newPanel;
        }

        return(currentPanels[actor]);
    }
コード例 #26
0
 private void SelectActor(VoosActor actor, bool forceShowInfo = false)
 {
     if (forceShowInfo)
     {
         editMain.SelectInfoTool();
     }
     listNeedsRefresh = true;
     selectedActors.Clear();
     selectedActors.Add(actor);
     editMain.TryForceSelectingActor(actor);
 }
コード例 #27
0
    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)
            );
    }
コード例 #28
0
ファイル: ScanEffect.cs プロジェクト: zachary2234/gamebuilder
    public void Scan(VoosActor actor)
    {
        Debug.Assert(actor != null);

        if (scanRoutine != null)
        {
            StopCoroutine(scanRoutine);
        }
        scanRoutine = StartCoroutine(ScanRoutine(actor));
        audioSource.Play();
    }
コード例 #29
0
    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);
    }
コード例 #30
0
    private void SetSpawnToCurrentPosition()
    {
        VoosActor actor = editMain.GetSingleTargetActor();

        if (actor == null)
        {
            return;
        }

        SetActorSpawnRotation(actor, GetActorRotation(actor));
    }