private void Awake()
    {
        _texture = new Texture2D(2, 2, TextureFormat.RGBA32, false);
        SetPlaybackState(PlaybackState.Paused);
        _currentFrame = 0;
        playbackObjects.SetActive(false);
        _playbackUpdate = new CustomFixedUpdate(OnPlaybackUpdate, 15);

        var capturesDir = string.Format("{0}/gameplay_capture/", Application.persistentDataPath);

        if (!Directory.Exists(capturesDir))
        {
            captureOptionsText.text = "No captures";
            return;
        }

        var captureDirs = Directory.GetDirectories(capturesDir);

        if (captureDirs.Length == 0)
        {
            captureOptionsText.text = "No captures";
            return;
        }

        _captureDirs             = captureDirs;
        captureOptionsText.text  = "0-" + (captureDirs.Length - 1);
        captureNoInputField.text = (_captureDirs.Length - 1).ToString();

        LoadCapture(captureDirs.Length - 1);
    }
Exemple #2
0
        static void Awake(BehaviorManager __instance)
        {
            MyMod.SetUpdateRate = rate =>
            {
                CustomFixedUpdate updateDelegate =
                    ModUtilities.GetFieldValue <CustomFixedUpdate>(__instance, "CircuitLogicUpdate");

                updateDelegate.updateRate = MyMod.CurrentUpdateRate = rate;
            };
        }
Exemple #3
0
 void Awake()
 {
     _CustomFixedUpdate       = new CustomFixedUpdate(1.0f / _raycastinRate, _FixedUpdate);
     _minimumNbTargetOnShadow = (_detectMode == DETECT_MODE.ONE) ? 1 : _targets.Count;
     if (_isAuto)
     {
         Lights = new List <Light>();
         Lights = FindObjectsOfType <Light>().ToList();
     }
 }
    private void Awake()
    {
        Instance = this;

        float CircuitUpdatesPerSecond = Settings.Get("CircuitUpdatesPerSecond", 100f);

        SetUpdateRate(CircuitUpdatesPerSecond);

        float MeshGroupRecalculationsPerSecond = Settings.Get("MaxMeshGroupRecalculationsPerSecond", 20f);

        MeshQueueing = new CustomFixedUpdate(QueueRecalculationForAppropriateDynamicMegaMeshGroups, MeshGroupRecalculationsPerSecond);
    }
 public void SetTimescale(float timescale)
 {
     TimeScale          = timescale;
     _customFixedUpdate = new CustomFixedUpdate((1 / _tickrate) / TimeScale, () => _framesToIterate++);
 }
 void Awake()
 {
     FU_instance = new CustomFixedUpdate(0.1f, OnFixedUpdate);
 }
Exemple #7
0
 void Start()
 {
     customFixedUpdate = new CustomFixedUpdate(projectileFiringPeriod, OnFixedUpdate);
 }
Exemple #8
0
	// Use this for initialization
	void Start () {
		customtime = time / 0.01f;
		m_FixedUpdate = new CustomFixedUpdate(0.01f, MyFixedUpdate);
	}
Exemple #9
0
 private void Start()
 {
     m_FixedUpdate = new CustomFixedUpdate(0.05f, MyFixedUpdate);
     position      = new Vector2(transform.position.x, transform.position.z);
 }