private void DrawTimers(GUIStyle styleStats)
    {
      bool isSimulating = SimulationManager.IsSimulating();
      bool isReplaying  = SimulationManager.IsReplaying();
      bool isSimulatingOrReplaying = isSimulating || isReplaying;
      TimeSpan tRT;
      TimeSpan tSim;
      if (isSimulatingOrReplaying)
      {
        tRT  = TimeSpan.FromSeconds( SimulationManager.GetSimulatingRealTime() );
        tSim = TimeSpan.FromSeconds( SimulationManager.GetTimeSimulated() );


        SceneView.RepaintAll();
      }
      else
      {
        tRT  = TimeSpan.FromSeconds( 0 );
        tSim = TimeSpan.FromSeconds( 0 );
      }

      string tRTString = string.Format("{0:D2}h:{1:D2}m:{2:D2}s:{3:D3}ms", 
                                         tRT.Hours, 
                                         tRT.Minutes, 
                                         tRT.Seconds, 
                                         tRT.Milliseconds);
      EditorGUILayout.LabelField("Real time: ", tRTString, styleStats);

      string tSimString = string.Format("{0:D2}h:{1:D2}m:{2:D2}s:{3:D3}ms", 
                                         tSim.Hours, 
                                         tSim.Minutes, 
                                         tSim.Seconds, 
                                         tSim.Milliseconds);
      EditorGUILayout.LabelField("Simulated time: ", tSimString, styleStats);
    }
Beispiel #2
0
        //-----------------------------------------------------------------------------------
        public void UpdateSimulating()
        {
            if (SimulationManager.IsReplaying())
            {
                ChangeToReplayingModeDone();
            }

            UpdateTimeSlider();
        }
Beispiel #3
0
    public void BroadcastStart( bool doDisplayInvisibles )
    {
      doDisplayInvisibleBodies_ = doDisplayInvisibles;

      bool isSimulating = SimulationManager.IsSimulating();
      bool isReplaying  = SimulationManager.IsReplaying();

      if ( (isSimulating || isReplaying) )
      {
        listBodyGOEnabledVisible_ .Clear();
        listBodyGODisabledVisible_.Clear();
        listBodyGOEnabledHide_    .Clear();
        listBodyGODisabledHide_   .Clear();
        listBodyGOSleeping_       .Clear();
      }
    }
    public void CreateJointPivotBoxes()
    {
      if ( fxData_.DrawJoints && listJointGroupsInfo_ != null )
      {
        fxData_.ClearJointMeshes();

        int nJointGroups = listJointGroupsInfo_.Count;

        bool isReplaying = SimulationManager.IsReplaying();
        bool drawOnlySelected = fxData_.DrawOnlySelected;

        for (int i = 0; i < nJointGroups; i++)
        {
          ClearJointsBounds();
          JointGroupsInfo jgInfo = listJointGroupsInfo_[i];
          uint idJointGroups = jgInfo.idEntity_;

          List<JointPivotInfo> listJointPivot = jgInfo.listJointPivotInfo_;
          int nJointPivot = listJointPivot.Count;

          if ( isReplaying && drawOnlySelected && 
               !fxData_.listJointGroupsIdsSelected_.Contains(idJointGroups) &&
               !fxData_.listRigidGlueIdsSelected_.Contains(idJointGroups) )
          {
            continue;
          }

          for (int j = 0; j < nJointPivot; j++)
          {
            CreateJointPivotBounds(listJointPivot[j], fxData_.JointsSize);
          }

          GenerateJointsMeshes( idJointGroups );

        }

        SceneView.RepaintAll();
      }

      UpdateListJointsRequested = false;
    }