diff --git a/Assets/AddressableAssetsData/AddressableAssetSettings.asset b/Assets/AddressableAssetsData/AddressableAssetSettings.asset
index 96ad27a..cc9bc1e 100644
--- a/Assets/AddressableAssetsData/AddressableAssetSettings.asset
+++ b/Assets/AddressableAssetsData/AddressableAssetSettings.asset
@@ -15,7 +15,7 @@ MonoBehaviour:
m_DefaultGroup: d790534e015d692428ac5a9ce7d2ceb6
m_currentHash:
serializedVersion: 2
- Hash: 5c0b3de6b8f117471ad9b1bb8d9f282a
+ Hash: 0af5201342c5f367b42af240abcddd8d
m_OptimizeCatalogSize: 0
m_BuildRemoteCatalog: 0
m_CatalogRequestsTimeout: 0
@@ -106,6 +106,7 @@ MonoBehaviour:
- PostProccessVolume
- AudioInfoConfig
- AudioSettingsConfig
+ - RacerConfig
m_SchemaTemplates: []
m_GroupTemplateObjects:
- {fileID: 11400000, guid: af0b5782a0090884db056705d7776701, type: 2}
diff --git a/Assets/AddressableAssetsData/AssetGroups/Default Local Group.asset b/Assets/AddressableAssetsData/AssetGroups/Default Local Group.asset
index 1c999e2..dfc9f34 100644
--- a/Assets/AddressableAssetsData/AssetGroups/Default Local Group.asset
+++ b/Assets/AddressableAssetsData/AssetGroups/Default Local Group.asset
@@ -15,6 +15,11 @@ MonoBehaviour:
m_GroupName: Default Local Group
m_GUID: d790534e015d692428ac5a9ce7d2ceb6
m_SerializeEntries:
+ - m_GUID: 0d2cf1d8a32701f56851c8b734cf7928
+ m_Address: Assets/Resources_moved/UI/Panels/PlayerCounter.prefab
+ m_ReadOnly: 0
+ m_SerializedLabels: []
+ FlaggedDuringContentUpdateRestriction: 0
- m_GUID: 0f5388dd5b953e74281733a43c9bca5a
m_Address: Audio/UI/01. Wake Up, Get Up, Get Out There
m_ReadOnly: 0
@@ -25,6 +30,12 @@ MonoBehaviour:
m_ReadOnly: 0
m_SerializedLabels: []
FlaggedDuringContentUpdateRestriction: 0
+ - m_GUID: 14e849600b64a5a498f121440eebefd2
+ m_Address: Assets/Resources_moved/Configs/UI/PlayerSceneChoose.asset
+ m_ReadOnly: 0
+ m_SerializedLabels:
+ - UIPanelConfig
+ FlaggedDuringContentUpdateRestriction: 0
- m_GUID: 17c5e56eb6c99db40b6093c9d543bb4f
m_Address: Assets/Resources_moved/Configs/UI/CanvasSettingsConfig.asset
m_ReadOnly: 0
@@ -45,6 +56,12 @@ MonoBehaviour:
m_ReadOnly: 0
m_SerializedLabels: []
FlaggedDuringContentUpdateRestriction: 0
+ - m_GUID: 29779120ceccabb0ab008e48b44a39f4
+ m_Address: Example/Race/Configs/AIBot
+ m_ReadOnly: 0
+ m_SerializedLabels:
+ - RacerConfig
+ FlaggedDuringContentUpdateRestriction: 0
- m_GUID: 2e29259ec1cd556c6a33f0396d8f90e2
m_Address: Assets/Resources_moved/Configs/Audio/Infos/UI/launchUpMenu.asset
m_ReadOnly: 0
@@ -125,6 +142,12 @@ MonoBehaviour:
m_ReadOnly: 0
m_SerializedLabels: []
FlaggedDuringContentUpdateRestriction: 0
+ - m_GUID: 7a5ae0cc826b85108aa9f0681d7f85cc
+ m_Address: Assets/Resources_moved/Example/Race/Configs/AIRed.asset
+ m_ReadOnly: 0
+ m_SerializedLabels:
+ - RacerConfig
+ FlaggedDuringContentUpdateRestriction: 0
- m_GUID: 7eaa3bbea72a3b313878e71bc992c5fd
m_Address: Assets/Resources_moved/Audio/UI/launch_select2.wav
m_ReadOnly: 0
@@ -157,6 +180,11 @@ MonoBehaviour:
m_SerializedLabels:
- AudioInfoConfig
FlaggedDuringContentUpdateRestriction: 0
+ - m_GUID: 9e77251929568a7c0806d17b11af8afb
+ m_Address: Assets/Resources_moved/Example/Race/PlayerRacist.prefab
+ m_ReadOnly: 0
+ m_SerializedLabels: []
+ FlaggedDuringContentUpdateRestriction: 0
- m_GUID: a63ae4e1d4b750b8a819dbadffa4b9f7
m_Address: Assets/Resources_moved/Configs/Audio/Infos/UI/launchSelect2.asset
m_ReadOnly: 0
@@ -179,6 +207,12 @@ MonoBehaviour:
m_ReadOnly: 0
m_SerializedLabels: []
FlaggedDuringContentUpdateRestriction: 0
+ - m_GUID: b93ef12d9a22d9b65ba68c45742f73a3
+ m_Address: Assets/Resources_moved/Configs/Camera/ThirdPersonConfig.asset
+ m_ReadOnly: 0
+ m_SerializedLabels:
+ - CameraConfig
+ FlaggedDuringContentUpdateRestriction: 0
- m_GUID: becf493a34b841e4d8ea927261a05e9b
m_Address: Camera/Camera
m_ReadOnly: 0
@@ -247,18 +281,17 @@ MonoBehaviour:
m_SerializedLabels:
- UIPanelConfig
FlaggedDuringContentUpdateRestriction: 0
+ - m_GUID: eb48bfdd161d536498ed1b2810fa476e
+ m_Address: Example/Race/Racist (1)
+ m_ReadOnly: 0
+ m_SerializedLabels: []
+ FlaggedDuringContentUpdateRestriction: 0
- m_GUID: ec0362c4c0d045cccbe89aee2231c3be
m_Address: Assets/Resources_moved/Configs/Audio/Settings/AudioSourceSettingsConfig.asset
m_ReadOnly: 0
m_SerializedLabels:
- AudioSettingsConfig
FlaggedDuringContentUpdateRestriction: 0
- - m_GUID: f146779bcd07c524097072c871162bff
- m_Address: Assets/Resources_moved/Configs/Camera/FPSConfig.asset
- m_ReadOnly: 0
- m_SerializedLabels:
- - CameraConfig
- FlaggedDuringContentUpdateRestriction: 0
- m_GUID: f5e16d3d2576c5a4ca27ea09aeb18733
m_Address: Assets/Resources_moved/Configs/Scenes/MainMenu.asset
m_ReadOnly: 0
@@ -271,6 +304,12 @@ MonoBehaviour:
m_SerializedLabels:
- AudioInfoConfig
FlaggedDuringContentUpdateRestriction: 0
+ - m_GUID: f8c793cd022fab58682fadd51648a3c1
+ m_Address: Example/Race/Configs/Player
+ m_ReadOnly: 0
+ m_SerializedLabels:
+ - RacerConfig
+ FlaggedDuringContentUpdateRestriction: 0
m_ReadOnly: 0
m_Settings: {fileID: 11400000, guid: c6c4cec5a69c4d144a5dfabd0405f447, type: 2}
m_SchemaSet:
diff --git a/Assets/Code/Debug/SceneChooser.cs b/Assets/Code/Debug/SceneChooser.cs
index 75fff36..baf35de 100644
--- a/Assets/Code/Debug/SceneChooser.cs
+++ b/Assets/Code/Debug/SceneChooser.cs
@@ -1,3 +1,4 @@
+using Code.Infrastructure.App;
using Code.Infrastructure.SceneLoader;
using Reflex.Attributes;
using UnityEngine;
@@ -8,10 +9,20 @@ namespace Code.Debug
public class SceneChooser : MonoBehaviour
{
[Inject] private SceneLoader _sceneLoader;
-
+ [Inject] private AppStateMachine _stateMachine;
public void ChooseScene(int id)
{
_sceneLoader.LoadSceneAsync((SceneId)id, LoadSceneMode.Single).Forget();
}
+
+ public void ChooseState(int id)
+ {
+ _stateMachine.SwitchState((AppStates)id);
+ }
+
+ public void SwitchGameplay()
+ {
+ _stateMachine.SwitchState(AppStates.Gameplay).AllowStateTransition(AppStates.MainMenu);
+ }
}
}
\ No newline at end of file
diff --git a/Assets/Code/Example/Race/RaceGame.cs b/Assets/Code/Example/Race/RaceGame.cs
new file mode 100644
index 0000000..6a55746
--- /dev/null
+++ b/Assets/Code/Example/Race/RaceGame.cs
@@ -0,0 +1,106 @@
+using System;
+using System.Collections.Generic;
+using Code.Example.Race.Racer;
+using Code.Example.Race.Track;
+using Code.Infrastructure.EventBus;
+using Code.Infrastructure.Loadings;
+using Reflex.Attributes;
+
+namespace Code.Example.Race
+{
+ public class RaceGame : IRacerLoadedHandle, IDisposable
+ {
+ private RaceScores _scores;
+
+ private IRacerFactory _racerFactory;
+ private RaceTrackData _raceTrackData;
+ private EventBus _eventBus;
+
+ public RaceGame(EventBus eventBus, IRacerFactory racerFactory, RaceTrackData raceTrackData, RaceScores scores)
+ {
+ _eventBus = eventBus;
+ _racerFactory = racerFactory;
+ _raceTrackData = raceTrackData;
+ _eventBus.Subscribe(this);
+
+ _scores = scores;
+
+ RandomizeRacers(raceTrackData.trackData.RacerPoints.Count);
+ }
+
+ public void StartRacers()
+ {
+ foreach (var racer in PlacedRacers)
+ {
+ racer.StartRacer();
+ }
+ }
+
+ // DEBUG
+ private List _randomizedTypes = new();
+
+ private void RandomizeRacers(int count)
+ {
+ _raceGameLoading = new Loading(count, RacersLoadCompleted);
+
+ _randomizedTypes.Add(RacerType.Player);
+
+ for (var i = 0; i < count - 1; i++)
+ _randomizedTypes.Add((RacerType)UnityEngine.Random.Range(1, 3));
+
+ foreach (var type in _randomizedTypes) _racerFactory.LoadRacer(type);
+ }
+
+ private void RacersLoadCompleted() =>
+ _eventBus.RaiseEvent(x => x.RaceGameReady());
+
+ public List PlacedRacers { get; } = new();
+
+ public void PlaceRacers()
+ {
+ for (var i = 0; i < _raceTrackData.trackData.RacerPoints.Count; i++)
+ {
+ PlacedRacers.Add(UnityEngine.Object.Instantiate(
+ _racerPrefabs[_randomizedTypes[i]],
+ _raceTrackData.trackData.RacerPoints[i].transform).GetComponent());
+ PlacedRacers[^1].SetData(_racerPrefabs[_randomizedTypes[i]].Data);
+ PlacedRacers[^1].Id = i;
+ _scores.SubscribeRacer(i);
+ }
+
+ foreach (var racer in PlacedRacers)
+ {
+ racer.Initialize(_raceTrackData.trackData.Checkpoints);
+ }
+ }
+
+ private Dictionary _racerPrefabs = new();
+ private Loading _raceGameLoading;
+
+ public void RacerLoaded(RacerType type, Racer.AI.Racer racer)
+ {
+ if (racer)
+ _racerPrefabs.Add(type, racer);
+
+ _raceGameLoading.DoProgress();
+ }
+
+ // private Dictionary _spawnedRacers = new();
+ public void RacerCreated(RacerType type, Racer.AI.Racer racer)
+ {
+ // _spawnedRacers.Add(type, racer);
+ // _raceGameLoading.DoProgress();
+ }
+
+ public void Dispose()
+ {
+ _eventBus.Unsubscribe(this);
+ _racerPrefabs.Clear();
+ }
+ }
+
+ public interface IRaceGameInitializedHandle : IGlobalSubscriber
+ {
+ void RaceGameReady();
+ }
+}
\ No newline at end of file
diff --git a/Assets/Code/Example/Race/RaceGame.cs.meta b/Assets/Code/Example/Race/RaceGame.cs.meta
new file mode 100644
index 0000000..b11b7c4
--- /dev/null
+++ b/Assets/Code/Example/Race/RaceGame.cs.meta
@@ -0,0 +1,3 @@
+fileFormatVersion: 2
+guid: 0ffa5c181be7447cb1c41392018b193f
+timeCreated: 1769692114
\ No newline at end of file
diff --git a/Assets/Code/Example/Race/RaceScores.cs b/Assets/Code/Example/Race/RaceScores.cs
new file mode 100644
index 0000000..61fefe1
--- /dev/null
+++ b/Assets/Code/Example/Race/RaceScores.cs
@@ -0,0 +1,52 @@
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using Code.Example.Race.Track;
+using Code.Infrastructure.EventBus;
+
+namespace Code.Example.Race
+{
+ public class RaceScores : IRacerPassedCheckpointHandler, IDisposable
+ {
+ private Dictionary _scores = new();
+ private EventBus _eventBus;
+
+ public RaceScores(EventBus eventBus)
+ {
+ _eventBus = eventBus;
+ _eventBus.Subscribe(this);
+ }
+ public void SubscribeRacer(int racer)
+ {
+ _scores.Add(racer, 0);
+ }
+
+ public void ChangeScore(int racer, int additionalScore)
+ {
+ _scores[racer] += additionalScore;
+ _eventBus.RaiseEvent(x=> x.ScoreChanged(racer,additionalScore, GetScores()));
+ }
+
+ public void UnsubscribeRacer(int racer)
+ {
+ _scores.Remove(racer);
+ }
+
+ public List> GetScores()
+ {
+ return _scores.OrderByDescending(x => x.Value).ToList();
+ }
+
+ public void OnRacerPassedCheckpoint(Racer.AI.Racer racer) => ChangeScore(racer.Id,1);
+
+ public void Dispose()
+ {
+ _eventBus.Unsubscribe(this);
+ }
+ }
+
+ public interface IScoreChangedHandle : IGlobalSubscriber
+ {
+ void ScoreChanged(int racer, int additionalScore, List> scores);
+ }
+}
\ No newline at end of file
diff --git a/Assets/Code/Example/Race/RaceScores.cs.meta b/Assets/Code/Example/Race/RaceScores.cs.meta
new file mode 100644
index 0000000..525f8a0
--- /dev/null
+++ b/Assets/Code/Example/Race/RaceScores.cs.meta
@@ -0,0 +1,3 @@
+fileFormatVersion: 2
+guid: b45fb028abcf43129f5c8100e7215f1f
+timeCreated: 1770051193
\ No newline at end of file
diff --git a/Assets/Code/Example/Race/Racer/AI/AIDebugRacer.cs b/Assets/Code/Example/Race/Racer/AI/AIDebugRacer.cs
index 76a89dd..aed95ec 100644
--- a/Assets/Code/Example/Race/Racer/AI/AIDebugRacer.cs
+++ b/Assets/Code/Example/Race/Racer/AI/AIDebugRacer.cs
@@ -4,7 +4,7 @@ using UnityEngine.AI;
namespace Code.Example.Race.Racer.AI
{
- public class AIDebugRacer : MonoBehaviour
+ public class AIDebugRacer : Racer
{
[SerializeField] private NavMeshAgent navMeshAgent;
[SerializeField] private List waypoints;
@@ -15,11 +15,31 @@ namespace Code.Example.Race.Racer.AI
_currentWaypointIndex++;
}
- public void NextWaypoint()
+ public override void NextWaypoint()
{
if(_currentWaypointIndex >= waypoints.Count) _currentWaypointIndex = 0;
navMeshAgent.destination = waypoints[_currentWaypointIndex++].position;
}
+
+ public override void StartRacer()
+ {
+
+ }
+
+ public override void StopRacer()
+ {
+
+ }
+
+ public override void SetData(RacerData data)
+ {
+
+ }
+
+ public override void Initialize(List waypoints)
+ {
+
+ }
}
}
\ No newline at end of file
diff --git a/Assets/Code/Example/Race/Racer/AI/AIRacer.cs b/Assets/Code/Example/Race/Racer/AI/AIRacer.cs
new file mode 100644
index 0000000..ce10a8f
--- /dev/null
+++ b/Assets/Code/Example/Race/Racer/AI/AIRacer.cs
@@ -0,0 +1,36 @@
+using System.Collections.Generic;
+using UnityEngine;
+using UnityEngine.AI;
+
+namespace Code.Example.Race.Racer.AI
+{
+ public class AIRacer : Racer
+ {
+ [SerializeField] private NavMeshAgent navMeshAgent;
+
+ public override void SetData(RacerData data)
+ {
+ Data = data;
+ navMeshAgent.angularSpeed = data.angularSpeed;
+ navMeshAgent.speed = data.speed;
+ }
+
+ public override void Initialize(List waypoints)
+ {
+ navMeshAgent.isStopped = true;
+
+ Waypoints = waypoints;
+ navMeshAgent.destination = Waypoints[CurrentWaypointIndex].position;
+
+ CurrentWaypointIndex++;
+ }
+ public override void StartRacer() => navMeshAgent.isStopped = false;
+ public override void StopRacer() => navMeshAgent.isStopped = true;
+ public override void NextWaypoint()
+ {
+ if(CurrentWaypointIndex >= Waypoints.Count) CurrentWaypointIndex = 0;
+
+ navMeshAgent.destination = Waypoints[CurrentWaypointIndex++].position;
+ }
+ }
+}
\ No newline at end of file
diff --git a/Assets/Code/Example/Race/Racer/AI/AIRacer.cs.meta b/Assets/Code/Example/Race/Racer/AI/AIRacer.cs.meta
new file mode 100644
index 0000000..bea8513
--- /dev/null
+++ b/Assets/Code/Example/Race/Racer/AI/AIRacer.cs.meta
@@ -0,0 +1,3 @@
+fileFormatVersion: 2
+guid: 05f30660967e40209aa88719fa498c78
+timeCreated: 1769694590
\ No newline at end of file
diff --git a/Assets/Code/Example/Race/Racer/AI/PlayerRacer.cs b/Assets/Code/Example/Race/Racer/AI/PlayerRacer.cs
new file mode 100644
index 0000000..8d6766a
--- /dev/null
+++ b/Assets/Code/Example/Race/Racer/AI/PlayerRacer.cs
@@ -0,0 +1,32 @@
+using System.Collections.Generic;
+using UnityEngine;
+
+namespace Code.Example.Race.Racer.AI
+{
+ public class PlayerRacer : Racer
+ {
+ public override void SetData(RacerData data)
+ {
+ Data = data;
+ }
+
+ public override void Initialize(List waypoints)
+ {
+
+ }
+
+ public override void NextWaypoint()
+ {
+
+ }
+
+ public override void StartRacer()
+ {
+
+ }
+
+ public override void StopRacer()
+ {
+ }
+ }
+}
\ No newline at end of file
diff --git a/Assets/Code/Example/Race/Racer/AI/PlayerRacer.cs.meta b/Assets/Code/Example/Race/Racer/AI/PlayerRacer.cs.meta
new file mode 100644
index 0000000..f9ed093
--- /dev/null
+++ b/Assets/Code/Example/Race/Racer/AI/PlayerRacer.cs.meta
@@ -0,0 +1,3 @@
+fileFormatVersion: 2
+guid: 6d3497d41c87415eab67cfc865262b79
+timeCreated: 1769619757
\ No newline at end of file
diff --git a/Assets/Code/Example/Race/Racer/AI/Racer.cs b/Assets/Code/Example/Race/Racer/AI/Racer.cs
new file mode 100644
index 0000000..b3064f2
--- /dev/null
+++ b/Assets/Code/Example/Race/Racer/AI/Racer.cs
@@ -0,0 +1,21 @@
+using System.Collections.Generic;
+using UnityEngine;
+
+namespace Code.Example.Race.Racer.AI
+{
+ public abstract class Racer : MonoBehaviour
+ {
+ protected List Waypoints;
+ protected int CurrentWaypointIndex;
+ public RacerData Data { get; protected set; }
+ public int Id { get; set; }
+ public abstract void SetData(RacerData data);
+ public abstract void Initialize(List waypoints);
+ public abstract void NextWaypoint();
+ public abstract void StartRacer();
+ public abstract void StopRacer();
+
+ [SerializeField] protected Rigidbody carRigidbody;
+ public Rigidbody CarRigidbody => GetComponent();
+ }
+}
\ No newline at end of file
diff --git a/Assets/Code/Example/Race/Racer/AI/Racer.cs.meta b/Assets/Code/Example/Race/Racer/AI/Racer.cs.meta
new file mode 100644
index 0000000..438474e
--- /dev/null
+++ b/Assets/Code/Example/Race/Racer/AI/Racer.cs.meta
@@ -0,0 +1,3 @@
+fileFormatVersion: 2
+guid: 7f87ed38713d4b779df9e46c83b03fb7
+timeCreated: 1769619306
\ No newline at end of file
diff --git a/Assets/Code/Example/Race/Racer/Car.meta b/Assets/Code/Example/Race/Racer/Car.meta
new file mode 100644
index 0000000..706be43
--- /dev/null
+++ b/Assets/Code/Example/Race/Racer/Car.meta
@@ -0,0 +1,3 @@
+fileFormatVersion: 2
+guid: 2c5dfd92289c4aa38bb9a8bafc07d204
+timeCreated: 1769699718
\ No newline at end of file
diff --git a/Assets/Code/Example/Race/Racer/Car/CarWheelRotator.cs b/Assets/Code/Example/Race/Racer/Car/CarWheelRotator.cs
new file mode 100644
index 0000000..0995c5e
--- /dev/null
+++ b/Assets/Code/Example/Race/Racer/Car/CarWheelRotator.cs
@@ -0,0 +1,32 @@
+using UnityEngine;
+using UnityEngine.AI;
+
+namespace Code.Example.Race.Racer.Car
+{
+ public class CarWheelRotator : MonoBehaviour
+ {
+ [SerializeField] private NavMeshAgent agent;
+ [SerializeField] private Transform[] wheels;
+ [SerializeField] private bool rotateDebug;
+
+ private void Update()
+ {
+ Vector3 wheelRotation;
+ foreach (var wheel in wheels)
+ {
+ if (rotateDebug)
+ {
+ UnityEngine.Debug.DrawRay(
+ wheel.position,
+ Vector3.Project(agent.velocity, agent.gameObject.transform.right),
+ Color.yellow, 900f);
+ UnityEngine.Debug.Log(Vector3.Project(agent.velocity, agent.gameObject.transform.right).magnitude);
+ }
+
+ wheelRotation = wheel.localRotation.eulerAngles;
+ wheelRotation.y = Vector3.Project(agent.velocity, agent.gameObject.transform.right).magnitude * 10f;
+ wheel.localRotation = Quaternion.Euler(wheelRotation);
+ }
+ }
+ }
+}
\ No newline at end of file
diff --git a/Assets/Code/Example/Race/Racer/Car/CarWheelRotator.cs.meta b/Assets/Code/Example/Race/Racer/Car/CarWheelRotator.cs.meta
new file mode 100644
index 0000000..6172e2d
--- /dev/null
+++ b/Assets/Code/Example/Race/Racer/Car/CarWheelRotator.cs.meta
@@ -0,0 +1,3 @@
+fileFormatVersion: 2
+guid: 3634956b4d55431b8772a8612e2e3a4d
+timeCreated: 1769699734
\ No newline at end of file
diff --git a/Assets/Code/Example/Race/Racer/Car/CarWheelRotatorPlayer.cs b/Assets/Code/Example/Race/Racer/Car/CarWheelRotatorPlayer.cs
new file mode 100644
index 0000000..1df7655
--- /dev/null
+++ b/Assets/Code/Example/Race/Racer/Car/CarWheelRotatorPlayer.cs
@@ -0,0 +1,23 @@
+using DG.Tweening;
+using UnityEngine;
+
+namespace Code.Example.Race.Racer.Car
+{
+ public class CarWheelRotatorPlayer : MonoBehaviour
+ {
+ [SerializeField] private Transform[] wheels;
+ [SerializeField] private bool rotateDebug;
+
+ public void RotateWheels(float amount)
+ {
+ // UnityEngine.Debug.Log("Rotating Wheels: " + amount);
+ foreach (var wheel in wheels)
+ {
+ var wheelRotation = wheel.localRotation.eulerAngles;
+ wheelRotation.y = amount;
+ wheel.DOLocalRotate(wheelRotation, 1f);
+ // wheel.localRotation = Quaternion.Euler(wheelRotation);
+ }
+ }
+ }
+}
\ No newline at end of file
diff --git a/Assets/Code/Example/Race/Racer/Car/CarWheelRotatorPlayer.cs.meta b/Assets/Code/Example/Race/Racer/Car/CarWheelRotatorPlayer.cs.meta
new file mode 100644
index 0000000..c0f4e2a
--- /dev/null
+++ b/Assets/Code/Example/Race/Racer/Car/CarWheelRotatorPlayer.cs.meta
@@ -0,0 +1,3 @@
+fileFormatVersion: 2
+guid: c90fde90552d48f592b955cbf1ec5c77
+timeCreated: 1769705011
\ No newline at end of file
diff --git a/Assets/Code/Example/Race/Racer/Player.meta b/Assets/Code/Example/Race/Racer/Player.meta
new file mode 100644
index 0000000..523ecbe
--- /dev/null
+++ b/Assets/Code/Example/Race/Racer/Player.meta
@@ -0,0 +1,3 @@
+fileFormatVersion: 2
+guid: 7d9a0a4882314e2f91bb356ea0f82538
+timeCreated: 1769705255
\ No newline at end of file
diff --git a/Assets/Code/Example/Race/Racer/Player/PlayerCarController.cs b/Assets/Code/Example/Race/Racer/Player/PlayerCarController.cs
new file mode 100644
index 0000000..c11993b
--- /dev/null
+++ b/Assets/Code/Example/Race/Racer/Player/PlayerCarController.cs
@@ -0,0 +1,55 @@
+using Code.Example.Race.Racer.AI;
+using Code.Example.Race.Racer.Car;
+using UnityEngine;
+
+namespace Code.Example.Race.Racer.Player
+{
+ public class PlayerCarController : MonoBehaviour
+ {
+ [SerializeField] private Rigidbody _rigidbody;
+ [SerializeField] private PlayerCarInput _playerCarInput;
+ [SerializeField] private PlayerRacer _playerRacer;
+ [SerializeField] private CarWheelRotatorPlayer _wheels;
+
+ private void Update()
+ {
+ if (_playerCarInput.MovementInput == Vector2.zero) return;
+
+ // var movementForward = transform.forward * (_playerCarInput.MovementInput.y * _playerRacer.Data.speed);
+ //
+ // _rigidbody.AddForce(movementForward * Time.fixedDeltaTime, ForceMode.Force);
+
+ var force = transform.forward * (_playerCarInput.MovementInput.y * _playerRacer.Data.speed);
+ _rigidbody.AddForce(force, ForceMode.Force);
+
+ // if (Mathf.Abs(_playerCarInput.MovementInput.y) < 0.1f && _rigidbody.linearVelocity.magnitude > 0.3f)
+ // {
+ // _rigidbody.AddForce(-_rigidbody.linearVelocity * (_playerRacer.Data.brakeForce * Time.fixedDeltaTime),
+ // ForceMode.Force);
+ // }
+
+ var steerInput = _playerCarInput.MovementInput.x;
+ if (_playerCarInput.MovementInput.y < 0)
+ steerInput = -_playerCarInput.MovementInput.x;
+
+ // var steer = steerInput * maxSteerAngle;
+ //
+ // if (frontLeftWheel) frontLeftWheel.localRotation = Quaternion.Euler(0, steer, 0);
+ // if (frontRightWheel) frontRightWheel.localRotation = Quaternion.Euler(0, steer, 0);
+
+ if (!(_rigidbody.linearVelocity.magnitude > 0.5f)) return;
+
+ // var turn = steerInput * _playerRacer.Data.turnSpeed * Time.fixedDeltaTime;
+ // _rigidbody.MoveRotation(_rigidbody.rotation * Quaternion.Euler(0, turn, 0));
+
+ if (!(_rigidbody.linearVelocity.magnitude is > 1f or < -1f)) return;
+
+ var rotateAmount = _playerCarInput.MovementInput.x * _playerRacer.Data.angularSpeed;
+
+ _wheels.RotateWheels(rotateAmount * 10 * Time.fixedDeltaTime);
+ var wheelRotation = transform.rotation.eulerAngles;
+ wheelRotation.y += rotateAmount;
+ transform.rotation = Quaternion.Euler(wheelRotation);
+ }
+ }
+}
\ No newline at end of file
diff --git a/Assets/Code/Example/Race/Racer/Player/PlayerCarController.cs.meta b/Assets/Code/Example/Race/Racer/Player/PlayerCarController.cs.meta
new file mode 100644
index 0000000..7a3a0ce
--- /dev/null
+++ b/Assets/Code/Example/Race/Racer/Player/PlayerCarController.cs.meta
@@ -0,0 +1,3 @@
+fileFormatVersion: 2
+guid: 4b9e2e4a3ddc437ab250f609ea7fc33e
+timeCreated: 1769705285
\ No newline at end of file
diff --git a/Assets/Code/Example/Race/Racer/Player/PlayerCarControllerRB.cs b/Assets/Code/Example/Race/Racer/Player/PlayerCarControllerRB.cs
new file mode 100644
index 0000000..56d4cbc
--- /dev/null
+++ b/Assets/Code/Example/Race/Racer/Player/PlayerCarControllerRB.cs
@@ -0,0 +1,166 @@
+using UnityEngine;
+using System;
+using System.Collections.Generic;
+
+namespace Code.Example.Race.Racer.Player
+{
+ public class PlayerCarControllerRB : MonoBehaviour
+ {
+ public enum ControlMode
+ {
+ Keyboard,
+ Buttons
+ };
+
+ public enum Axel
+ {
+ Front,
+ Rear
+ }
+
+ [Serializable]
+ public struct Wheel
+ {
+ public GameObject wheelModel;
+ public WheelCollider wheelCollider;
+ public GameObject wheelEffectObj;
+ public ParticleSystem smokeParticle;
+ public Axel axel;
+ }
+
+ public ControlMode control;
+
+ public float maxAcceleration = 30.0f;
+ public float brakeAcceleration = 50.0f;
+
+ public float turnSensitivity = 1.0f;
+ public float maxSteerAngle = 30.0f;
+
+ public Vector3 _centerOfMass;
+
+ public List wheels;
+
+ float moveInput;
+ float steerInput;
+
+ private Rigidbody carRb;
+
+ // private CarLights carLights;
+
+ void Start()
+ {
+ carRb = GetComponent();
+ carRb.centerOfMass = _centerOfMass;
+
+ carLights = GetComponent();
+ }
+
+ void Update()
+ {
+ GetInputs();
+ AnimateWheels();
+ WheelEffects();
+ }
+
+ void LateUpdate()
+ {
+ Move();
+ Steer();
+ Brake();
+ }
+
+ public void MoveInput(float input)
+ {
+ moveInput = input;
+ }
+
+ public void SteerInput(float input)
+ {
+ steerInput = input;
+ }
+
+ void GetInputs()
+ {
+ if (control == ControlMode.Keyboard)
+ {
+ moveInput = Input.GetAxis("Vertical");
+ steerInput = Input.GetAxis("Horizontal");
+ }
+ }
+
+ void Move()
+ {
+ foreach (var wheel in wheels)
+ {
+ wheel.wheelCollider.motorTorque = moveInput * 600 * maxAcceleration * Time.deltaTime;
+ }
+ }
+
+ void Steer()
+ {
+ foreach (var wheel in wheels)
+ {
+ if (wheel.axel == Axel.Front)
+ {
+ var _steerAngle = steerInput * turnSensitivity * maxSteerAngle;
+ wheel.wheelCollider.steerAngle = Mathf.Lerp(wheel.wheelCollider.steerAngle, _steerAngle, 0.6f);
+ }
+ }
+ }
+
+ void Brake()
+ {
+ if (Input.GetKey(KeyCode.Space) || moveInput == 0)
+ {
+ foreach (var wheel in wheels)
+ {
+ wheel.wheelCollider.brakeTorque = 300 * brakeAcceleration * Time.deltaTime;
+ }
+
+ carLights.isBackLightOn = true;
+ carLights.OperateBackLights();
+ }
+ else
+ {
+ foreach (var wheel in wheels)
+ {
+ wheel.wheelCollider.brakeTorque = 0;
+ }
+
+ carLights.isBackLightOn = false;
+ carLights.OperateBackLights();
+ }
+ }
+
+ void AnimateWheels()
+ {
+ foreach (var wheel in wheels)
+ {
+ Quaternion rot;
+ Vector3 pos;
+ wheel.wheelCollider.GetWorldPose(out pos, out rot);
+ wheel.wheelModel.transform.position = pos;
+ wheel.wheelModel.transform.rotation = rot;
+ }
+ }
+
+ void WheelEffects()
+ {
+ foreach (var wheel in wheels)
+ {
+ //var dirtParticleMainSettings = wheel.smokeParticle.main;
+
+ if (Input.GetKey(KeyCode.Space) && wheel.axel == Axel.Rear && wheel.wheelCollider.isGrounded == true &&
+ carRb.linearVelocity.magnitude >= 10.0f)
+ {
+ wheel.wheelEffectObj.GetComponentInChildren().emitting = true;
+ wheel.smokeParticle.Emit(1);
+ }
+ else
+ {
+ wheel.wheelEffectObj.GetComponentInChildren().emitting = false;
+ }
+ }
+ }
+ }
+}
\ No newline at end of file
diff --git a/Assets/Code/Example/Race/Racer/Player/PlayerCarControllerRB.cs.meta b/Assets/Code/Example/Race/Racer/Player/PlayerCarControllerRB.cs.meta
new file mode 100644
index 0000000..bf4e43b
--- /dev/null
+++ b/Assets/Code/Example/Race/Racer/Player/PlayerCarControllerRB.cs.meta
@@ -0,0 +1,3 @@
+fileFormatVersion: 2
+guid: 5f093c913ff54cb99cd22d7e473931e7
+timeCreated: 1770299509
\ No newline at end of file
diff --git a/Assets/Code/Example/Race/Racer/Player/PlayerCarInput.cs b/Assets/Code/Example/Race/Racer/Player/PlayerCarInput.cs
new file mode 100644
index 0000000..a18b97a
--- /dev/null
+++ b/Assets/Code/Example/Race/Racer/Player/PlayerCarInput.cs
@@ -0,0 +1,32 @@
+using Code.Infrastructure.Input;
+using Reflex.Attributes;
+using UnityEngine;
+using UnityEngine.InputSystem;
+
+namespace Code.Example.Race.Racer.Player
+{
+ public class PlayerCarInput : MonoBehaviour
+ {
+ private IInputService _inputService;
+ public Vector2 MovementInput { get; private set; }
+
+ [Inject]
+ public void Construct(IInputService inputService)
+ {
+ _inputService = inputService;
+ _inputService.BindActionPerformed((int)ActionMappings.Gameplay, (int)GameplayActions.Move, MovementPerformed);
+ _inputService.BindActionCancel((int)ActionMappings.Gameplay, (int)GameplayActions.Move, MovementEnded);
+ }
+
+ private void MovementPerformed(InputAction.CallbackContext context) => MovementInput = context.ReadValue();
+
+ private void MovementEnded(InputAction.CallbackContext context) => MovementInput = Vector2.zero;
+
+ private void OnDestroy()
+ {
+ if (_inputService == null) return;
+ _inputService.UnbindActionPerformed((int)ActionMappings.Gameplay, (int)GameplayActions.Move, MovementPerformed);
+ _inputService.UnbindActionCanceled((int)ActionMappings.Gameplay, (int)GameplayActions.Move, MovementEnded);
+ }
+ }
+}
\ No newline at end of file
diff --git a/Assets/Code/Example/Race/Racer/Player/PlayerCarInput.cs.meta b/Assets/Code/Example/Race/Racer/Player/PlayerCarInput.cs.meta
new file mode 100644
index 0000000..6c89186
--- /dev/null
+++ b/Assets/Code/Example/Race/Racer/Player/PlayerCarInput.cs.meta
@@ -0,0 +1,3 @@
+fileFormatVersion: 2
+guid: e52315b65c57499981981e2507aaf7bc
+timeCreated: 1769705872
\ No newline at end of file
diff --git a/Assets/Code/Example/Race/Racer/RacerFactory.cs b/Assets/Code/Example/Race/Racer/RacerFactory.cs
new file mode 100644
index 0000000..34bc1a3
--- /dev/null
+++ b/Assets/Code/Example/Race/Racer/RacerFactory.cs
@@ -0,0 +1,96 @@
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using Code.Infrastructure.Configs;
+using Code.Infrastructure.EventBus;
+using Cysharp.Threading.Tasks;
+using UnityEngine;
+using UnityEngine.AddressableAssets;
+using UnityEngine.ResourceManagement.AsyncOperations;
+using EventBus = Code.Infrastructure.EventBus.EventBus;
+
+namespace Code.Example.Race.Racer
+{
+ public interface IRacerFactory
+ {
+ RacerSettingsConfig GetConfig(RacerType racerType);
+ UniTaskVoid LoadRacer(RacerType racerType);
+ void ReleaseRacer(RacerType racerType);
+ }
+
+ public class RacerFactory : IDisposable, IRacerFactory
+ {
+ private Dictionary _racerConfigs;
+ private Dictionary> _racerPrefabsHandle = new();
+
+ private string _racerConfigsLabel;
+ private AsyncOperationHandle> _racerConfigsHandle;
+
+ private EventBus _eventBus;
+
+ public RacerFactory(IConfigLocator configLocator, EventBus eventBus)
+ {
+ _eventBus = eventBus;
+ _racerConfigsLabel = configLocator.TryGetManyConfigAssetReferences();
+
+ LoadConfigs().Forget();
+ }
+
+ private async UniTaskVoid LoadConfigs()
+ {
+ _racerConfigsHandle = Addressables.LoadAssetsAsync(_racerConfigsLabel);
+
+ await _racerConfigsHandle.ToUniTask();
+
+ _racerConfigs = _racerConfigsHandle.Result.ToDictionary(x => x.racerData.type);
+
+ _eventBus.RaiseEvent(x => x.RacerFactoryInitialized());
+ }
+
+ public RacerSettingsConfig GetConfig(RacerType racerType) => _racerConfigs[racerType];
+
+ public async UniTaskVoid LoadRacer(RacerType racerType)
+ {
+ if (_racerPrefabsHandle.ContainsKey(racerType))
+ {
+ _eventBus.RaiseEvent(x => x.RacerLoaded(racerType, null));
+
+ return;
+ }
+
+ _racerPrefabsHandle.Add(racerType,
+ Addressables.LoadAssetAsync(_racerConfigs[racerType].prefabReference));
+
+ await _racerPrefabsHandle[racerType].ToUniTask();
+ var racer = _racerPrefabsHandle[racerType].Result.GetComponent();
+ racer.SetData(_racerConfigs[racerType].racerData);
+
+ _eventBus.RaiseEvent(x => x.RacerLoaded(racerType, racer));
+ }
+
+ public void ReleaseRacer(RacerType racerType)
+ {
+ _racerPrefabsHandle[racerType].Release();
+ _racerPrefabsHandle.Remove(racerType);
+ }
+
+ public void Dispose()
+ {
+ foreach (var prefab in _racerPrefabsHandle)
+ prefab.Value.Release();
+
+ _racerConfigsHandle.Release();
+ }
+ }
+
+ public interface IRacerFactoryInitializedHandle : IGlobalSubscriber
+ {
+ public void RacerFactoryInitialized();
+ }
+
+ public interface IRacerLoadedHandle : IGlobalSubscriber
+ {
+ public void RacerLoaded(RacerType type, AI.Racer racer);
+ public void RacerCreated(RacerType type, AI.Racer racer);
+ }
+}
\ No newline at end of file
diff --git a/Assets/Code/Example/Race/Racer/RacerFactory.cs.meta b/Assets/Code/Example/Race/Racer/RacerFactory.cs.meta
new file mode 100644
index 0000000..2b2c653
--- /dev/null
+++ b/Assets/Code/Example/Race/Racer/RacerFactory.cs.meta
@@ -0,0 +1,3 @@
+fileFormatVersion: 2
+guid: 5ab404f94a89460eae107b9d453fa64d
+timeCreated: 1769620039
\ No newline at end of file
diff --git a/Assets/Code/Example/Race/Racer/RacerSettings.cs b/Assets/Code/Example/Race/Racer/RacerSettings.cs
new file mode 100644
index 0000000..5f1f383
--- /dev/null
+++ b/Assets/Code/Example/Race/Racer/RacerSettings.cs
@@ -0,0 +1,27 @@
+using System;
+using Code.Infrastructure.Generators;
+using UnityEngine.AddressableAssets;
+
+namespace Code.Example.Race.Racer
+{
+ [Config("Configs/Gameplay/RacerSettings", true)]
+ public class RacerSettings
+ {
+ [ToConfig] public RacerData racerData;
+
+ [ToConfig] public AssetReference prefabReference;
+ }
+
+ [Serializable]
+ public struct RacerData
+ {
+ public string name;
+ public float speed;
+ public float angularSpeed;
+ public float maxAcceleration;
+ public float brakeAcceleration;
+ public float turnSensitivity;
+ public float maxSteerAngle;
+ public RacerType type;
+ }
+}
\ No newline at end of file
diff --git a/Assets/Code/Example/Race/Racer/RacerSettings.cs.meta b/Assets/Code/Example/Race/Racer/RacerSettings.cs.meta
new file mode 100644
index 0000000..979949c
--- /dev/null
+++ b/Assets/Code/Example/Race/Racer/RacerSettings.cs.meta
@@ -0,0 +1,3 @@
+fileFormatVersion: 2
+guid: f25b32b493144bfc9ca0c5016741d012
+timeCreated: 1769619229
\ No newline at end of file
diff --git a/Assets/Code/Example/Race/Racer/RacerType.cs b/Assets/Code/Example/Race/Racer/RacerType.cs
new file mode 100644
index 0000000..e4aa5b0
--- /dev/null
+++ b/Assets/Code/Example/Race/Racer/RacerType.cs
@@ -0,0 +1,9 @@
+namespace Code.Example.Race.Racer
+{
+ public enum RacerType
+ {
+ Player,
+ AIGreen,
+ AIRed
+ }
+}
\ No newline at end of file
diff --git a/Assets/Code/Example/Race/Racer/RacerType.cs.meta b/Assets/Code/Example/Race/Racer/RacerType.cs.meta
new file mode 100644
index 0000000..113558c
--- /dev/null
+++ b/Assets/Code/Example/Race/Racer/RacerType.cs.meta
@@ -0,0 +1,3 @@
+fileFormatVersion: 2
+guid: 488f864fcf6f4632b8d50b39038f5472
+timeCreated: 1769619126
\ No newline at end of file
diff --git a/Assets/Code/Example/Race/Racer/RacistSpawnListDebug.cs b/Assets/Code/Example/Race/Racer/RacistSpawnListDebug.cs
new file mode 100644
index 0000000..a1644a7
--- /dev/null
+++ b/Assets/Code/Example/Race/Racer/RacistSpawnListDebug.cs
@@ -0,0 +1,7 @@
+namespace Code.Example.Race.Racer
+{
+ public class RacistSpawnListDebug
+ {
+
+ }
+}
\ No newline at end of file
diff --git a/Assets/Code/Example/Race/Racer/RacistSpawnListDebug.cs.meta b/Assets/Code/Example/Race/Racer/RacistSpawnListDebug.cs.meta
new file mode 100644
index 0000000..a99706d
--- /dev/null
+++ b/Assets/Code/Example/Race/Racer/RacistSpawnListDebug.cs.meta
@@ -0,0 +1,3 @@
+fileFormatVersion: 2
+guid: a9506da417a249929493862133eef179
+timeCreated: 1769685790
\ No newline at end of file
diff --git a/Assets/Code/Example/Race/Track/CheckPoint.cs b/Assets/Code/Example/Race/Track/CheckPoint.cs
index 62f93e3..29843c5 100644
--- a/Assets/Code/Example/Race/Track/CheckPoint.cs
+++ b/Assets/Code/Example/Race/Track/CheckPoint.cs
@@ -1,14 +1,24 @@
using Code.Example.Race.Racer.AI;
+using Code.Infrastructure.EventBus;
+using Reflex.Attributes;
using UnityEngine;
namespace Code.Example.Race.Track
{
public class CheckPoint : MonoBehaviour
{
+ [Inject] private EventBus _eventBus;
private void OnTriggerEnter(Collider other)
{
- var racer = other.GetComponent();
+ var racer = other.GetComponent();
racer.NextWaypoint();
+
+ _eventBus.RaiseEvent(h => h.OnRacerPassedCheckpoint(racer));
}
}
+
+ public interface IRacerPassedCheckpointHandler : IGlobalSubscriber
+ {
+ void OnRacerPassedCheckpoint(Racer.AI.Racer racer);
+ }
}
\ No newline at end of file
diff --git a/Assets/Code/Example/Race/Track/RaceTrackData.cs b/Assets/Code/Example/Race/Track/RaceTrackData.cs
new file mode 100644
index 0000000..cb64301
--- /dev/null
+++ b/Assets/Code/Example/Race/Track/RaceTrackData.cs
@@ -0,0 +1,18 @@
+using System.Collections.Generic;
+using UnityEngine;
+
+namespace Code.Example.Race.Track
+{
+ public class RaceTrackData : MonoBehaviour
+ {
+ public Transform CameraPosition;
+ public TrackData trackData;
+ }
+
+ [System.Serializable]
+ public struct TrackData
+ {
+ public List RacerPoints;
+ public List Checkpoints;
+ }
+}
\ No newline at end of file
diff --git a/Assets/Code/Example/Race/Track/RaceTrackData.cs.meta b/Assets/Code/Example/Race/Track/RaceTrackData.cs.meta
new file mode 100644
index 0000000..c4b99e4
--- /dev/null
+++ b/Assets/Code/Example/Race/Track/RaceTrackData.cs.meta
@@ -0,0 +1,3 @@
+fileFormatVersion: 2
+guid: 1847a22e722c47c48ec0ce7d5a929580
+timeCreated: 1769686034
\ No newline at end of file
diff --git a/Assets/Code/Example/Race/Track/WellEditor.meta b/Assets/Code/Example/Race/Track/WellEditor.meta
new file mode 100644
index 0000000..0c4d1e9
--- /dev/null
+++ b/Assets/Code/Example/Race/Track/WellEditor.meta
@@ -0,0 +1,3 @@
+fileFormatVersion: 2
+guid: af09293375544928a9b19a6b697f214e
+timeCreated: 1770036714
\ No newline at end of file
diff --git a/Assets/Code/Example/Race/Track/WellEditor/CheckPointAsset.cs b/Assets/Code/Example/Race/Track/WellEditor/CheckPointAsset.cs
new file mode 100644
index 0000000..1324c30
--- /dev/null
+++ b/Assets/Code/Example/Race/Track/WellEditor/CheckPointAsset.cs
@@ -0,0 +1,39 @@
+namespace Code.Example.Race.Track.WellEditor
+{
+ using UnityEngine;
+ using UnityEditor;
+
+ public static class CheckPointAsset
+ {
+ [MenuItem("GameObject/Track/CheckPoint", false, 1)]
+ private static void CreateCustomPrefab()
+ {
+ // Define the path to your prefab in the Project (must be in an "Assets" relative path)
+ var prefabPath = "Assets/Resources/Example/Misc/Point.prefab"; // Update with your actual path
+
+ // Load the prefab asset
+ var prefab = AssetDatabase.LoadAssetAtPath(prefabPath);
+
+ if (!prefab)
+ {
+ Debug.LogError("Prefab not found at path: " + prefabPath);
+ return;
+ }
+
+ // Instantiate the prefab in the scene
+ var newInstance = (GameObject)PrefabUtility.InstantiatePrefab(prefab);
+
+ // Ensure it is placed correctly in the Hierarchy and is undoable
+ Undo.RegisterCreatedObjectUndo(newInstance, "Create Custom Prefab");
+ Selection.activeGameObject = newInstance;
+
+ // Set parent if an object is selected
+ if (!Selection.activeTransform)
+ {
+ newInstance.transform.parent = Selection.activeTransform;
+ newInstance.transform.localPosition = Vector3.zero;
+ }
+ }
+ }
+
+}
\ No newline at end of file
diff --git a/Assets/Code/Example/Race/Track/WellEditor/CheckPointAsset.cs.meta b/Assets/Code/Example/Race/Track/WellEditor/CheckPointAsset.cs.meta
new file mode 100644
index 0000000..66a1857
--- /dev/null
+++ b/Assets/Code/Example/Race/Track/WellEditor/CheckPointAsset.cs.meta
@@ -0,0 +1,3 @@
+fileFormatVersion: 2
+guid: 7d55e4bcf05848eea361440799c21d7e
+timeCreated: 1770036738
\ No newline at end of file
diff --git a/Assets/Code/Example/Race/UI.meta b/Assets/Code/Example/Race/UI.meta
new file mode 100644
index 0000000..64d81e4
--- /dev/null
+++ b/Assets/Code/Example/Race/UI.meta
@@ -0,0 +1,3 @@
+fileFormatVersion: 2
+guid: b875d3daf0cc42e997366fb0b9f0a722
+timeCreated: 1770042347
\ No newline at end of file
diff --git a/Assets/Code/Example/Race/UI/PlayerScoreCounter.cs b/Assets/Code/Example/Race/UI/PlayerScoreCounter.cs
new file mode 100644
index 0000000..92b532a
--- /dev/null
+++ b/Assets/Code/Example/Race/UI/PlayerScoreCounter.cs
@@ -0,0 +1,49 @@
+using System;
+using System.Collections.Generic;
+using Code.Example.Race.Racer;
+using Code.Example.Race.Track;
+using Code.Infrastructure.EventBus;
+using Code.Infrastructure.UI;
+using Reflex.Attributes;
+using TMPro;
+using UnityEngine;
+using UnityEngine.Rendering;
+
+namespace Code.Example.Race.UI
+{
+ public class PlayerScoreCounter : UIPanel, IScoreChangedHandle
+ {
+ [SerializeField] private TMP_Text playerScore;
+ private EventBus _eventBus;
+
+ [Inject]
+ private void Construct(EventBus eventBus)
+ {
+ _eventBus = eventBus;
+ _eventBus.Subscribe(this);
+ }
+ public override void Open(Action callback = null)
+ {
+ playerScore.gameObject.SetActive(true);
+ // image.DOColor(shownColor, 1f).onComplete = () => callback?.Invoke();
+ }
+
+ public override void Close(Action callback = null)
+ {
+ playerScore.gameObject.SetActive(true);
+ // image.DOColor(hiddenColor, 1f).onComplete += () => callback?.Invoke();
+ }
+
+ public void OnRacerPassedCheckpoint(Racer.AI.Racer racer)
+ {
+ }
+
+ public void ScoreChanged(int racer, int additionalScore, List> scores)
+ {
+ // if (racer.Data.type == RacerType.Player)
+ string output = "";
+ foreach (var score in scores) output += $@"{score.Key}: {score.Value}\n";
+ playerScore.text = output;
+ }
+ }
+}
\ No newline at end of file
diff --git a/Assets/Code/Example/Race/UI/PlayerScoreCounter.cs.meta b/Assets/Code/Example/Race/UI/PlayerScoreCounter.cs.meta
new file mode 100644
index 0000000..d5ee033
--- /dev/null
+++ b/Assets/Code/Example/Race/UI/PlayerScoreCounter.cs.meta
@@ -0,0 +1,3 @@
+fileFormatVersion: 2
+guid: cf68a9a9d3a946f086dccd6d11741dcf
+timeCreated: 1770042362
\ No newline at end of file
diff --git a/Assets/Code/Infrastructure/App/AppStateMachine.cs b/Assets/Code/Infrastructure/App/AppStateMachine.cs
index 22435a5..00eaa64 100644
--- a/Assets/Code/Infrastructure/App/AppStateMachine.cs
+++ b/Assets/Code/Infrastructure/App/AppStateMachine.cs
@@ -1,5 +1,6 @@
using Code.Infrastructure.Audio;
using Code.Infrastructure.Camera;
+using Code.Infrastructure.Input;
using Code.Infrastructure.UI;
using Reflex.Attributes;
@@ -19,6 +20,7 @@ namespace Code.Infrastructure.App
[Inject] public IUIService UIService { get; set; }
[Inject] public IAudioFactory AudioFactory { get; set; }
[Inject] public IAudioService AudioService { get; set; }
+ [Inject] public IInputService InputService { get; set; }
}
[Generators.StateMachine(typeof(AppStateMachineContext),typeof(AppStates))]
diff --git a/Assets/Code/Infrastructure/App/PapaInstaller.cs b/Assets/Code/Infrastructure/App/PapaInstaller.cs
index 8b97369..50c88f7 100644
--- a/Assets/Code/Infrastructure/App/PapaInstaller.cs
+++ b/Assets/Code/Infrastructure/App/PapaInstaller.cs
@@ -1,3 +1,4 @@
+using Code.Debug;
using Code.Infrastructure.Audio;
using Code.Infrastructure.Camera;
using Code.Infrastructure.Configs;
@@ -114,7 +115,7 @@ namespace Code.Infrastructure.App
{
_thatRightContainer.Resolve().cameraLoadedData = data;
_thatRightContainer.Resolve().SwitchState(CameraMode.None)
- .AllowStateTransition(CameraMode.FirstPerson);
+ .AllowStateTransition(CameraMode.ThirdPerson);
data.Camera.GetUniversalAdditionalCameraData().renderPostProcessing = true;
@@ -128,6 +129,7 @@ namespace Code.Infrastructure.App
_initialLoading.DoProgress();
_thatRightContainer.Resolve().TryLoadPanel(UIPanelType.Logo);
+ _thatRightContainer.Resolve().TryLoadPanel(UIPanelType.Loading);
}
public void UILoaded(UIPanelType uiPanelType)
diff --git a/Assets/Code/Infrastructure/App/SceneInstallers/GameplaySceneInstaller.cs b/Assets/Code/Infrastructure/App/SceneInstallers/GameplaySceneInstaller.cs
index 7918659..f3f76a5 100644
--- a/Assets/Code/Infrastructure/App/SceneInstallers/GameplaySceneInstaller.cs
+++ b/Assets/Code/Infrastructure/App/SceneInstallers/GameplaySceneInstaller.cs
@@ -1,19 +1,34 @@
+using Code.Debug;
+using Code.Example.Race;
+using Code.Example.Race.Racer;
+using Code.Example.Race.Track;
+using Code.Infrastructure.SceneLoader;
using Reflex.Core;
+using Reflex.Enums;
using UnityEngine;
+using Resolution = Reflex.Enums.Resolution;
namespace Code.Infrastructure.App.SceneInstallers
{
public class GameplaySceneInstaller : MonoBehaviour, IInstaller
{
+ [SerializeField] private RaceTrackData _raceTrackData;
+
public void InstallBindings(ContainerBuilder containerBuilder)
- {
-
+ {
+ containerBuilder.RegisterType(typeof(RacerFactory), new[] { typeof(IRacerFactory) }, Lifetime.Scoped,
+ Resolution.Lazy);
+ containerBuilder.RegisterType(typeof(RaceScores), Lifetime.Scoped,
+ Resolution.Lazy);
+ containerBuilder.RegisterValue(_raceTrackData);
+
containerBuilder.OnContainerBuilt += PostInstall;
}
private void PostInstall(Container container)
- {
-
+ {
+ container.Resolve()
+ .RaiseEvent(x => x.OnGameplaySceneInitialized(container));
}
}
}
\ No newline at end of file
diff --git a/Assets/Code/Infrastructure/App/States/BootstrapState.cs b/Assets/Code/Infrastructure/App/States/BootstrapState.cs
index da1274d..8fb5d14 100644
--- a/Assets/Code/Infrastructure/App/States/BootstrapState.cs
+++ b/Assets/Code/Infrastructure/App/States/BootstrapState.cs
@@ -1,8 +1,12 @@
using System.Threading;
+using Code.Example.Race.Racer;
+using Code.Example.Race.Track;
using Code.Infrastructure.Audio;
using Code.Infrastructure.Generators;
using Code.Infrastructure.SceneLoader;
using Code.Infrastructure.UI;
+using Reflex.Core;
+using UnityEngine.SceneManagement;
namespace Code.Infrastructure.App.States
{
@@ -29,7 +33,7 @@ namespace Code.Infrastructure.App.States
protected override void OnExitState()
{
- Context.AudioFactory.ReleaseAudios(AudioNames.UISounds);
+ // Context.AudioFactory.ReleaseAudios(AudioNames.UISounds);
Context.UIService.TryRemovePanel(UIPanelType.DebugSceneChooser);
_eventBus.Unsubscribe(this);
}
@@ -40,10 +44,10 @@ namespace Code.Infrastructure.App.States
Context.UIService.OpenPanel(uiPanelType);
}
-
public void OnReadyToPlay(AudioNames groupName)
{
Context.AudioService.PlayRepeatedly(AudioNames.UISounds,0,new CancellationTokenSource());
+
}
}
}
\ No newline at end of file
diff --git a/Assets/Code/Infrastructure/App/States/GameplayState.cs b/Assets/Code/Infrastructure/App/States/GameplayState.cs
index 2df25cf..7b7b9b4 100644
--- a/Assets/Code/Infrastructure/App/States/GameplayState.cs
+++ b/Assets/Code/Infrastructure/App/States/GameplayState.cs
@@ -1,31 +1,102 @@
+using Code.Example.Race;
+using Code.Example.Race.Racer;
+using Code.Example.Race.Track;
using Code.Infrastructure.Camera;
+using Code.Infrastructure.Camera.CameraStates;
using Code.Infrastructure.Generators;
-using Code.Infrastructure.SceneLoader;
-using UnityEngine;
+using Code.Infrastructure.Input;
+using Code.Infrastructure.Loadings;
+using Code.Infrastructure.SceneLoader;
+using Code.Infrastructure.UI;
+using Reflex.Core;
+using Reflex.Injectors;
+using UnityEngine.SceneManagement;
namespace Code.Infrastructure.App.States
{
- [State(typeof(AppStates),typeof(AppStateMachineContext))]
- [StateRaisingEvent]
- public partial class GameplayState : IOnGameplaySceneLoadedHandler
+ [State(typeof(AppStates), typeof(AppStateMachineContext))]
+ [StateRaisingEvent]
+ public partial class GameplayState : IOnGameplaySceneLoadedHandler, IRaceGameInitializedHandle, IRacerFactoryInitializedHandle, IUIPanelLoaded
{
public GameplayState(AppStateMachineContext context, EventBus.EventBus eventBus) : base(context, eventBus)
{
}
public override AppStates myState => AppStates.Gameplay;
+
+ private Loading _gameplayLoading;
+
protected override void OnEnterState()
{
-
+ EventBus.Subscribe(this);
+ Context.UIService.OpenPanel(UIPanelType.Loading);
+
+ // Scene
+ // RaceGame
+ // Factory
+ // PlayerCounter
+ _gameplayLoading = new Loading(4, GameplayLoadingCompleted);
+ Context.UIService.TryLoadPanel(UIPanelType.PlayerScoreCounter);
+ Context.SceneLoader.LoadSceneAsync(SceneId.Gameplay, LoadSceneMode.Single).Forget();
+ Context.InputService.EnableMap(ActionMappings.Gameplay);
+ }
+
+ private void GameplayLoadingCompleted()
+ {
+ _raceGame.PlaceRacers();
+
+ Context.Camera.SwitchState(CameraMode.ThirdPerson).AllowStateTransition(CameraMode.None);
+ ((ThirdPersonState)Context.Camera.CurrentBaseState).SetFollowTarget(_raceGame.PlacedRacers[0].gameObject.transform, _raceGame.PlacedRacers[0].CarRigidbody);
+
+ Context.UIService.ClosePanel(UIPanelType.Loading);
+ _raceGame.StartRacers();
}
protected override void OnExitState()
{
+ Context.InputService.DisableMap(ActionMappings.Gameplay);
+ Context.UIService.TryRemovePanel(UIPanelType.PlayerScoreCounter);
+ EventBus.Unsubscribe(this);
}
public void OnGameplaySceneLoaded()
{
+ }
+
+ private RaceTrackData _raceTrackData;
+ private RaceGame _raceGame;
+ private Container UNTILTHEYFIXCONTAINERS;
+ public void OnGameplaySceneInitialized(Container container)
+ {
+ _raceTrackData = container.Resolve();
+ Context.Camera.Camera.transform.position = _raceTrackData.CameraPosition.transform.position;
+ Context.Camera.Camera.transform.rotation = _raceTrackData.CameraPosition.transform.rotation;
+
+ UNTILTHEYFIXCONTAINERS = container;
+ _gameplayLoading.DoProgress();
+
+ container.Resolve();
+ }
+
+ public void RaceGameReady()
+ {
+ _gameplayLoading.DoProgress();
+ }
+
+ public void RacerFactoryInitialized()
+ {
+ _raceGame = (RaceGame)ConstructorInjector.Construct(typeof(RaceGame), UNTILTHEYFIXCONTAINERS);
+
+ _gameplayLoading.DoProgress();
+ }
+
+ public void UILoaded(UIPanelType uiPanelType)
+ {
+ if (uiPanelType != UIPanelType.PlayerScoreCounter) return;
+
+ Context.UIService.OpenPanel(UIPanelType.PlayerScoreCounter);
+ _gameplayLoading.DoProgress();
}
}
}
\ No newline at end of file
diff --git a/Assets/Code/Infrastructure/Audio/AudioInfo.cs b/Assets/Code/Infrastructure/Audio/AudioInfo.cs
index 73bafcc..86cafb4 100644
--- a/Assets/Code/Infrastructure/Audio/AudioInfo.cs
+++ b/Assets/Code/Infrastructure/Audio/AudioInfo.cs
@@ -11,10 +11,9 @@ namespace Code.Infrastructure.Audio
[ToConfig] public int id;
[ToConfig] public AssetReference fileReference;
}
- [Config("Configs/Audio/AudioServiceSettings")]
- public class AudioServiceSettings
+ [Config("Configs/Audio/AudioSourceSettings")]
+ public class AudioSourcePrefab
{
[ToConfig] public AssetReference sourcePrefab;
- [ToConfig] public AssetReference mixerPrefab;
}
}
diff --git a/Assets/Code/Infrastructure/Audio/AudioService.cs b/Assets/Code/Infrastructure/Audio/AudioService.cs
index 6eb1a54..c90905d 100644
--- a/Assets/Code/Infrastructure/Audio/AudioService.cs
+++ b/Assets/Code/Infrastructure/Audio/AudioService.cs
@@ -18,6 +18,8 @@ namespace Code.Infrastructure.Audio
UniTaskVoid PlayRepeatedly(AudioNames groupName, int id,
CancellationTokenSource cancellationTokenSource, AudioSourceType sourceType = AudioSourceType.NoBlend, AudioSource audioSource = null);
+
+ bool CheckClip(AudioNames groupName, int id);
}
public partial class AudioService : IAudioClipsEventHandle, IAudioService
@@ -40,7 +42,7 @@ namespace Code.Infrastructure.Audio
for (int i = 0; i < typeof(AudioNames).GetEnumValues().Length; i++)
_audioClips.Add((AudioNames)i, new Dictionary());
- InitializeMixer();
+ //InitializeMixer();
}
private partial void InitializeMixer();
@@ -53,6 +55,8 @@ namespace Code.Infrastructure.Audio
AudioSourceType sourceType = AudioSourceType.NoBlend,
AudioSource audioSource = null)
{
+ if (!CheckClip(groupName, id)) return;
+
if (!audioSource) audioSource = _pool.GetSource(sourceType);
audioSource.transform.position = position;
@@ -67,6 +71,8 @@ namespace Code.Infrastructure.Audio
public async UniTaskVoid PlayRepeatedly(AudioNames groupName, int id,
CancellationTokenSource cancellationTokenSource, AudioSourceType sourceType = AudioSourceType.NoBlend, AudioSource audioSource = null)
{
+ if (!CheckClip(groupName, id)) return;
+
if (!audioSource) audioSource = _pool.GetSource(sourceType);
if(!audioSource.resource) audioSource.resource = GetClip(groupName, id);
@@ -91,6 +97,7 @@ namespace Code.Infrastructure.Audio
}
public AudioClip GetClip(AudioNames groupName, int id) => _audioClips[groupName][id];
+ public bool CheckClip(AudioNames groupName, int id) => _audioClips[groupName].ContainsKey(id);
public void AudioClipsLoaded(AudioNames groupname, Dictionary clips)
{
@@ -100,6 +107,7 @@ namespace Code.Infrastructure.Audio
public void AudioClipsUnLoaded(AudioNames groupName)
{
+ _audioClips[groupName].Clear();
_audioClips[groupName] = null;
}
}
diff --git a/Assets/Code/Infrastructure/Audio/AudioSourcePool.cs b/Assets/Code/Infrastructure/Audio/AudioSourcePool.cs
index 38d7af5..dc8116f 100644
--- a/Assets/Code/Infrastructure/Audio/AudioSourcePool.cs
+++ b/Assets/Code/Infrastructure/Audio/AudioSourcePool.cs
@@ -33,7 +33,7 @@ namespace Code.Infrastructure.Audio
private string _configsLabel;
private AsyncOperationHandle> _handles;
private AssetReference _sourcePrefabConfigReference;
- private AsyncOperationHandle _prefabConfigHandle;
+ private AsyncOperationHandle _prefabConfigHandle;
private AsyncOperationHandle _prefabHandle;
private EventBus.EventBus _eventBus;
@@ -42,14 +42,14 @@ namespace Code.Infrastructure.Audio
_eventBus = eventBus;
_configsLabel = configLocator.TryGetManyConfigAssetReferences();
- _sourcePrefabConfigReference = configLocator.TryGetConfigAssetReference();
+ _sourcePrefabConfigReference = configLocator.TryGetConfigAssetReference();
LoadConfigs().Forget();
}
private async UniTaskVoid LoadConfigs()
{
- _prefabConfigHandle = Addressables.LoadAssetAsync(_sourcePrefabConfigReference);
+ _prefabConfigHandle = Addressables.LoadAssetAsync(_sourcePrefabConfigReference);
_handles = Addressables.LoadAssetsAsync(_configsLabel);
await UniTask.WhenAll(
@@ -102,58 +102,7 @@ namespace Code.Infrastructure.Audio
{
Object.Destroy(source.gameObject);
}
- //
- // public async UniTaskVoid PlayOneShot(AudioClip clip, Vector3 position, AudioMixerGroup audioMixerGroup, AudioSourceType audioSourceType = AudioSourceType.NoBlend, Action onComplete = null)
- // {
- // AudioSource source = _pool.Get();
- // source.PlayOneShot(clip);
- // source.spatialBlend = _settings[audioSourceType].spatialBlend;
- // source.transform.position = position;
- // source.outputAudioMixerGroup = audioMixerGroup;
- //
- // await UniTask.WaitUntilValueChanged(source, x => x.isPlaying);
- // onComplete?.Invoke();
- // _pool.Release(source);
- // }
- // public async UniTaskVoid PlayOneShot(AudioClip clip, AudioMixerGroup audioMixerGroup, AudioSourceType audioSourceType = AudioSourceType.NoBlend, Action onComplete = null)
- // {
- // AudioSource source = _pool.Get();
- // source.PlayOneShot(clip);
- // source.spatialBlend = _settings[audioSourceType].spatialBlend;
- // source.outputAudioMixerGroup = audioMixerGroup;
- //
- // await UniTask.WaitUntilValueChanged(source, x => x.isPlaying);
- // onComplete?.Invoke();
- // _pool.Release(source);
- // }
- // public async UniTaskVoid PlayOneShot(AudioSource audioSource, AudioClip clip, AudioMixerGroup audioMixerGroup, AudioSourceType audioSourceType = AudioSourceType.NoBlend, Action onComplete = null)
- // {
- // audioSource.PlayOneShot(clip);
- // audioSource.spatialBlend = _settings[audioSourceType].spatialBlend;
- // audioSource.outputAudioMixerGroup = audioMixerGroup;
- //
- // // TODO Потом сделать. Можно с cancellation, но сейчас лень. Ну правда
- // await UniTask.WaitUntilValueChanged(audioSource, x => x.isPlaying);
- //
- // if (!audioSource) return;
- //
- // _pool.Release(audioSource);
- // onComplete?.Invoke();
- // }
- // public async UniTaskVoid PlayOneShot(AudioClip clip, AudioMixerGroup audioMixerGroup, CancellationTokenSource cancellationToken, AudioSourceType audioSourceType = AudioSourceType.NoBlend, Action onComplete = null)
- // {
- // AudioSource source = _pool.Get();
- // source.PlayOneShot(clip);
- // source.spatialBlend = _settings[audioSourceType].spatialBlend;
- // source.outputAudioMixerGroup = audioMixerGroup;
- //
- // var (isCanceled, _) = await UniTask.WaitUntilValueChanged(source, x => x.isPlaying, cancellationToken: cancellationToken.Token).SuppressCancellationThrow();
- //
- // _pool.Release(source);
- //
- // if(!isCanceled) onComplete?.Invoke();
- // else cancellationToken.Dispose();
- // }
+
public AudioSource GetSource(AudioSourceType sourceType)
{
var source = _pool.Get();
diff --git a/Assets/Code/Infrastructure/Camera/CameraStateMachine.cs b/Assets/Code/Infrastructure/Camera/CameraStateMachine.cs
index e0d83b0..24b34ac 100644
--- a/Assets/Code/Infrastructure/Camera/CameraStateMachine.cs
+++ b/Assets/Code/Infrastructure/Camera/CameraStateMachine.cs
@@ -10,9 +10,7 @@ namespace Code.Infrastructure.Camera
public enum CameraMode
{
None,
- FirstPerson,
- Static,
- Cinematic
+ ThirdPerson
}
[Config("Configs/Camera/CameraConfig")]
diff --git a/Assets/Code/Infrastructure/Camera/CameraStates/CameraTemp.cs b/Assets/Code/Infrastructure/Camera/CameraStates/CameraTemp.cs
new file mode 100644
index 0000000..bf5e65c
--- /dev/null
+++ b/Assets/Code/Infrastructure/Camera/CameraStates/CameraTemp.cs
@@ -0,0 +1,174 @@
+using UnityEngine;
+
+public class RacingCamera : MonoBehaviour
+{
+ public enum CameraMode
+ {
+ Follow,
+ Orbit,
+ Hood,
+ Bumper
+ }
+
+ [Header("Target")]
+ public Transform carTarget;
+ public Rigidbody carRigidbody;
+
+ [Header("Camera Mode")]
+ public CameraMode currentMode = CameraMode.Follow;
+ public KeyCode switchKey = KeyCode.C;
+
+ [Header("Follow Mode Settings")]
+ public Vector3 followOffset = new Vector3(0, 3, -8);
+ public float followSmoothTime = 0.1f;
+
+ [Header("Orbit Mode Settings")]
+ public float orbitDistance = 10f;
+ public float orbitHeight = 3f;
+ public float orbitSpeed = 2f;
+ private float orbitAngle = 0f;
+
+ [Header("First Person Settings")]
+ public Transform hoodCameraPosition;
+ public Transform bumperCameraPosition;
+
+ [Header("Look Settings")]
+ public float lookAheadDistance = 5f;
+ public Vector3 lookAtOffset = new Vector3(0, 1.5f, 0);
+
+ private Vector3 velocity = Vector3.zero;
+ private Camera cam;
+
+ void Start()
+ {
+ cam = GetComponent();
+ if (carRigidbody == null && carTarget != null)
+ carRigidbody = carTarget.GetComponent();
+ }
+
+ void Update()
+ {
+ // Переключение режимов камеры
+ if (Input.GetKeyDown(switchKey))
+ {
+ SwitchCameraMode();
+ }
+ }
+
+ void LateUpdate()
+ {
+ if (carTarget == null) return;
+
+ switch (currentMode)
+ {
+ case CameraMode.Follow:
+ UpdateFollowCamera();
+ break;
+
+ case CameraMode.Orbit:
+ UpdateOrbitCamera();
+ break;
+
+ case CameraMode.Hood:
+ UpdateFirstPersonCamera(hoodCameraPosition);
+ break;
+
+ case CameraMode.Bumper:
+ UpdateFirstPersonCamera(bumperCameraPosition);
+ break;
+ }
+ }
+
+ void SwitchCameraMode()
+ {
+ currentMode = (CameraMode)(((int)currentMode + 1) % 4);
+ Debug.Log("Camera mode: " + currentMode);
+ }
+
+ void UpdateFollowCamera()
+ {
+ // Рассчитываем позицию с учетом скорости
+ Vector3 targetPosition = CalculateFollowPosition();
+
+ // Плавное перемещение
+ transform.position = Vector3.SmoothDamp(
+ transform.position,
+ targetPosition,
+ ref velocity,
+ followSmoothTime
+ );
+
+ // Направление взгляда с опережением
+ Vector3 lookTarget = carTarget.position +
+ carTarget.forward * lookAheadDistance +
+ lookAtOffset;
+
+ transform.LookAt(lookTarget);
+ }
+
+ Vector3 CalculateFollowPosition()
+ {
+ Vector3 basePosition = carTarget.position +
+ carTarget.TransformDirection(followOffset);
+
+ // Динамическое смещение на основе скорости
+ if (carRigidbody != null)
+ {
+ float speedFactor = Mathf.Clamp01(carRigidbody.linearVelocity.magnitude / 50f);
+ Vector3 speedOffset = carTarget.forward * speedFactor * -3f;
+ basePosition += speedOffset;
+ }
+
+ return basePosition;
+ }
+
+ void UpdateOrbitCamera()
+ {
+ // Автоматическое вращение вокруг машины
+ orbitAngle += orbitSpeed * Time.deltaTime;
+
+ // Рассчитываем позицию по окружности
+ float x = Mathf.Sin(orbitAngle) * orbitDistance;
+ float z = Mathf.Cos(orbitAngle) * orbitDistance;
+
+ Vector3 orbitPosition = carTarget.position +
+ new Vector3(x, orbitHeight, z);
+
+ transform.position = orbitPosition;
+ transform.LookAt(carTarget.position + lookAtOffset);
+ }
+
+void UpdateFirstPersonCamera(Transform cameraPosition)
+ {
+ if (cameraPosition == null)
+ {
+ // Резервная позиция
+ transform.position = carTarget.position +
+ carTarget.forward * 1f +
+ Vector3.up * 1.5f;
+ transform.rotation = carTarget.rotation;
+ return;
+ }
+
+ transform.position = cameraPosition.position;
+ transform.rotation = cameraPosition.rotation;
+
+ // Добавляем небольшую тряску на скорости
+ if (carRigidbody != null)
+ {
+ float shakeAmount = carRigidbody.linearVelocity.magnitude * 0.001f;
+ transform.position += Random.insideUnitSphere * shakeAmount;
+ }
+ }
+
+ // Визуализация в редакторе
+ void OnDrawGizmosSelected()
+ {
+ if (carTarget != null)
+ {
+ Gizmos.color = Color.yellow;
+ Gizmos.DrawWireSphere(carTarget.position + lookAtOffset, 0.5f);
+ Gizmos.DrawLine(transform.position, carTarget.position + lookAtOffset);
+ }
+ }
+}
\ No newline at end of file
diff --git a/Assets/Code/Infrastructure/Camera/CameraStates/CameraTemp.cs.meta b/Assets/Code/Infrastructure/Camera/CameraStates/CameraTemp.cs.meta
new file mode 100644
index 0000000..8a12974
--- /dev/null
+++ b/Assets/Code/Infrastructure/Camera/CameraStates/CameraTemp.cs.meta
@@ -0,0 +1,3 @@
+fileFormatVersion: 2
+guid: 1a6cd725a6ce4cc0b50b8a04be749bd1
+timeCreated: 1770228499
\ No newline at end of file
diff --git a/Assets/Code/Infrastructure/Camera/CameraStates/NoneCameraState.cs b/Assets/Code/Infrastructure/Camera/CameraStates/NoneCameraState.cs
index 17851c8..eacdcc0 100644
--- a/Assets/Code/Infrastructure/Camera/CameraStates/NoneCameraState.cs
+++ b/Assets/Code/Infrastructure/Camera/CameraStates/NoneCameraState.cs
@@ -18,7 +18,7 @@ namespace Code.Infrastructure.Camera.CameraStates
protected override void OnExitState()
{
}
-
+
protected override void HandlePosition(float deltaTime, object targetRotation)
{
throw new System.NotImplementedException();
diff --git a/Assets/Code/Infrastructure/Camera/CameraStates/ThirdPersonState.cs b/Assets/Code/Infrastructure/Camera/CameraStates/ThirdPersonState.cs
new file mode 100644
index 0000000..a44525f
--- /dev/null
+++ b/Assets/Code/Infrastructure/Camera/CameraStates/ThirdPersonState.cs
@@ -0,0 +1,92 @@
+using Code.Infrastructure.Generators;
+using DG.Tweening;
+using UnityEngine;
+
+namespace Code.Infrastructure.Camera.CameraStates
+{
+ [State(typeof(CameraMode),typeof(CameraStateMachineContext), true)]
+ public partial class ThirdPersonState : BaseCameraState
+ {
+ public ThirdPersonState(CameraStateMachineContext context, EventBus.EventBus eventBus) : base(context, eventBus)
+ {
+ }
+
+ public override CameraMode myState => CameraMode.ThirdPerson;
+ protected override void OnEnterState()
+ {
+ }
+
+ protected override void OnExitState()
+ {
+ }
+
+ protected override void HandleRotationInput(float deltaTime, Vector3 rotationInput, out Quaternion q)
+ {
+ throw new System.NotImplementedException();
+ }
+ private Transform _carTarget;
+ private Rigidbody _carRigidbody;
+
+ public void SetFollowTarget(Transform carTarget, Rigidbody carRigidbody)
+ {
+ _carTarget = carTarget;
+ _carRigidbody = carRigidbody;
+ }
+
+ private Vector3 _lookAtOffset = new Vector3(0, 1.5f, 0);
+ protected override void HandlePosition(float deltaTime, object targetRotation)
+ {
+ Fuck();
+ }
+
+ private void Fuck()
+ {
+ // Автоматическое вращение вокруг машины
+ Vector3 targetPosition = CalculateFollowPosition();
+
+ // Плавное перемещение
+
+ Vector3 velocity = _carRigidbody ? _carRigidbody.linearVelocity : new Vector3();
+ // Context.cameraLoadedData.Camera.transform.DOMove(targetPosition,
+ // Context.cameraLoadedData.SettingsConfigs[CameraMode.ThirdPerson].followSharpness);
+ Context.cameraLoadedData.Camera.transform.position = Vector3.SmoothDamp(
+ Context.cameraLoadedData.Camera.transform.position,
+ targetPosition,
+ ref velocity,
+ Context.cameraLoadedData.SettingsConfigs[CameraMode.ThirdPerson].followSharpness
+ );
+
+ // Направление взгляда с опережением
+ Vector3 lookTarget = _carTarget.position +
+ _carTarget.forward * Context.cameraLoadedData.SettingsConfigs[CameraMode.ThirdPerson].defaultDistance +
+ _lookAtOffset;
+
+ Context.cameraLoadedData.Camera.transform.LookAt(lookTarget);
+ }
+
+ private Vector3 _followOffset = new Vector3(0, 3, -8);
+
+ private Vector3 CalculateFollowPosition()
+ {
+ Vector3 basePosition = _carTarget.position +
+ _carTarget.TransformDirection(_followOffset);
+
+ // Динамическое смещение на основе скорости
+ if (!_carRigidbody) return basePosition;
+
+ var speedFactor = Mathf.Clamp01(_carRigidbody.linearVelocity.magnitude / 50f);
+ var speedOffset = _carTarget.forward * (speedFactor * -3f);
+ basePosition += speedOffset;
+
+ return basePosition;
+ }
+ public override void Update()
+ {
+ }
+
+ public override void LateUpdate()
+ {
+ Fuck();
+ }
+ }
+}
\ No newline at end of file
diff --git a/Assets/Code/Infrastructure/Camera/CameraStates/ThirdPersonState.cs.meta b/Assets/Code/Infrastructure/Camera/CameraStates/ThirdPersonState.cs.meta
new file mode 100644
index 0000000..93a9a99
--- /dev/null
+++ b/Assets/Code/Infrastructure/Camera/CameraStates/ThirdPersonState.cs.meta
@@ -0,0 +1,3 @@
+fileFormatVersion: 2
+guid: 817473133bf54c7aab1ea3e093561e8e
+timeCreated: 1770227852
\ No newline at end of file
diff --git a/Assets/Code/Infrastructure/Generators/SceneLoaderGenerator.cs b/Assets/Code/Infrastructure/Generators/SceneLoaderGenerator.cs
index 44f9843..a915e5d 100644
--- a/Assets/Code/Infrastructure/Generators/SceneLoaderGenerator.cs
+++ b/Assets/Code/Infrastructure/Generators/SceneLoaderGenerator.cs
@@ -31,6 +31,7 @@ using Code.Infrastructure.EventBus;
public interface IOn{member.Name}SceneLoadedHandler : IGlobalSubscriber
{{
void On{member.Name}SceneLoaded();
+ void On{member.Name}SceneInitialized(Reflex.Core.Container container); // Until its fixed
}}
";
dictionaryCode += $@"
diff --git a/Assets/Code/Infrastructure/SceneLoader/SceneLoader.cs b/Assets/Code/Infrastructure/SceneLoader/SceneLoader.cs
index 79f38e0..604bbbd 100644
--- a/Assets/Code/Infrastructure/SceneLoader/SceneLoader.cs
+++ b/Assets/Code/Infrastructure/SceneLoader/SceneLoader.cs
@@ -4,9 +4,9 @@ using Code.Infrastructure.Configs;
using Code.Infrastructure.EventBus;
using Code.Infrastructure.Generators;
using Cysharp.Threading.Tasks;
-using UnityEngine;
using UnityEngine.AddressableAssets;
using UnityEngine.ResourceManagement.AsyncOperations;
+using UnityEngine.ResourceManagement.ResourceProviders;
using UnityEngine.SceneManagement;
namespace Code.Infrastructure.SceneLoader
@@ -37,15 +37,19 @@ namespace Code.Infrastructure.SceneLoader
// TODO типилище
public async UniTaskVoid LoadSceneAsync(SceneId id, LoadSceneMode loadMode)
{
- await Addressables.LoadSceneAsync(_sceneInfos[id].SceneAsset, loadMode);
+ _loadedScenes.Add(id,Addressables.LoadSceneAsync(_sceneInfos[id].SceneAsset, loadMode));
+
+ await _loadedScenes[id];
_scenesActions[id]();
}
+ private Dictionary> _loadedScenes = new();
+ public Scene GetScene(SceneId id) => _loadedScenes[id].Result.Scene;
public async UniTaskVoid UnloadSceneAsync(SceneId id)
{
- // TODO НЕВОЗМОЖНО ВЫГРУЗИТЬ БЛЯДСКИЕ СЦЕНЫ
- // await Addressables.UnloadSceneAsync(_sceneInfos[])
+ await Addressables.UnloadSceneAsync(_loadedScenes[id]);
+ _loadedScenes.Remove(id);
}
private AsyncOperationHandle> _configHandle;
diff --git a/Assets/Code/Infrastructure/UI/UIPanelType.cs b/Assets/Code/Infrastructure/UI/UIPanelType.cs
index d88e13a..d01ce64 100644
--- a/Assets/Code/Infrastructure/UI/UIPanelType.cs
+++ b/Assets/Code/Infrastructure/UI/UIPanelType.cs
@@ -5,6 +5,7 @@ namespace Code.Infrastructure.UI
Logo,
Loading,
DebugSceneChooser,
+ PlayerScoreCounter,
DebugMenu
}
}
\ No newline at end of file
diff --git a/Assets/FastScriptReload/Documentation/documentation.md b/Assets/FastScriptReload/Documentation/documentation.md
deleted file mode 100644
index 7c626bd..0000000
--- a/Assets/FastScriptReload/Documentation/documentation.md
+++ /dev/null
@@ -1,708 +0,0 @@
-# Fast/Live Script Reload
-
-Tool will allow you to iterate quicker on your code. You simply go into play mode, make a change to any file and it'll be compiled on the fly and hot-reloaded in your running play-mode session.
-
-## Getting started
-1) Import
-2) Welcome screen will open - it contains all needed info to get started as well as support links and configuration.
-`You can always get back to this screen via 'Window -> Fast/Live Script Reload -> Start Screen'`
-3) Go to Launch Demo -> Basic Example window
-4) Follow instructions listed there
-
-> During startup asset will check if Unity Auto Refresh is enabled and offer to adjust it in order to work properly. Depending on your workflow you want it in 'EnabledOutsidePlaymode' or 'Disabled' - this is to ensure Unity will not trigger script compilation on changes and will let Fast Script Reload to work.
-
-> Sometimes Unity can be quite stubborn and try to auto-reload scripts even with Auto-Reload turned off, if you can still see standard 'Reloading script assemblies' progress bar on change please go to:
-> 'Window -> Fast Script Reload -> Start Screen -> Reload -> Force prevent assembly reload during playmode'.
-> This way tool will lock reload in code when you enter playmode.
-
-```
-Example scene 'Point' material should automatically detect URP or surface shader
-If it shows pink, please adjust by picking shader manually:
-1) URP: 'Shader Graphs/Point URP'
-2) Surface: 'Graph/Point Surface'
-```
-
-## On-Device Hot-Reload - Live Script reload
-There's an addon to this tool - Live Script Reload - that'll allow you to use same functionality over the network in device build, eg:
-- android (including VR headsets like Quest 2)
-- standalone windows
-
-[Find more details here](https://immersivevrtools.com/redirect/fast-script-reload/live-script-reload-extension)
-
-**Live Script Reload is using Fast Script Reload as a base asset - documentation is combined, if you don't use Live Script Reload you can skip any sections in this document prefixed with [Live-Reload]**
-
-## How Unity Hot Reload functionality is made? Technical Approach Breakdown
-If you'd like to know how tool works from technical point of view - have a look at blog series which gets deeper into the subject:
-
-[1) How to build Hot Reload For Unity](https://immersivevrtools.com/Blog/how-to-build-hot-reload-functionality-for-unity)
-
-[2) Hot Reload - on device, (eg Android / Windows Exe)](https://immersivevrtools.com/Blog/how-to-build-unity-hot-reload-on-device)
-
-## Reporting Compilation Errors
-I've put lots of effort to test various code patterns in various codebases. Still - it's possible you'll find some instances where code would not compile, it's easiest to:
-1) Look at compiler error and compare with generated source code, usually it'll be very obvious why issue is occuring
-2) Refactor problematic part (look at limitations section as they'll explain how)
-3) Let me know via support email and I'll get it fixed
-
-## Executing custom code on hot reload
-Custom code can be executed on hot reload by adding a method to changed script.
-
-**You can see example by adjusting code in 'Graph.cs' file.**
-
-```
- void OnScriptHotReload()
- {
- //do whatever you want to do with access to instance via 'this'
- }
-```
-
-```
- static void OnScriptHotReloadNoInstance()
- {
- //do whatever you want to do without instance
- //useful if you've added brand new type
- // or want to simply execute some code without |any instance created.
- //Like reload scene, call test function etc
- }
-```
-
-## EXPERIMENTAL Adding New Fields
-Asset has an experimental support for adding new fields at runtime which will also render in Editor and allow you to tweak values - same as with normal fields.
-
-To enable, please:
-`Window -> Fast Script Reload -> Start Window -> New Fields -> Enable experimental added field support`.
-
-> As this is an experimental feature please expect it to break more often! It'd be great help if you could report any issues via Discord / email.
-
-### New Fields - specific limitations
-
-- outside classes can not call new fields added at runtime
-- new fields will only show in editor if they were already used at least once
- - eg if you've added a variable into a method, on first call that variable will be initialized and will start showing in editor
-
-### New Fields - performance
-For new fields to work your code will be adjusted. Instead of calling fields directly your code will call into a method that retrieves value from dynamic dictionary.
-
-Due to that there'll be some overhead with:
-- looking up proper object and new-field value in dictionary
-- initializing values
-- use of dynamic type, which will introduce some additional casts
-
-> All that shouldn't really add too much overhead on dev-machine - you may lose few FPS though.
-
-## EXPERIMENTAL In-editor Hot Reload (outside of playmode)
-Asset has an experimental support for hot reload outside of playmode. However with limitations as they are now - it
-is intended for some specific use cases (like iterating on editor scripts).
-
-> **Feature is not intended as a replacement for Unity compile / reload mechanism**
-
-To enable, please:
-`Window -> Fast Script Reload -> Start Window -> Editor Hot-Reload -> Enable Hot-Reload outside of play mode`.
-
-> As this is an experimental feature please expect it to break more often! It'd be great help if you could report any issues via Discord / email.
-
-## Debugging
-Debugging is fully supported although breakpoints in your original file won't be hit.
-
-Once change is compiled, you'll get an option to open generated file [via clickable link in console window] in which you can set breakpoints.
-
-Tool can also auto-open generated files for you on change for simpler access, you can find option via 'Window -> Fast Script Reload -> Start Screen -> Debugging -> Auto open generated source file for debugging'
-
-> Debugging with Rider for Unity 2019 and 2020 is having some issues, you can only open debuggable files with auto-open feature. Clicking a file in console causes subtle static-variables reload (not full domain reload) that'll break your play-session.
-
-### Adding Function Breakpoint
-If for whatever reason debugger breakpoint is not hit you can try setting Function Breakpoint in your IDE.
-
-For type name you want to include `__Patched_`, the `__Patched_` postfix is auto-added by asset to prevent name clash.
-Function name remains unchanged.
-
-## Production Build
-For Fast Script Reload asset code will be excluded from any builds.
-
-For Live Script Reload you should exclude it from final production build, do that via:
-- 'Window -> Fast Script Reload -> Welcome Screen -> Build -> Enable Hot Reload For Build' - untick
-
-**When building via File -> Build Settings - you'll also see Live Script Reload status under 'Build' button. You can click 'Adjust' button which will take you to build page for asset.**
-```This is designed to make sure you don't accidentally build tool into release althoguh best approach would be to ensure your release process takes care of that.```
-
-## User Defined Script Overrides
-For asset to hot reload your changes it needs to make some adjustments to code. This could cause some issues as described in limitations section.
-
-I continuously work on mitigating limitations. When they happen you can help yourself quickly by creating user defined script override.
-
-Those are simply overrides on a per-file / method basis - when specified their contents will be used for final source code. Allowing you to simply fix any issues.
-This is especially helpful with larger files.
-
-### Replacing methods
-You can replace existing methods by specifying their full signature in correct type - contents will be then replaced.
-> If no match for the method signature is found it'll be ignored
-
-For example, let's look at limitation with assigning Singleton to Instance using 'this' keyword
-> That limitation is already solved although it'll serve as a clean example illustrating the feature
-
-Following code:
-```
-public class MySingleton: MonoBehaviour {
- public static MySingleton Instance;
-
- void Start() {
- Instance = this;
- }
-
- void SomeOtherMethod() {
- //some other logic
- }
-}
-```
-
-Would be rewritten to:
-```
-public class MySingleton__Patched_: MonoBehaviour { //FSR: name change to include __Patched_ postfix to prevent name clashes
- public static MySingleton Instance;
-
- void Start() {
- //assigning 'this' (now of type MySingleton__Patched_) to
- //'Instance' of type MySingleton will now show compilation error due to type mismach
- Instance = this;
- }
-
- void SomeOtherMethod() {
- //some other logic
- }
-}
-```
-
-In that case you can create a user script rewrite override, to do so:
-1) In Unity project panel right-click on 'MySingleton.cs'
-2) Select `Fast Script Reload -> Add \ Open User Script Rewrite Override`
-3) Asset will create override file for you with some template already in (there's also description in top comment how to use)
-
-Override:
-```
-public class MySingleton__Patched_: MonoBehaviour {
- void Start() { //override will target class specified above and only defined methods, in that case Start()
- Instance = (MySingleton)(object)this; //contents will be changed as they are visible here, casting to object and then to expected type will correct the issue
- }
-}
-```
-
-### Adding types
-When your code is recompiled it lands in new assembly. This can cause some issues, for example if your class is using `internal`
-interface - after recompile it won't be able to access that interface.
-
-Following code will fail to compile when changing MyClass as it won't be able to access IInterface which is `internal`:
-```
-//Defined in file MyClass.cs
-public class MyClass: IInterface {
-
-}
-
-//Defined in other file, IInterface.cs
-interface IInterface { //no access modifier for interfaces will infer 'internal' - only available to assembly it's defined in.
-
-}
-```
-
-In that case you can create a user script rewrite override, to do so:
-1) In Unity project panel right-click on 'MyClass.cs'
-2) Select `Fast Script Reload -> Add \ Open User Script Rewrite Override`
-3) Asset will create override file for you with some template already in (there's also description in top comment how to use)
-
-And put following in the override file
-```
-interface IInterface {
- // add any definitions as needed
-}
-```
-
-This will then be simply added to newly compiled file and interface will be accessible.
-```
-//now both in same assembly/file when hot reloaded
-public class MyClass: IInterface {
-
-}
-
-
-interface IInterface {
-
-}
-```
-
-### Managing existing User Script Rewrite Overrides
-You can see all your overrides by:
-
-1) Right clicking on file in Unity project panel
-2) Clicking `Fast Script Reload -> Show User Script Rewrite Overrides`
-
-This will take you to tool settings window. You can also access it via:
-1) Clicking `Window -> Fast Script Reload -> Start Screen`
-2) Selecting `User Script Rewrite Overrides` side tab
-
-
-## Options
-You can access Welcome Screen / Options via 'Window -> Fast/Live Script Reload -> Start Screen' - it contains useful information as well as options.
-```
-Context menus will be prefixed with used version, either 'Fast Script Reload' or 'Live Script Reload'
-```
-
-### Auto Hot-Reload
-By default tool will pick changes made to any file in playmode. You can add exclusions to that behaviour, more on that later.
-
-You can also manually manage reload, to do so:
-1) Un-tick 'Enable auto Hot-Reload for changed files' in Options -> Reload page
-2) Click Window -> Fast Script Reload -> Force Reload to trigger
-3) or call `FastScriptReloadManager.TriggerReloadForChangedFiles()` method from code
-
-> You can also use Editor -> Hotkeys to bind Force Reload to specific key.
-
-
-### Watch only specific files or folders
-By default FSR watches all files (as specified in global file watcher) - if you want to limit that behaviour to specific files
-please tick 'Specify watched folders/files manually' in 'Reload tab'.
-
-Then you can right click on folder/file in project window and select 'Fast Script Reload -> Watch File / Folder'.
-
-> Technically this adds another File Watcher behind the scenes, you can always adjust those on File Watchers tab.
-
-### Custom file watcher implementation
-In some cases standard file default watcher API can cause issues. You can choose different file watcher implementations via 'Window -> Fast Script Reload -> Start Screen -> File Watchers -> File Watcher implementation'
-
-> DefaultUnity - on some editor versions it could be slow or not trigger at all
->
-> DirectWindowsApi - (experimental) uses Windows API directly, faster (symlinks not supported)
->
-> CustomPolling - (experimental) watches files by manual polling for changes, slowest. Make sure to narrow down watchers scope to script folders
-
-### [Live-Reload] Hot-Reload over Network
-With on-device build, your code changes will be distributed over the network in real-time.
-
-By default running application will send a broadcast and try to discover editor running the tool.
-
-Broadcast is initiated from device where build is running on (not from editor) - this means device running editor needs to allow the connection.
-
-### [Live-Reload] Troubleshooting network issues
-If for whatever reason reload over network doesn't work, please:
-
-1) go to 'Window -> Live Script Reload -> Options/Network'
-2) make sure port used is not already used by any other application
-3) make sure your Firewall allows connections on that port
-4) If you think broadcast doesn't work in your network it's best to specify IP Address explicitly (tick 'Force specific UP address for clients to receive Hot-Reload updates' and add IP)
- - this will allow client (build on device) connect directly to specified address
-
-### [Live-Reload] Connected Client
-In playmode, message will be logged when clients connects. Also Options/Network will display connected client, eg Android phone could be identified as:
-
-`SM-100232 connected from 192.189.168.68:12548`
-
-**Only 1 client can be connected at any time.**
-
-### [Live-Reload] Testing with Editor
-By default, editor will reflect any changes you made without using network. If you want to force editor to behave as networked client:
-1) Press play
-2) Find DontDestroyOnLoadObject 'NetworkedAssemblyChangesLoader' -
-3) tick 'IsDebug'
-4) tick 'Editor Acts as Remote Client'
-5) enable NetworkedAssemblyChangesLoader component
-
-### Managing file exclusions
-Files can be excluded from auto-compilation.
-
-#### via 'Project' context menu
-1) Right click on any *.cs file
-2) Click Fast Script Reload
-3) Add Hot-Reload Exclusion
-
-*You can remove exclusion from same menu*
-
-#### via Exclusions page
-To view all exclusions:
-1) Right click on any *.cs file
-2) Click Fast Script Reload
-3) Click Show Exclusions
-
-#### via class attribute
-You can also add `[PreventHotReload]` attribute to a class to prevent hot reload for that class.
-
-### Batch script changes and reload every N seconds
-Script will batch all your playmode changes and Hot-Reload them in bulk every 3 seconds - you can change duration from 'Reload' options page.
-
-### Disable added/removed fields check
-By default if you add / remove fields, tool will not redirect method calls for recompiled class.
-This is to ensure there are no issues as that is generally not supported.
-
-Some assets however will use IL weaving to adjust your classes (eg Mirror) as a post compile step. In that case it's quite likely hot-reload will still work.
-
-### Managing reference exclusions
-Asset will reference all .dll files that original code is referencing. In some cases that causes compilation error (eg 'Type XYZ is defined in both assembly a.dll and b.dll).
-You can use those options to exclude specific references from being added.
-
-> 'Start Screen -> Exclude References (Advanced) -> adjust as needed'.
-
-## Performance
-
-Your app performance won't be affected in any meaningful way.
-Biggest bit is additional memory used for your re-compiled code.
-Won't be visible unless you make 100s of changes in same play-session.
-
-### File Watchers Performance Overhead
-In some cases watching for file changes is causing significant performance overhead. This is down to the Unity FileWatcher which I'm unable to change or provide suitable replacement for. If you're experiencing this issue please go to `Window -> Fast Script Reload -> File Watcher (Advanced Setup)` and narrow down watchers to specific path where you're working in. You can watch multiple folders in this manner.
-
-## LIMITATIONS -please make sure to read those
-There are some limitation due to the approach taken to Hot-Reload your scripts. I've tried to minimise the impact to standard dev-workflow as much as possible.
-
-In some cases however you may need to use workarounds as described below.
-
-> In most cases you'll be able to use [User Defined Script Overrides](#user-defined-script-overrides) to overcome limitations and make hot reload code compilable.
-
-### Generic methods and classes won't be Hot-Reloaded
-Unfortunately generics will not be Hot-Reloaded, to workaround you'd need to move code to non-generic class / method.
-
-Tool will try to change non-generic methods in those files and will simply skip generic ones.
-
-*Note - you can still Hot-Reload for class implementations that derive from generic base class but are not generic themselves, eg.*
-```
-
-class SingletonImplementation: SingletonBase {
- public void SomeSpecificFunctionality() {
- //you can change code here and it'll be Hot-Reloaded as type itself is not generic
- }
-
- public void GenericMethod(T arg) {
- //changes here won't be Hot-Reloaded as method is generic
- }
-}
-
-class SingletonBase where T: new() {
- public T Instance;
-
- public void Init() {
- Instance = new T(); //if you change this code it won't be Hot-Reloaded as it's in generic type
- }
-}
-
-```
-
-### Adding new fields
-Experimental support with 1.3, minor limitations remaining:
-- outside classes can not call new fields added at runtime
-- new fields will only show in editor if they were already used at least once
-
-> You need to opt in via start screen -> 'Window -> Fast Script Reload -> Start Screen -> New Fields -> enable'!
-
-### Passing `this` reference to method that expect concrete class implementation
-
-
-`**By default experimental setting 'Enable method calls with 'this' as argument fix' is turned on in options, and should fix 'this' calls/assignment issue.
-If you see issues with that please turn setting off and get in touch via support email.**
-
-Unless experimental setting is on - it'll throw compilation error `The best overloaded method match for xxx has some invalid arguments` - this is due to the fact that changed code is technically different type.
-The code will need to be adjusted to depend on some abstraction instead (before hot-reload).
-
-This code would cause the above error.
-```
-public class EnemyController: MonoBehaviour {
- EnemyManager m_EnemyManager;
-
- void Start()
- {
- //calling 'this' causes issues as after hot-reload the type of EnemyController will change to 'EnemyController__Patched_'
- m_EnemyManager.RegisterEnemy(this);
- }
-}
-
-public class EnemyManager : MonoBehaviour {
- public void RegisterEnemy(EnemyController enemy) { //RegisterEnemy method expects parameter of concrete type (EnemyController)
- //impementation
- }
-}
-```
-
-It could be changed to support Hot-Reload in following way:
-
-
-1) Don't depend on concrete implementations, instead use interfaces/abstraction
-```
-public class EnemyController: MonoBehaviour, IRegistrableEnemy {
- EnemyManager m_EnemyManager;
-
- void Start()
- {
- //calling this causes issues as after hot-reload the type of EnemyController will change
- m_EnemyManager.RegisterEnemy(this);
- }
-}
-
-public class EnemyManager : MonoBehaviour {
- public void RegisterEnemy(IRegistrableEnemy enemy) { //Using interface will go around error
- //impementation
- }
-}
-
-public interface IRegistrableEnemy
-{
- //implementation
-}
-```
-
-2) Adjust method param to have common base class
-```
-public class EnemyManager : MonoBehaviour {
- public void RegisterEnemy(MonoBehaviour enemy) { //Using common MonoBehaviour will go around error
- //impementation
- }
-}
-```
-
-### Assigning `this` to a field references
-Similar as above, this could cause some trouble although 'Enable method calls with 'this' as argument fix' setting will fix most of the issues.
-
-Especially visible with singletons.
-eg.
-
-```
-public class MySingleton: MonoBehaviour {
- public static MySingleton Instance;
-
- void Start() {
- Instance = this;
- }
-}
-```
-
-### Calling internal class members from changed code
-> You can use [User Defined Script Overrides](#user-defined-script-overrides) to overcome this limitation
-
-> fixed in unreleased 1.5 - please get in touch if you need a copy before release
-
-Technically, once your changed code is compiled it'll be in a separate assembly. As a result this changed code won't be able to access internal classes from assembly it originated from.
-
-### Extensive use of nested classed / structs
-> You can use [User Defined Script Overrides](#user-defined-script-overrides) to overcome this limitation
-
-If your code-base contains lots of nested classes - you may see more compilation errors.
-
-Easy workaround is to move those nested classes away so they are top-level.
-
-### Creating new public methods
-Hot-reload for new methods will only work with private methods (only called by changed code).
-
-### Adding new references
-When you're trying to reference new code in play-mode session that'll fail if assembly is not yet referencing that (most often happens when using AsmDefs that are not yet referencing each other)
-
-### Changing class that uses extension and passes itself as a reference
-> You can use [User Defined Script Overrides](#user-defined-script-overrides) to overcome this limitation
-
-Changing class that uses extension method and passes itself as a reference will create compiler error.
-
-Generally that shouldn't be an issue, extension methods are primarily used as a syntatic sugar to extend a class that you do not have access to.
-You shouldn't need to create extension methods for types you own (instead those are generally instance methods or base class methods).
-
-Given example:
-```
-public class ExtensionMethodTest
-{
- public string Name;
-
- void Update()
- {
- this.PrintName();
- }
-}
-
-//separate extension file
-public static ExtensionMethodTestExtensions
-{
- public static void PrintName(this ExtensionMethodTest obj)
- {
- Debug.Log(obj.Name);
- }
-}
-```
-
-When changing `ExtensionMethodTest` you'll get compile error. Workaround would be to include method call in your type, eg:
-```
-public class ExtensionMethodTest {
- public string Name;
-
- void Update() {
- this.PrintName();
- }
-
- private void PrintName() {
- Debug.Log(Name);
- }
-}
-```
-*Arguably that's what should be done in the first place.*
-
-Adjusting classes that use extension methods without passing itself as a reference - will work correctly. eg:
-```
-public class ObjectFromExternalAssembly()
-{
- //included just to illustrate example, that'd be in compiled assembly
- //that you can't change and use extension method approach
-
- public string Name;
-}
-
-public class ExtensionMethodTester
-{
- void Update()
- {
- var t = new ExtensionMethodTest();
- t.PrintName()
- }
-}
-
-//separate extension file
-public static ObjectFromExternalAssemblyExtensions
-{
- public static void PrintName(this ObjectFromExternalAssembly obj)
- {
- Debug.Log(obj.Name);
- }
-}
-```
-
-### Changing class that implements internal interface can trigger compilation error
-> You can use [User Defined Script Overrides](#user-defined-script-overrides) to overcome this limitation
-
-> fixed in unreleased 1.5 - please get in touch if you need a copy before release
-
-If class is implementing interface that's defined in different file as internal (default for no access modifier) - then changes to that class will fail to compile.
-
-eg.
-```
-//file IInterface.cs
-interface IInterface { //default interface access-modifier is 'internal'
- //declaration
-}
-
-//file ClassImplementingIInterface.cs
-class ClassImplementingIInterface: IInterface {
- //changing this class will cause CS0122 'IInterface' is inaccessible due to it's protection level
-}
-
-```
-
-> Quick workaround is to declare that interface as public
->
-
-### Changing class that accesses `private protected` members
-> You can use [User Defined Script Overrides](#user-defined-script-overrides) to overcome this limitation
-
-> fixed in unreleased 1.5 - please get in touch if you need a copy before release
-
-With C# 7.2 `private protected` access modifier was introduced. It works as `protected` access modifier in a sense that inherited classes can access it but.
-Addition of `private` also limits it to same assembly. Your changes are technically compiled into separate assembly and at the moment trying to access `private protected` in changed code will produce compiler error.
-
-> Easiest workaround for now is to declare those `private protected` members as `protected`.
-
-### Limited debugger support for Rider when using Unity 2019 and 2020
-Once breakpoint has been hit it'll stop asset from hot-reloading in that play-session. Newer Unity versions are supporting debugging.
-
-### No IL2CPP support
-Asset runs based on specific .NET functionality, IL2CPP builds will not be supported. Although as this is development workflow aid you can build your APK with Mono backend (android) and change later.
-
-### Partial classes
-Experimental support (on by default). Potentially could have some performance implications as it's file-read heavy in current state. Can be disabled in options if needed.
-
-Your partial class file needs to share name with actual class. eg
-`public class PartialClass`
-
-Needs to be in files
-**PartialClass**XYZ
-
-eg.
-- PartialClass.1.cs
-- PartialClass.2.cs
-
-## FAQ
-### How is this asset different than Live Script Reload?
-Fast Script Reload
-- hot reload in editor
-
-Live Script Reload
-- same hot reload in editor as FSR (includes FSR)
-+ **AND hot reload directly in builds / on-device**
-+ you don't have to download them both separately, LSR is also 1 package import
-+ standalone extension priced at $35, or if you've already bought Fast Script Reload it's $5 upgrade
-
-### Editor makes full reload on any change in playmode
-
-Unity Editor has an option to auto recompile changes. **For tool to work properly you want to have that either disabled or enabled only outside of playmode.**
-
-You can adjusted auto-reload at any time via `Edit -> Preferences -> Asset Pipeline -> Auto Refresh`.
-
-*Tool will also offer to disable auto-refresh on startup.*
-
-It's possible to set auto-refresh to enabled but only outside of playmode. Depending on editor version used this can be found in:
-- `Edit -> Preferences -> General -> Script Changes While Playing -> Recompile After Finished Playing`
-- or `Edit -> Preferences -> Asset Pipeline -> Auto Refresh -> Enabled Outside Playmode`
-
-### VS Code shows console shows errors
-VS Code proj file (csproj) generate with NetFramework version 4.7.1. One of the plugin DLLs is targeting version 4.8.
-Even though VS Code does not compile that code (Unity does) - it'll still show error as it didn't load the library for code-completion.
-
-It's not a plugin issue as such, other dlls will have same troubles.
-Best solution I've found is to force csproj files to be generated with 4.8 version instead.
-This can be achieved with following editor script
-```
-using System.IO;
-using System.Text.RegularExpressions;
-using UnityEditor;
-using UnityEngine;
-
-public class VisualStudioProjectGenerationPostProcess : AssetPostprocessor
-{
- private static void OnGeneratedCSProjectFiles()
- {
- Debug.Log("OnGeneratedCSProjectFiles");
- var dir = Directory.GetCurrentDirectory();
- var files = Directory.GetFiles(dir, "*.csproj");
- foreach (var file in files)
- ChangeTargetFrameworkInfProjectFiles(file);
- }
-
- static void ChangeTargetFrameworkInfProjectFiles(string file)
- {
- var text = File.ReadAllText(file);
- var find = "TargetFrameworkVersion>v4.7.1v4.8 As a one-off you may also need to go to Edit -> Preferences -> External Tools -> click 'Regenerate project files' buttons
-
-### When importing I'm getting error: 'Unable to update following assemblies: (...)/ImmersiveVRTools.Common.Runtime.dll'
-This happens occasionally, especially on upgrade between versions. It's harmless error that'll go away on play mode.
-
-### When upgrading between versions, eg 1.1 to 1.2 example scene cubes are pink
-This is down to reimporting 'Point' prefab. Right now plugin will make sure it's using correct shader eg. URP / Built-in but only on initial import.
-
-To fix please go to `FastScripReload\Examples\Point\Point.prefab` and search for 'Point' shader.
-
-### On Mac hot reload does not trigger when changing files
-It'd seem for some code editors on Mac file changes are not picked up. This seems to be down to editors not updating LastWrite property on save and file watcher can't pick up the change.
-Unfortunately right now only workaround is to use editor that does update it, eg VSCode.
-
-### I removed FSR but my scripts are still not reloading
-FSR initially asks if you want to disable Unity auto-reload. If you select yes, then it'll let you know you should now trigger full reload with CTRL + R.
-That's a Unity setting and it does not change back when removing asset.
-
-> To change go to 'Edit -> Preferences -> Asset Pipeline -> Auto Refresh -> Enabled'
-
-## Roadmap
-- add Mac silicon support
-- ~~add Mac/Linux support~~ (added with 1.1)
-- ~~add debugger support for hot-reloaded scripts~~ (added with 1.2)
-- ~~allow to add new fields (adjustable in Editor)~~ (added with 1.3)
-- better compiler support to work around limitations
\ No newline at end of file
diff --git a/Assets/FastScriptReload/Documentation/documentation.md.meta b/Assets/FastScriptReload/Documentation/documentation.md.meta
deleted file mode 100644
index cb4f192..0000000
--- a/Assets/FastScriptReload/Documentation/documentation.md.meta
+++ /dev/null
@@ -1,14 +0,0 @@
-fileFormatVersion: 2
-guid: b15135889062bcf428b025b2fb045da8
-TextScriptImporter:
- externalObjects: {}
- userData:
- assetBundleName:
- assetBundleVariant:
-AssetOrigin:
- serializedVersion: 1
- productId: 239351
- packageName: Fast Script Reload
- packageVersion: 1.6.1
- assetPath: Assets/FastScriptReload/Documentation/documentation.md
- uploadId: 710802
diff --git a/Assets/FastScriptReload/Documentation/documentation.pdf b/Assets/FastScriptReload/Documentation/documentation.pdf
deleted file mode 100644
index a62ba71..0000000
Binary files a/Assets/FastScriptReload/Documentation/documentation.pdf and /dev/null differ
diff --git a/Assets/FastScriptReload/Documentation/documentation.pdf.meta b/Assets/FastScriptReload/Documentation/documentation.pdf.meta
deleted file mode 100644
index 02b6858..0000000
--- a/Assets/FastScriptReload/Documentation/documentation.pdf.meta
+++ /dev/null
@@ -1,14 +0,0 @@
-fileFormatVersion: 2
-guid: e4d31e46efd843644b0ca6010aa753e4
-DefaultImporter:
- externalObjects: {}
- userData:
- assetBundleName:
- assetBundleVariant:
-AssetOrigin:
- serializedVersion: 1
- productId: 239351
- packageName: Fast Script Reload
- packageVersion: 1.6.1
- assetPath: Assets/FastScriptReload/Documentation/documentation.pdf
- uploadId: 710802
diff --git a/Assets/FastScriptReload/Documentation/release-notes.md b/Assets/FastScriptReload/Documentation/release-notes.md
deleted file mode 100644
index 63ff3e8..0000000
--- a/Assets/FastScriptReload/Documentation/release-notes.md
+++ /dev/null
@@ -1,70 +0,0 @@
-1.8
-- Added Unity 6 support
-- Improved extension methods rewriting
-- Partial classes support (contributed by Jlabarca)
-- Unity 2019 / 2020 no longer officially supported
-
-1.7
-- Optional file watching can be done via direct WindowsAPI (contributed by SamPruden)
-- Extended UI to allow for easy choice of file watcher implementation
-
-1.6
-- Added more Unit Tests to ensure various code patterns can be rewritten correctly
-- Added Watch Only Specific Files and Folders mode (contributed by GhatSmith)
-- Added better Odin support for dynamically added fields (contributed by GhatSmith)
-- Updated Roslyn lib version to 4.6.0 for better code parsing (contributed by SamPruden)
-- Improved error handling for code parsing (contributed by SamPruden)
-- Added Custom-File-Watcher implementation (for cases where standard FileWatcher API is causing issues) (contributed by D0rkKnight)
-
-1.5
-- you can now import FSR as a package from github page
-- hot-reloading internal interfaces / classes would no longer cause compilation error
-- OnScriptHotReload method can be added at runtime
-- builder functions will be correctly rewritten
-- hot reload status (red / green) will be visible in project panel next to changed script
-- compilation error reporting will be much improved, project panel will allow to click error next to actual file for more details and workarounds
-- all type declarations that were appended with __Patched_ postfix to avoid name collisions will also have all corresponding identifiers changed
-- OnScriptHotReload methods will also be called in editor-workflow
-
-1.4
-- added experimental editor-mode hot-reload, you'll need to opt in via Start Screen -> Editor Hot-Reload (please read the notes on that page, playmode workflow is still far superior)
-- you can now define User Script Rewrite Overrides - which will allow you to overcome most of existing limitations that cause compilation errors (on a one by one basis)
-- big optimization in how long hot-reload part will take, first call will be unaffected when type cache is build but subsequent calls will be significantly quicker
-- added 'Exclude References' options - this allows to remove specific dll references from dynamically compiled code (as in some cases you may get 'type defined in both assembly x.dll and y.dll'
-- destructors will no longer cause compilation error
-- (options opt-in) script rewriting can optionally emit comment - why change was made to help with troubleshooting issues
-- Unity assembly reload can be forced off via LockAssemblyReload if specified in options - sometimes even though Auto-Refresh is turned off Editor still tries to recompile changes in playmode which prevents FSR from working
-- new fields support (experimental) will be enabled by default
-
-1.3.1
-
-- open source release on github
-
-1.3 - (Experimental) - New fields added in playmode
-
-- New fields can be added and used in code
-- New fields can be adjusted in editor (same as standard fields)
-- New fields will be initialized to whatever value is specified in code or default value
-- Experimental feature - at this stage expect some issues
-- Opt-in - disabled by default to enable go to 'Window -> Fast Script Reload -> Start Screen -> New Fields -> enable'
-
-1.2 - Debugger support
-
-- Added debugger support (see documentation)
-
-1.1 - Mac support / bug fixes
-
-- Added Mac support (only INTEL editor version, SILICON still not supported)
-- Added Linux support
-- fixed namespace clash with Unity.Collections package
-- common code lib will not be included in builds
-- added check for auto-refresh in Editor - will proide guidance and option to adjust as otherwise full editor reload is triggered for changes
-- added workaround for Unity file-watcher returning wrong file path on some editor versions
-- added option to allow disabling DidFieldCountCheck - allowing to detour methods in those cases (eg for Mirror where it'll adjust IL and cause mismatch)
-- added option to configure FileWatcher paths/filters as in some cases watching root directory was causing performance issues
-- added minor initial-load optimisations - using session-state for items that do not need to be resolved on every reload
-
-1.0 - First release, included features:
-
-Fast script reload in editor / play-mode (compiles only changed files and hot-reloads them into current play session)
-Hot-reload on device (in build)
\ No newline at end of file
diff --git a/Assets/FastScriptReload/Documentation/release-notes.md.meta b/Assets/FastScriptReload/Documentation/release-notes.md.meta
deleted file mode 100644
index 8463dd0..0000000
--- a/Assets/FastScriptReload/Documentation/release-notes.md.meta
+++ /dev/null
@@ -1,10 +0,0 @@
-fileFormatVersion: 2
-guid: cd8daa3bb60e4b30b6520184de1abcda
-timeCreated: 1672842170
-AssetOrigin:
- serializedVersion: 1
- productId: 239351
- packageName: Fast Script Reload
- packageVersion: 1.6.1
- assetPath: Assets/FastScriptReload/Documentation/release-notes.md
- uploadId: 710802
diff --git a/Assets/FastScriptReload/Plugins/Harmony/HarmonyLicense.txt b/Assets/FastScriptReload/Plugins/Harmony/HarmonyLicense.txt
deleted file mode 100644
index edeae8e..0000000
--- a/Assets/FastScriptReload/Plugins/Harmony/HarmonyLicense.txt
+++ /dev/null
@@ -1,21 +0,0 @@
-MIT License
-
-Copyright (c) 2017 Andreas Pardeike
-
-Permission is hereby granted, free of charge, to any person obtaining a copy
-of this software and associated documentation files (the "Software"), to deal
-in the Software without restriction, including without limitation the rights
-to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
-copies of the Software, and to permit persons to whom the Software is
-furnished to do so, subject to the following conditions:
-
-The above copyright notice and this permission notice shall be included in all
-copies or substantial portions of the Software.
-
-THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
-AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
-LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
-OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
-SOFTWARE.
\ No newline at end of file
diff --git a/Assets/FastScriptReload/Plugins/Harmony/HarmonyLicense.txt.meta b/Assets/FastScriptReload/Plugins/Harmony/HarmonyLicense.txt.meta
deleted file mode 100644
index 6be6d4a..0000000
--- a/Assets/FastScriptReload/Plugins/Harmony/HarmonyLicense.txt.meta
+++ /dev/null
@@ -1,14 +0,0 @@
-fileFormatVersion: 2
-guid: 22053913c34700a4a9c13b853eea3317
-TextScriptImporter:
- externalObjects: {}
- userData:
- assetBundleName:
- assetBundleVariant:
-AssetOrigin:
- serializedVersion: 1
- productId: 239351
- packageName: Fast Script Reload
- packageVersion: 1.6.1
- assetPath: Assets/FastScriptReload/Plugins/Harmony/HarmonyLicense.txt
- uploadId: 710802
diff --git a/Assets/FastScriptReload/Plugins/Harmony/net48.meta b/Assets/FastScriptReload/Plugins/Harmony/net48.meta
deleted file mode 100644
index 6602f8f..0000000
--- a/Assets/FastScriptReload/Plugins/Harmony/net48.meta
+++ /dev/null
@@ -1,8 +0,0 @@
-fileFormatVersion: 2
-guid: 1c409188546e50f4a963ad9ae5deda06
-folderAsset: yes
-DefaultImporter:
- externalObjects: {}
- userData:
- assetBundleName:
- assetBundleVariant:
diff --git a/Assets/FastScriptReload/Plugins/Harmony/net48/0Harmony.dll b/Assets/FastScriptReload/Plugins/Harmony/net48/0Harmony.dll
deleted file mode 100644
index e182535..0000000
Binary files a/Assets/FastScriptReload/Plugins/Harmony/net48/0Harmony.dll and /dev/null differ
diff --git a/Assets/FastScriptReload/Plugins/Harmony/net48/0Harmony.dll.meta b/Assets/FastScriptReload/Plugins/Harmony/net48/0Harmony.dll.meta
deleted file mode 100644
index a94886b..0000000
--- a/Assets/FastScriptReload/Plugins/Harmony/net48/0Harmony.dll.meta
+++ /dev/null
@@ -1,84 +0,0 @@
-fileFormatVersion: 2
-guid: 494e757c92cba704db1d95279f80a30f
-PluginImporter:
- externalObjects: {}
- serializedVersion: 2
- iconMap: {}
- executionOrder: {}
- defineConstraints:
- - UNITY_EDITOR || LiveScriptReload_IncludeInBuild_Enabled
- isPreloaded: 0
- isOverridable: 0
- isExplicitlyReferenced: 1
- validateReferences: 1
- platformData:
- - first:
- : Any
- second:
- enabled: 0
- settings:
- Exclude Android: 0
- Exclude Editor: 0
- Exclude Linux64: 0
- Exclude OSXUniversal: 0
- Exclude Win: 0
- Exclude Win64: 0
- - first:
- Android: Android
- second:
- enabled: 1
- settings:
- CPU: ARMv7
- - first:
- Any:
- second:
- enabled: 1
- settings: {}
- - first:
- Editor: Editor
- second:
- enabled: 1
- settings:
- CPU: AnyCPU
- DefaultValueInitialized: true
- OS: AnyOS
- - first:
- Standalone: Linux64
- second:
- enabled: 1
- settings:
- CPU: None
- - first:
- Standalone: OSXUniversal
- second:
- enabled: 1
- settings:
- CPU: None
- - first:
- Standalone: Win
- second:
- enabled: 1
- settings:
- CPU: None
- - first:
- Standalone: Win64
- second:
- enabled: 1
- settings:
- CPU: None
- - first:
- Windows Store Apps: WindowsStoreApps
- second:
- enabled: 0
- settings:
- CPU: AnyCPU
- userData:
- assetBundleName:
- assetBundleVariant:
-AssetOrigin:
- serializedVersion: 1
- productId: 239351
- packageName: Fast Script Reload
- packageVersion: 1.6.1
- assetPath: Assets/FastScriptReload/Plugins/Harmony/net48/0Harmony.dll
- uploadId: 710802
diff --git a/Assets/FastScriptReload/Plugins/Harmony/net48/0Harmony.xml b/Assets/FastScriptReload/Plugins/Harmony/net48/0Harmony.xml
deleted file mode 100644
index f1b9b4c..0000000
--- a/Assets/FastScriptReload/Plugins/Harmony/net48/0Harmony.xml
+++ /dev/null
@@ -1,3693 +0,0 @@
-
-
-
- 0Harmony
-
-
-
- A factory to create delegate types
-
-
- Default constructor
-
-
- Creates a delegate type for a method
- The method
- The new delegate type
-
-
-
- A getter delegate type
- Type that getter gets field/property value from
- Type of the value that getter gets
- The instance get getter uses
- An delegate
-
-
-
- A setter delegate type
- Type that setter sets field/property value for
- Type of the value that setter sets
- The instance the setter uses
- The value the setter uses
- An delegate
-
-
-
- A constructor delegate type
- Type that constructor creates
- An delegate
-
-
-
- A helper class for fast access to getters and setters
-
-
- Creates an instantiation delegate
- Type that constructor creates
- The new instantiation delegate
-
-
-
- Creates an getter delegate for a property
- Type that getter reads property from
- Type of the property that gets accessed
- The property
- The new getter delegate
-
-
-
- Creates an getter delegate for a field
- Type that getter reads field from
- Type of the field that gets accessed
- The field
- The new getter delegate
-
-
-
- Creates an getter delegate for a field (with a list of possible field names)
- Type that getter reads field/property from
- Type of the field/property that gets accessed
- A list of possible field names
- The new getter delegate
-
-
-
- Creates an setter delegate
- Type that setter assigns property value to
- Type of the property that gets assigned
- The property
- The new setter delegate
-
-
-
- Creates an setter delegate for a field
- Type that setter assigns field value to
- Type of the field that gets assigned
- The field
- The new getter delegate
-
-
-
- A delegate to invoke a method
- The instance
- The method parameters
- The method result
-
-
- A helper class to invoke method with delegates
-
-
- Creates a fast invocation handler from a method
- The method to invoke
- Controls if boxed value object is accessed/updated directly
- The
-
-
- The directBoxValueAccess option controls how value types passed by reference (e.g. ref int, out my_struct) are handled in the arguments array
- passed to the fast invocation handler.
- Since the arguments array is an object array, any value types contained within it are actually references to a boxed value object.
- Like any other object, there can be other references to such boxed value objects, other than the reference within the arguments array.
- For example,
-
- var val = 5;
- var box = (object)val;
- var arr = new object[] { box };
- handler(arr); // for a method with parameter signature: ref/out/in int
-
-
-
-
- If directBoxValueAccess is true, the boxed value object is accessed (and potentially updated) directly when the handler is called,
- such that all references to the boxed object reflect the potentially updated value.
- In the above example, if the method associated with the handler updates the passed (boxed) value to 10, both box and arr[0]
- now reflect the value 10. Note that the original val is not updated, since boxing always copies the value into the new boxed value object.
-
-
- If directBoxValueAccess is false (default), the boxed value object in the arguments array is replaced with a "reboxed" value object,
- such that potential updates to the value are reflected only in the arguments array.
- In the above example, if the method associated with the handler updates the passed (boxed) value to 10, only arr[0] now reflects the value 10.
-
-
-
-
- A low level memory helper
-
-
-
- Mark method for no inlining (currently only works on Mono)
- The method/constructor to change
-
-
-
- Detours a method
- The original method/constructor
- The replacement method/constructor
- An error string
-
-
-
- Writes a jump to memory
- The memory address
- Jump destination
- An error string
-
-
-
- Gets the start of a method in memory
- The method/constructor
- [out] Details of the exception
- The method start address
-
-
-
- special parameter names that can be used in prefix and postfix methods
-
-
- Patch function helpers
-
-
- Sorts patch methods by their priority rules
- The original method
- Patches to sort
- Use debug mode
- The sorted patch methods
-
-
-
- Creates new replacement method with the latest patches and detours the original method
- The original method
- Information describing the patches
- The newly created replacement method
-
-
-
- Creates a patch sorter
- Array of patches that will be sorted
- Use debugging
-
-
- Sorts internal PatchSortingWrapper collection and caches the results.
- After first run the result is provided from the cache.
- The original method
- The sorted patch methods
-
-
- Checks if the sorter was created with the same patch list and as a result can be reused to
- get the sorted order of the patches.
- List of patches to check against
- true if equal
-
-
- Removes one unresolved dependency from the least important patch.
-
-
- Outputs all unblocked patches from the waiting list to results list
-
-
- Adds patch to both results list and handled patches set
- Patch to add
-
-
- Wrapper used over the Patch object to allow faster dependency access and
- dependency removal in case of cyclic dependencies
-
-
- Create patch wrapper object used for sorting
- Patch to wrap
-
-
- Determines how patches sort
- The other patch
- integer to define sort order (-1, 0, 1)
-
-
- Determines whether patches are equal
- The other patch
- true if equal
-
-
- Hash function
- A hash code
-
-
- Bidirectionally registers Patches as after dependencies
- List of dependencies to register
-
-
- Bidirectionally registers Patches as before dependencies
- List of dependencies to register
-
-
- Bidirectionally removes Patch from after dependencies
- Patch to remove
-
-
- Bidirectionally removes Patch from before dependencies
- Patch to remove
-
-
- Specifies the type of method
-
-
-
- This is a normal method
-
-
- This is a getter
-
-
- This is a setter
-
-
- This is a constructor
-
-
- This is a static constructor
-
-
- This targets the MoveNext method of the enumerator result
-
-
- Specifies the type of argument
-
-
-
- This is a normal argument
-
-
- This is a reference argument (ref)
-
-
- This is an out argument (out)
-
-
- This is a pointer argument (&)
-
-
- Specifies the type of patch
-
-
-
- Any patch
-
-
- A prefix patch
-
-
- A postfix patch
-
-
- A transpiler
-
-
- A finalizer
-
-
- A reverse patch
-
-
- Specifies the type of reverse patch
-
-
-
- Use the unmodified original method (directly from IL)
-
-
- Use the original as it is right now including previous patches but excluding future ones
-
-
- Specifies the type of method call dispatching mechanics
-
-
-
- Call the method using dynamic dispatching if method is virtual (including overriden)
-
-
- This is the built-in form of late binding (a.k.a. dynamic binding) and is the default dispatching mechanic in C#.
- This directly corresponds with the instruction.
-
-
- For virtual (including overriden) methods, the instance type's most-derived/overriden implementation of the method is called.
- For non-virtual (including static) methods, same behavior as : the exact specified method implementation is called.
-
-
- Note: This is not a fully dynamic dispatch, since non-virtual (including static) methods are still called non-virtually.
- A fully dynamic dispatch in C# involves using
- the dynamic type
- (actually a fully dynamic binding, since even the name and overload resolution happens at runtime), which does not support.
-
-
-
-
- Call the method using static dispatching, regardless of whether method is virtual (including overriden) or non-virtual (including static)
-
-
- a.k.a. non-virtual dispatching, early binding, or static binding.
- This directly corresponds with the instruction.
-
-
- For both virtual (including overriden) and non-virtual (including static) methods, the exact specified method implementation is called, without virtual/override mechanics.
-
-
-
-
- The base class for all Harmony annotations (not meant to be used directly)
-
-
-
- The common information for all attributes
-
-
- Annotation to define your Harmony patch methods
-
-
-
- An empty annotation can be used together with TargetMethod(s)
-
-
-
- An annotation that specifies a class to patch
- The declaring class/type
-
-
-
- An annotation that specifies a method, property or constructor to patch
- The declaring class/type
- The argument types of the method or constructor to patch
-
-
-
- An annotation that specifies a method, property or constructor to patch
- The declaring class/type
- The name of the method, property or constructor to patch
-
-
-
- An annotation that specifies a method, property or constructor to patch
- The declaring class/type
- The name of the method, property or constructor to patch
- An array of argument types to target overloads
-
-
-
- An annotation that specifies a method, property or constructor to patch
- The declaring class/type
- The name of the method, property or constructor to patch
- An array of argument types to target overloads
- Array of
-
-
-
- An annotation that specifies a method, property or constructor to patch
- The declaring class/type
- The
-
-
-
- An annotation that specifies a method, property or constructor to patch
- The declaring class/type
- The
- An array of argument types to target overloads
-
-
-
- An annotation that specifies a method, property or constructor to patch
- The declaring class/type
- The
- An array of argument types to target overloads
- Array of
-
-
-
- An annotation that specifies a method, property or constructor to patch
- The declaring class/type
- The name of the method, property or constructor to patch
- The
-
-
-
- An annotation that specifies a method, property or constructor to patch
- The name of the method, property or constructor to patch
-
-
-
- An annotation that specifies a method, property or constructor to patch
- The name of the method, property or constructor to patch
- An array of argument types to target overloads
-
-
-
- An annotation that specifies a method, property or constructor to patch
- The name of the method, property or constructor to patch
- An array of argument types to target overloads
- An array of
-
-
-
- An annotation that specifies a method, property or constructor to patch
- The name of the method, property or constructor to patch
- The
-
-
-
- An annotation that specifies a method, property or constructor to patch
- The
-
-
-
- An annotation that specifies a method, property or constructor to patch
- The
- An array of argument types to target overloads
-
-
-
- An annotation that specifies a method, property or constructor to patch
- The
- An array of argument types to target overloads
- An array of
-
-
-
- An annotation that specifies a method, property or constructor to patch
- An array of argument types to target overloads
-
-
-
- An annotation that specifies a method, property or constructor to patch
- An array of argument types to target overloads
- An array of
-
-
-
- An annotation that specifies a method, property or constructor to patch
- The full name of the declaring class/type
- The name of the method, property or constructor to patch
- The
-
-
-
- Annotation to define the original method for delegate injection
-
-
-
- An annotation that specifies a class to patch
- The declaring class/type
-
-
-
- An annotation that specifies a method, property or constructor to patch
- The declaring class/type
- The argument types of the method or constructor to patch
-
-
-
- An annotation that specifies a method, property or constructor to patch
- The declaring class/type
- The name of the method, property or constructor to patch
-
-
-
- An annotation that specifies a method, property or constructor to patch
- The declaring class/type
- The name of the method, property or constructor to patch
- An array of argument types to target overloads
-
-
-
- An annotation that specifies a method, property or constructor to patch
- The declaring class/type
- The name of the method, property or constructor to patch
- An array of argument types to target overloads
- Array of
-
-
-
- An annotation that specifies a method, property or constructor to patch
- The declaring class/type
- The
-
-
-
- An annotation that specifies a method, property or constructor to patch
- The declaring class/type
- The
- An array of argument types to target overloads
-
-
-
- An annotation that specifies a method, property or constructor to patch
- The declaring class/type
- The
- An array of argument types to target overloads
- Array of
-
-
-
- An annotation that specifies a method, property or constructor to patch
- The declaring class/type
- The name of the method, property or constructor to patch
- The
-
-
-
- An annotation that specifies a method, property or constructor to patch
- The name of the method, property or constructor to patch
-
-
-
- An annotation that specifies a method, property or constructor to patch
- The name of the method, property or constructor to patch
- An array of argument types to target overloads
-
-
-
- An annotation that specifies a method, property or constructor to patch
- The name of the method, property or constructor to patch
- An array of argument types to target overloads
- An array of
-
-
-
- An annotation that specifies a method, property or constructor to patch
- The name of the method, property or constructor to patch
- The
-
-
-
- An annotation that specifies call dispatching mechanics for the delegate
- The
-
-
-
- An annotation that specifies a method, property or constructor to patch
- The
- An array of argument types to target overloads
-
-
-
- An annotation that specifies a method, property or constructor to patch
- The
- An array of argument types to target overloads
- An array of
-
-
-
- An annotation that specifies a method, property or constructor to patch
- An array of argument types to target overloads
-
-
-
- An annotation that specifies a method, property or constructor to patch
- An array of argument types to target overloads
- An array of
-
-
-
- Annotation to define your standin methods for reverse patching
-
-
-
- An annotation that specifies the type of reverse patching
- The of the reverse patch
-
-
-
- A Harmony annotation to define that all methods in a class are to be patched
-
-
-
- A Harmony annotation
-
-
-
- A Harmony annotation to define patch priority
- The priority
-
-
-
- A Harmony annotation
-
-
-
- A Harmony annotation to define that a patch comes before another patch
- The array of harmony IDs of the other patches
-
-
-
- A Harmony annotation
-
-
- A Harmony annotation to define that a patch comes after another patch
- The array of harmony IDs of the other patches
-
-
-
- A Harmony annotation
-
-
- A Harmony annotation to debug a patch (output uses to log to your Desktop)
-
-
-
- Specifies the Prepare function in a patch class
-
-
-
- Specifies the Cleanup function in a patch class
-
-
-
- Specifies the TargetMethod function in a patch class
-
-
-
- Specifies the TargetMethods function in a patch class
-
-
-
- Specifies the Prefix function in a patch class
-
-
-
- Specifies the Postfix function in a patch class
-
-
-
- Specifies the Transpiler function in a patch class
-
-
-
- Specifies the Finalizer function in a patch class
-
-
-
- A Harmony annotation
-
-
-
- The name of the original argument
-
-
-
- The index of the original argument
-
-
-
- The new name of the original argument
-
-
-
- An annotation to declare injected arguments by name
-
-
-
- An annotation to declare injected arguments by index
- Zero-based index
-
-
-
- An annotation to declare injected arguments by renaming them
- Name of the original argument
- New name
-
-
-
- An annotation to declare injected arguments by index and renaming them
- Zero-based index
- New name
-
-
-
- An abstract wrapper around OpCode and their operands. Used by transpilers
-
-
-
- The opcode
-
-
-
- The operand
-
-
-
- All labels defined on this instruction
-
-
-
- All exception block boundaries defined on this instruction
-
-
-
- Creates a new CodeInstruction with a given opcode and optional operand
- The opcode
- The operand
-
-
-
- Create a full copy (including labels and exception blocks) of a CodeInstruction
- The to copy
-
-
-
- Clones a CodeInstruction and resets its labels and exception blocks
- A lightweight copy of this code instruction
-
-
-
- Clones a CodeInstruction, resets labels and exception blocks and sets its opcode
- The opcode
- A copy of this CodeInstruction with a new opcode
-
-
-
- Clones a CodeInstruction, resets labels and exception blocks and sets its operand
- The operand
- A copy of this CodeInstruction with a new operand
-
-
-
- Creates a CodeInstruction calling a method (CALL)
- The class/type where the method is declared
- The name of the method (case sensitive)
- Optional parameters to target a specific overload of the method
- Optional list of types that define the generic version of the method
- A code instruction that calls the method matching the arguments
-
-
-
- Creates a CodeInstruction calling a method (CALL)
- The target method in the form TypeFullName:MethodName, where the type name matches a form recognized by Type.GetType like Some.Namespace.Type.
- Optional parameters to target a specific overload of the method
- Optional list of types that define the generic version of the method
- A code instruction that calls the method matching the arguments
-
-
-
- Creates a CodeInstruction calling a method (CALL)
- The lambda expression using the method
-
-
-
-
- Creates a CodeInstruction calling a method (CALL)
- The lambda expression using the method
-
-
-
-
- Creates a CodeInstruction calling a method (CALL)
- The lambda expression using the method
-
-
-
-
- Creates a CodeInstruction calling a method (CALL)
- The lambda expression using the method
-
-
-
-
- Returns an instruction to call the specified closure
- The delegate type to emit
- The closure that defines the method to call
- A that calls the closure as a method
-
-
-
- Creates a CodeInstruction loading a field (LD[S]FLD[A])
- The class/type where the field is defined
- The name of the field (case sensitive)
- Use address of field
-
-
-
- Creates a CodeInstruction storing to a field (ST[S]FLD)
- The class/type where the field is defined
- The name of the field (case sensitive)
-
-
-
- Returns a string representation of the code instruction
- A string representation of the code instruction
-
-
-
- Exception block types
-
-
-
- The beginning of an exception block
-
-
-
- The beginning of a catch block
-
-
-
- The beginning of an except filter block (currently not supported to use in a patch)
-
-
-
- The beginning of a fault block
-
-
-
- The beginning of a finally block
-
-
-
- The end of an exception block
-
-
-
- An exception block
-
-
-
- Block type
-
-
-
- Catch type
-
-
-
- Creates an exception block
- The
- The catch type
-
-
-
- The Harmony instance is the main entry to Harmony. After creating one with an unique identifier, it is used to patch and query the current application domain
-
-
-
- The unique identifier
-
-
-
- Set to true before instantiating Harmony to debug Harmony or use an environment variable to set HARMONY_DEBUG to '1' like this: cmd /C "set HARMONY_DEBUG=1 && game.exe"
- This is for full debugging. To debug only specific patches, use the attribute
-
-
-
- Creates a new Harmony instance
- A unique identifier (you choose your own)
- A Harmony instance
-
-
-
- Searches the current assembly for Harmony annotations and uses them to create patches
- This method can fail to use the correct assembly when being inlined. It calls StackTrace.GetFrame(1) which can point to the wrong method/assembly. If you are unsure or run into problems, use PatchAll(Assembly.GetExecutingAssembly()) instead.
-
-
-
- Creates a empty patch processor for an original method
- The original method/constructor
- A new instance
-
-
-
- Creates a patch class processor from an annotated class
- The class/type
- A new instance
-
-
-
- Creates a reverse patcher for one of your stub methods
- The original method/constructor
- The stand-in stub method as
- A new instance
-
-
-
- Searches an assembly for Harmony annotations and uses them to create patches
- The assembly
-
-
-
- Creates patches by manually specifying the methods
- The original method/constructor
- An optional prefix method wrapped in a object
- An optional postfix method wrapped in a object
- An optional transpiler method wrapped in a object
- An optional finalizer method wrapped in a object
- The replacement method that was created to patch the original method
-
-
-
- Patches a foreign method onto a stub method of yours and optionally applies transpilers during the process
- The original method/constructor you want to duplicate
- Your stub method as that will become the original. Needs to have the correct signature (either original or whatever your transpilers generates)
- An optional transpiler as method that will be applied during the process
- The replacement method that was created to patch the stub method
-
-
-
- Unpatches methods by patching them with zero patches. Fully unpatching is not supported. Be careful, unpatching is global
- The optional Harmony ID to restrict unpatching to a specific Harmony instance
- This method could be static if it wasn't for the fact that unpatching creates a new replacement method that contains your harmony ID
-
-
-
- Unpatches a method by patching it with zero patches. Fully unpatching is not supported. Be careful, unpatching is global
- The original method/constructor
- The
- The optional Harmony ID to restrict unpatching to a specific Harmony instance
-
-
-
- Unpatches a method by patching it with zero patches. Fully unpatching is not supported. Be careful, unpatching is global
- The original method/constructor
- The patch method as method to remove
-
-
-
- Test for patches from a specific Harmony ID
- The Harmony ID
- True if patches for this ID exist
-
-
-
- Gets patch information for a given original method
- The original method/constructor
- The patch information as
-
-
-
- Gets the methods this instance has patched
- An enumeration of original methods/constructors
-
-
-
- Gets all patched original methods in the appdomain
- An enumeration of patched original methods/constructors
-
-
-
- Gets the original method from a given replacement method
- A replacement method, for example from a stacktrace
- The original method/constructor or null if not found
-
-
-
- Tries to get the method from a stackframe including dynamic replacement methods
- The
- For normal frames, frame.GetMethod() is returned. For frames containing patched methods, the replacement method is returned or null if no method can be found
-
-
-
- Gets the original method from the stackframe and uses original if method is a dynamic replacement
- The
- The original method from that stackframe
-
-
- Gets Harmony version for all active Harmony instances
- [out] The current Harmony version
- A dictionary containing assembly versions keyed by Harmony IDs
-
-
-
- Under Mono, HarmonyException wraps IL compile errors with detailed information about the failure
-
-
-
- Default serialization constructor (not implemented)
- The info
- The context
-
-
-
- Get a list of IL instructions in pairs of offset+code
- A list of key/value pairs which represent an offset and the code at that offset
-
-
-
- Get a list of IL instructions without offsets
- A list of
-
-
-
- Get the error offset of the errornous IL instruction
- The offset
-
-
-
- Get the index of the errornous IL instruction
- The index into the list of instructions or -1 if not found
-
-
-
- A wrapper around a method to use it as a patch (for example a Prefix)
-
-
-
- The original method
-
-
-
- Class/type declaring this patch
-
-
-
- Patch method name
-
-
-
- Optional patch
-
-
-
- Array of argument types of the patch method
-
-
-
- of the patch
-
-
-
- Install this patch before patches with these Harmony IDs
-
-
-
- Install this patch after patches with these Harmony IDs
-
-
-
- Reverse patch type, see
-
-
-
- Create debug output for this patch
-
-
-
- Whether to use (true) or (false) mechanics
- for -attributed delegate
-
-
-
- Default constructor
-
-
-
- Creates a patch from a given method
- The original method
-
-
-
- Creates a patch from a given method
- The original method
- The patch
- A list of harmony IDs that should come after this patch
- A list of harmony IDs that should come before this patch
- Set to true to generate debug output
-
-
-
- Creates a patch from a given method
- The patch class/type
- The patch method name
- The optional argument types of the patch method (for overloaded methods)
-
-
-
- Gets the names of all internal patch info fields
- A list of field names
-
-
-
- Merges annotations
- The list of to merge
- The merged
-
-
-
- Returns a string that represents the annotation
- A string representation
-
-
-
- Annotation extensions
-
-
-
- Copies annotation information
- The source
- The destination
-
-
-
- Clones an annotation
- The to clone
- A copied
-
-
-
- Merges annotations
- The master
- The detail
- A new, merged
-
-
-
- Gets all annotations on a class/type
- The class/type
- A list of all
-
-
-
- Gets merged annotations on a class/type
- The class/type
- The merged
-
-
-
- Gets all annotations on a method
- The method/constructor
- A list of
-
-
-
- Gets merged annotations on a method
- The method/constructor
- The merged
-
-
-
-
- A mutable representation of an inline signature, similar to Mono.Cecil's CallSite.
- Used by the calli instruction, can be used by transpilers
-
-
-
-
- See
-
-
-
- See
-
-
-
- See
-
-
-
- The list of all parameter types or function pointer signatures received by the call site
-
-
-
- The return type or function pointer signature returned by the call site
-
-
-
- Returns a string representation of the inline signature
- A string representation of the inline signature
-
-
-
-
- A mutable representation of a parameter type with an attached type modifier,
- similar to Mono.Cecil's OptionalModifierType / RequiredModifierType and C#'s modopt / modreq
-
-
-
-
- Whether this is a modopt (optional modifier type) or a modreq (required modifier type)
-
-
-
- The modifier type attached to the parameter type
-
-
-
- The modified parameter type
-
-
-
- Returns a string representation of the modifier type
- A string representation of the modifier type
-
-
-
- Patch serialization
-
-
-
- Control the binding of a serialized object to a type
- Specifies the assembly name of the serialized object
- Specifies the type name of the serialized object
- The type of the object the formatter creates a new instance of
-
-
-
- Serializes a patch info
- The
- The serialized data
-
-
-
- Deserialize a patch info
- The serialized data
- A
-
-
-
- Compare function to sort patch priorities
- The patch
- Zero-based index
- The priority
- A standard sort integer (-1, 0, 1)
-
-
-
- Serializable patch information
-
-
-
- Prefixes as an array of
-
-
-
- Postfixes as an array of
-
-
-
- Transpilers as an array of
-
-
-
- Finalizers as an array of
-
-
-
- Returns if any of the patches wants debugging turned on
-
-
-
- Adds prefixes
- An owner (Harmony ID)
- The patch methods
-
-
-
- Adds a prefix
-
-
- Removes prefixes
- The owner of the prefixes, or * for all
-
-
-
- Adds postfixes
- An owner (Harmony ID)
- The patch methods
-
-
-
- Adds a postfix
-
-
- Removes postfixes
- The owner of the postfixes, or * for all
-
-
-
- Adds transpilers
- An owner (Harmony ID)
- The patch methods
-
-
-
- Adds a transpiler
-
-
- Removes transpilers
- The owner of the transpilers, or * for all
-
-
-
- Adds finalizers
- An owner (Harmony ID)
- The patch methods
-
-
-
- Adds a finalizer
-
-
- Removes finalizers
- The owner of the finalizers, or * for all
-
-
-
- Removes a patch using its method
- The method of the patch to remove
-
-
-
- Gets a concatenated list of patches
- The Harmony instance ID adding the new patches
- The patches to add
- The current patches
-
-
-
- Gets a list of patches with any from the given owner removed
- The owner of the methods, or * for all
- The current patches
-
-
-
- A serializable patch
-
-
-
- Zero-based index
-
-
-
- The owner (Harmony ID)
-
-
-
- The priority, see
-
-
-
- Keep this patch before the patches indicated in the list of Harmony IDs
-
-
-
- Keep this patch after the patches indicated in the list of Harmony IDs
-
-
-
- A flag that will log the replacement method via every time this patch is used to build the replacement, even in the future
-
-
-
- The method of the static patch method
-
-
-
- Creates a patch
- The method of the patch
- Zero-based index
- An owner (Harmony ID)
- The priority, see
- A list of Harmony IDs for patches that should run after this patch
- A list of Harmony IDs for patches that should run before this patch
- A flag that will log the replacement method via every time this patch is used to build the replacement, even in the future
-
-
-
- Creates a patch
- The method of the patch
- Zero-based index
- An owner (Harmony ID)
-
-
- Get the patch method or a DynamicMethod if original patch method is a patch factory
- The original method/constructor
- The method of the patch
-
-
-
- Determines whether patches are equal
- The other patch
- true if equal
-
-
-
- Determines how patches sort
- The other patch
- integer to define sort order (-1, 0, 1)
-
-
-
- Hash function
- A hash code
-
-
-
- A PatchClassProcessor used to turn on a class/type into patches
-
-
-
- Creates a patch class processor by pointing out a class. Similar to PatchAll() but without searching through all classes.
- The Harmony instance
- The class to process (need to have at least a [HarmonyPatch] attribute)
-
-
-
- Applies the patches
- A list of all created replacement methods or null if patch class is not annotated
-
-
-
- A group of patches
-
-
-
- A collection of prefix
-
-
-
- A collection of postfix
-
-
-
- A collection of transpiler
-
-
-
- A collection of finalizer
-
-
-
- Gets all owners (Harmony IDs) or all known patches
- The patch owners
-
-
-
- Creates a group of patches
- An array of prefixes as
- An array of postfixes as
- An array of transpileres as
- An array of finalizeres as
-
-
-
- A PatchProcessor handles patches on a method/constructor
-
-
-
- Creates an empty patch processor
- The Harmony instance
- The original method/constructor
-
-
-
- Adds a prefix
- The prefix as a
- A for chaining calls
-
-
-
- Adds a prefix
- The prefix method
- A for chaining calls
-
-
-
- Adds a postfix
- The postfix as a
- A for chaining calls
-
-
-
- Adds a postfix
- The postfix method
- A for chaining calls
-
-
-
- Adds a transpiler
- The transpiler as a
- A for chaining calls
-
-
-
- Adds a transpiler
- The transpiler method
- A for chaining calls
-
-
-
- Adds a finalizer
- The finalizer as a
- A for chaining calls
-
-
-
- Adds a finalizer
- The finalizer method
- A for chaining calls
-
-
-
- Gets all patched original methods in the appdomain
- An enumeration of patched method/constructor
-
-
-
- Applies all registered patches
- The generated replacement method
-
-
-
- Unpatches patches of a given type and/or Harmony ID
- The patch type
- Harmony ID or * for any
- A for chaining calls
-
-
-
- Unpatches a specific patch
- The method of the patch
- A for chaining calls
-
-
-
- Gets patch information on an original
- The original method/constructor
- The patch information as
-
-
-
- Sort patch methods by their priority rules
- The original method
- Patches to sort
- The sorted patch methods
-
-
-
- Gets Harmony version for all active Harmony instances
- [out] The current Harmony version
- A dictionary containing assembly version keyed by Harmony ID
-
-
-
- Creates a new empty generator to use when reading method bodies
- A new
-
-
-
- Creates a new generator matching the method/constructor to use when reading method bodies
- The original method/constructor to copy method information from
- A new
-
-
-
- Returns the methods unmodified list of code instructions
- The original method/constructor
- Optionally an existing generator that will be used to create all local variables and labels contained in the result (if not specified, an internal generator is used)
- A list containing all the original
-
-
-
- Returns the methods unmodified list of code instructions
- The original method/constructor
- A new generator that now contains all local variables and labels contained in the result
- A list containing all the original
-
-
-
- Returns the methods current list of code instructions after all existing transpilers have been applied
- The original method/constructor
- Apply only the first count of transpilers
- Optionally an existing generator that will be used to create all local variables and labels contained in the result (if not specified, an internal generator is used)
- A list of
-
-
-
- Returns the methods current list of code instructions after all existing transpilers have been applied
- The original method/constructor
- A new generator that now contains all local variables and labels contained in the result
- Apply only the first count of transpilers
- A list of
-
-
-
- A low level way to read the body of a method. Used for quick searching in methods
- The original method
- All instructions as opcode/operand pairs
-
-
-
- A low level way to read the body of a method. Used for quick searching in methods
- The original method
- An existing generator that will be used to create all local variables and labels contained in the result
- All instructions as opcode/operand pairs
-
-
-
- A patch priority
-
-
-
- Patch last
-
-
-
- Patch with very low priority
-
-
-
- Patch with low priority
-
-
-
- Patch with lower than normal priority
-
-
-
- Patch with normal priority
-
-
-
- Patch with higher than normal priority
-
-
-
- Patch with high priority
-
-
-
- Patch with very high priority
-
-
-
- Patch first
-
-
-
- A reverse patcher
-
-
-
- Creates a reverse patcher
- The Harmony instance
- The original method/constructor
- Your stand-in stub method as
-
-
-
- Applies the patch
- The type of patch, see
- The generated replacement method
-
-
-
- A collection of commonly used transpilers
-
-
-
- A transpiler that replaces all occurrences of a given method with another one using the same signature
- The enumeration of to act on
- Method or constructor to search for
- Method or constructor to replace with
- Modified enumeration of
-
-
-
- A transpiler that alters instructions that match a predicate by calling an action
- The enumeration of to act on
- A predicate selecting the instructions to change
- An action to apply to matching instructions
- Modified enumeration of
-
-
-
- A transpiler that logs a text at the beginning of the method
- The instructions to act on
- The log text
- Modified enumeration of
-
-
-
- A helper class for reflection related functions
-
-
-
- Shortcut for to simplify the use of reflections and make it work for any access level
-
-
-
- Shortcut for to simplify the use of reflections and make it work for any access level but only within the current type
-
-
-
- Enumerates all assemblies in the current app domain, excluding visual studio assemblies
- An enumeration of
-
-
- Gets a type by name. Prefers a full name with namespace but falls back to the first type matching the name otherwise
- The name
- A type or null if not found
-
-
-
- Gets all successfully loaded types from a given assembly
- The assembly
- An array of types
-
- This calls and returns , while catching any thrown .
- If such an exception is thrown, returns the successfully loaded types (,
- filtered for non-null values).
-
-
-
-
- Enumerates all successfully loaded types in the current app domain, excluding visual studio assemblies
- An enumeration of all in all assemblies, excluding visual studio assemblies
-
-
- Applies a function going up the type hierarchy and stops at the first non-null result
- Result type of func()
- The class/type to start with
- The evaluation function returning T
- The first non-null result, or null if no match
-
- The type hierarchy of a class or value type (including struct) does NOT include implemented interfaces,
- and the type hierarchy of an interface is only itself (regardless of whether that interface implements other interfaces).
- The top-most type in the type hierarchy of all non-interface types (including value types) is .
-
-
-
-
- Applies a function going into inner types and stops at the first non-null result
- Generic type parameter
- The class/type to start with
- The evaluation function returning T
- The first non-null result, or null if no match
-
-
-
- Gets the reflection information for a directly declared field
- The class/type where the field is defined
- The name of the field
- A field or null when type/name is null or when the field cannot be found
-
-
-
- Gets the reflection information for a directly declared field
- The member in the form TypeFullName:MemberName, where TypeFullName matches the form recognized by Type.GetType like Some.Namespace.Type.
- A field or null when the field cannot be found
-
-
-
- Gets the reflection information for a field by searching the type and all its super types
- The class/type where the field is defined
- The name of the field (case sensitive)
- A field or null when type/name is null or when the field cannot be found
-
-
-
- Gets the reflection information for a field by searching the type and all its super types
- The member in the form TypeFullName:MemberName, where TypeFullName matches the form recognized by Type.GetType like Some.Namespace.Type.
- A field or null when the field cannot be found
-
-
-
- Gets the reflection information for a field
- The class/type where the field is declared
- The zero-based index of the field inside the class definition
- A field or null when type is null or when the field cannot be found
-
-
-
- Gets the reflection information for a directly declared property
- The class/type where the property is declared
- The name of the property (case sensitive)
- A property or null when type/name is null or when the property cannot be found
-
-
-
- Gets the reflection information for a directly declared property
- The member in the form TypeFullName:MemberName, where TypeFullName matches the form recognized by Type.GetType like Some.Namespace.Type.
- A property or null when the property cannot be found
-
-
-
- Gets the reflection information for the getter method of a directly declared property
- The class/type where the property is declared
- The name of the property (case sensitive)
- A method or null when type/name is null or when the property cannot be found
-
-
-
- Gets the reflection information for the getter method of a directly declared property
- The member in the form TypeFullName:MemberName, where TypeFullName matches the form recognized by Type.GetType like Some.Namespace.Type.
- A method or null when the property cannot be found
-
-
-
- Gets the reflection information for the setter method of a directly declared property
- The class/type where the property is declared
- The name of the property (case sensitive)
- A method or null when type/name is null or when the property cannot be found
-
-
-
- Gets the reflection information for the Setter method of a directly declared property
- The member in the form TypeFullName:MemberName, where TypeFullName matches the form recognized by Type.GetType like Some.Namespace.Type.
- A method or null when the property cannot be found
-
-
-
- Gets the reflection information for a property by searching the type and all its super types
- The class/type
- The name
- A property or null when type/name is null or when the property cannot be found
-
-
-
- Gets the reflection information for a property by searching the type and all its super types
- The member in the form TypeFullName:MemberName, where TypeFullName matches the form recognized by Type.GetType like Some.Namespace.Type.
- A property or null when the property cannot be found
-
-
-
- Gets the reflection information for the getter method of a property by searching the type and all its super types
- The class/type
- The name
- A method or null when type/name is null or when the property cannot be found
-
-
-
- Gets the reflection information for the getter method of a property by searching the type and all its super types
- The member in the form TypeFullName:MemberName, where TypeFullName matches the form recognized by Type.GetType like Some.Namespace.Type.
- A method or null when type/name is null or when the property cannot be found
-
-
-
- Gets the reflection information for the setter method of a property by searching the type and all its super types
- The class/type
- The name
- A method or null when type/name is null or when the property cannot be found
-
-
-
- Gets the reflection information for the setter method of a property by searching the type and all its super types
- The member in the form TypeFullName:MemberName, where TypeFullName matches the form recognized by Type.GetType like Some.Namespace.Type.
- A method or null when type/name is null or when the property cannot be found
-
-
-
- Gets the reflection information for a directly declared method
- The class/type where the method is declared
- The name of the method (case sensitive)
- Optional parameters to target a specific overload of the method
- Optional list of types that define the generic version of the method
- A method or null when type/name is null or when the method cannot be found
-
-
-
- Gets the reflection information for a directly declared method
- The member in the form TypeFullName:MemberName, where TypeFullName matches the form recognized by Type.GetType like Some.Namespace.Type.
- Optional parameters to target a specific overload of the method
- Optional list of types that define the generic version of the method
- A method or null when the method cannot be found
-
-
-
- Gets the reflection information for a method by searching the type and all its super types
- The class/type where the method is declared
- The name of the method (case sensitive)
- Optional parameters to target a specific overload of the method
- Optional list of types that define the generic version of the method
- A method or null when type/name is null or when the method cannot be found
-
-
-
- Gets the reflection information for a method by searching the type and all its super types
- The member in the form TypeFullName:MemberName, where TypeFullName matches the form recognized by Type.GetType like Some.Namespace.Type.
- Optional parameters to target a specific overload of the method
- Optional list of types that define the generic version of the method
- A method or null when the method cannot be found
-
-
-
- Gets the method of an enumerator method
- Enumerator method that creates the enumerator
- The internal method of the enumerator or null if no valid enumerator is detected
-
-
- Gets the names of all method that are declared in a type
- The declaring class/type
- A list of method names
-
-
-
- Gets the names of all method that are declared in the type of the instance
- An instance of the type to search in
- A list of method names
-
-
-
- Gets the names of all fields that are declared in a type
- The declaring class/type
- A list of field names
-
-
-
- Gets the names of all fields that are declared in the type of the instance
- An instance of the type to search in
- A list of field names
-
-
-
- Gets the names of all properties that are declared in a type
- The declaring class/type
- A list of property names
-
-
-
- Gets the names of all properties that are declared in the type of the instance
- An instance of the type to search in
- A list of property names
-
-
-
- Gets the type of any class member of
- A member
- The class/type of this member
-
-
-
- Test if a class member is actually an concrete implementation
- A member
- True if the member is a declared
-
-
-
- Gets the real implementation of a class member
- A member
- The member itself if its declared. Otherwise the member that is actually implemented in some base type
-
-
-
- Gets the reflection information for a directly declared constructor
- The class/type where the constructor is declared
- Optional parameters to target a specific overload of the constructor
- Optional parameters to only consider static constructors
- A constructor info or null when type is null or when the constructor cannot be found
-
-
-
- Gets the reflection information for a constructor by searching the type and all its super types
- The class/type where the constructor is declared
- Optional parameters to target a specific overload of the method
- Optional parameters to only consider static constructors
- A constructor info or null when type is null or when the method cannot be found
-
-
-
- Gets reflection information for all declared constructors
- The class/type where the constructors are declared
- Optional parameters to only consider static constructors
- A list of constructor infos
-
-
-
- Gets reflection information for all declared methods
- The class/type where the methods are declared
- A list of methods
-
-
-
- Gets reflection information for all declared properties
- The class/type where the properties are declared
- A list of properties
-
-
-
- Gets reflection information for all declared fields
- The class/type where the fields are declared
- A list of fields
-
-
-
- Gets the return type of a method or constructor
- The method/constructor
- The return type
-
-
-
- Given a type, returns the first inner type matching a recursive search by name
- The class/type to start searching at
- The name of the inner type (case sensitive)
- The inner type or null if type/name is null or if a type with that name cannot be found
-
-
-
- Given a type, returns the first inner type matching a recursive search with a predicate
- The class/type to start searching at
- The predicate to search with
- The inner type or null if type/predicate is null or if a type with that name cannot be found
-
-
-
- Given a type, returns the first method matching a predicate
- The class/type to start searching at
- The predicate to search with
- The method or null if type/predicate is null or if a type with that name cannot be found
-
-
-
- Given a type, returns the first constructor matching a predicate
- The class/type to start searching at
- The predicate to search with
- The constructor info or null if type/predicate is null or if a type with that name cannot be found
-
-
-
- Given a type, returns the first property matching a predicate
- The class/type to start searching at
- The predicate to search with
- The property or null if type/predicate is null or if a type with that name cannot be found
-
-
-
- Returns an array containing the type of each object in the given array
- An array of objects
- An array of types or an empty array if parameters is null (if an object is null, the type for it will be object)
-
-
-
- Creates an array of input parameters for a given method and a given set of potential inputs
- The method/constructor you are planing to call
- The possible input parameters in any order
- An object array matching the method signature
-
-
-
- A readable/assignable reference delegate to an instance field of a class or static field (NOT an instance field of a struct)
-
- An arbitrary type if the field is static; otherwise the class that defines the field, or a parent class (including ),
- implemented interface, or derived class of this type
-
-
- The type of the field; or if the field's type is a reference type (a class or interface, NOT a struct or other value type),
- a type that is assignable from that type; or if the field's type is an enum type,
- either that type or the underlying integral type of that enum type
-
- The runtime instance to access the field (ignored and can be omitted for static fields)
- A readable/assignable reference to the field
- Null instance passed to a non-static field ref delegate
-
- Instance of invalid type passed to a non-static field ref delegate
- (this can happen if is a parent class or interface of the field's declaring type)
-
-
-
- This delegate cannot be used for instance fields of structs, since a struct instance passed to the delegate would be passed by
- value and thus would be a copy that only exists within the delegate's invocation. This is fine for a readonly reference,
- but makes assignment futile. Use instead.
-
-
- Note that is not required to be the field's declaring type. It can be a parent class (including ),
- implemented interface, or a derived class of the field's declaring type ("instanceOfT is FieldDeclaringType" must be possible).
- Specifically, must be assignable from OR to the field's declaring type.
- Technically, this allows Nullable, although Nullable is only relevant for structs, and since only static fields of structs
- are allowed for this delegate, and the instance passed to such a delegate is ignored, this hardly matters.
-
-
- Similarly, is not required to be the field's field type, unless that type is a non-enum value type.
- It can be a parent class (including object) or implemented interface of the field's field type. It cannot be a derived class.
- This variance is not allowed for value types, since that would require boxing/unboxing, which is not allowed for ref values.
- Special case for enum types: can also be the underlying integral type of the enum type.
- Specifically, for reference types, must be assignable from
- the field's field type; for non-enum value types, must be exactly the field's field type; for enum types,
- must be either the field's field type or the underyling integral type of that field type.
-
-
- This delegate supports static fields, even those defined in structs, for legacy reasons.
- For such static fields, is effectively ignored.
- Consider using (and StaticFieldRefAccess methods that return it) instead for static fields.
-
-
-
-
-
- Creates a field reference delegate for an instance field of a class
- The class that defines the instance field, or derived class of this type
-
- The type of the field; or if the field's type is a reference type (a class or interface, NOT a struct or other value type),
- a type that is assignable from that type; or if the field's type is an enum type,
- either that type or the underlying integral type of that enum type
-
- The name of the field
- A readable/assignable delegate
-
-
- For backwards compatibility, there is no class constraint on .
- Instead, the non-value-type check is done at runtime within the method.
-
-
-
-
-
- Creates an instance field reference for a specific instance of a class
- The class that defines the instance field, or derived class of this type
-
- The type of the field; or if the field's type is a reference type (a class or interface, NOT a struct or other value type),
- a type that is assignable from that type; or if the field's type is an enum type,
- either that type or the underlying integral type of that enum type
-
- The instance
- The name of the field
- A readable/assignable reference to the field
-
-
- This method is meant for one-off access to a field's value for a single instance.
- If you need to access a field's value for potentially multiple instances, use instead.
- FieldRefAccess<T, F>(instance, fieldName) is functionally equivalent to FieldRefAccess<T, F>(fieldName)(instance).
-
-
- For backwards compatibility, there is no class constraint on .
- Instead, the non-value-type check is done at runtime within the method.
-
-
-
-
-
- Creates a field reference delegate for an instance field of a class or static field (NOT an instance field of a struct)
-
- The type of the field; or if the field's type is a reference type (a class or interface, NOT a struct or other value type),
- a type that is assignable from that type; or if the field's type is an enum type,
- either that type or the underlying integral type of that enum type
-
-
- The type that defines the field, or derived class of this type; must not be a struct type unless the field is static
-
- The name of the field
-
- A readable/assignable delegate with T=object
- (for static fields, the instance delegate parameter is ignored)
-
-
-
- This method is meant for cases where the given type is only known at runtime and thus can't be used as a type parameter T
- in e.g. .
-
-
- This method supports static fields, even those defined in structs, for legacy reasons.
- Consider using (and other overloads) instead for static fields.
-
-
-
-
-
- Creates a field reference delegate for an instance field of a class or static field (NOT an instance field of a struct)
- type of the field
- The member in the form TypeFullName:MemberName, where TypeFullName matches the form recognized by Type.GetType like Some.Namespace.Type.
- A readable/assignable delegate with T=object
-
-
- Creates a field reference delegate for an instance field of a class or static field (NOT an instance field of a struct)
-
- An arbitrary type if the field is static; otherwise the class that defines the field, or a parent class (including ),
- implemented interface, or derived class of this type ("instanceOfT is FieldDeclaringType" must be possible)
-
-
- The type of the field; or if the field's type is a reference type (a class or interface, NOT a struct or other value type),
- a type that is assignable from that type; or if the field's type is an enum type,
- either that type or the underlying integral type of that enum type
-
- The field
- A readable/assignable delegate
-
-
- This method is meant for cases where the field has already been obtained, avoiding the field searching cost in
- e.g. .
-
-
- This method supports static fields, even those defined in structs, for legacy reasons.
- For such static fields, is effectively ignored.
- Consider using (and other overloads) instead for static fields.
-
-
- For backwards compatibility, there is no class constraint on .
- Instead, the non-value-type check is done at runtime within the method.
-
-
-
-
-
- Creates a field reference for an instance field of a class
-
- The type that defines the field; or a parent class (including ), implemented interface, or derived class of this type
- ("instanceOfT is FieldDeclaringType" must be possible)
-
-
- The type of the field; or if the field's type is a reference type (a class or interface, NOT a struct or other value type),
- a type that is assignable from that type; or if the field's type is an enum type,
- either that type or the underlying integral type of that enum type
-
- The instance
- The field
- A readable/assignable reference to the field
-
-
- This method is meant for one-off access to a field's value for a single instance and where the field has already been obtained.
- If you need to access a field's value for potentially multiple instances, use instead.
- FieldRefAccess<T, F>(instance, fieldInfo) is functionally equivalent to FieldRefAccess<T, F>(fieldInfo)(instance).
-
-
- For backwards compatibility, there is no class constraint on .
- Instead, the non-value-type check is done at runtime within the method.
-
-
-
-
-
- A readable/assignable reference delegate to an instance field of a struct
- The struct that defines the instance field
-
- The type of the field; or if the field's type is a reference type (a class or interface, NOT a struct or other value type),
- a type that is assignable from that type; or if the field's type is an enum type,
- either that type or the underlying integral type of that enum type
-
- A reference to the runtime instance to access the field
- A readable/assignable reference to the field
-
-
-
- Creates a field reference delegate for an instance field of a struct
- The struct that defines the instance field
-
- The type of the field; or if the field's type is a reference type (a class or interface, NOT a struct or other value type),
- a type that is assignable from that type; or if the field's type is an enum type,
- either that type or the underlying integral type of that enum type
-
- The name of the field
- A readable/assignable delegate
-
-
-
- Creates an instance field reference for a specific instance of a struct
- The struct that defines the instance field
-
- The type of the field; or if the field's type is a reference type (a class or interface, NOT a struct or other value type),
- a type that is assignable from that type; or if the field's type is an enum type,
- either that type or the underlying integral type of that enum type
-
- The instance
- The name of the field
- A readable/assignable reference to the field
-
-
- This method is meant for one-off access to a field's value for a single instance.
- If you need to access a field's value for potentially multiple instances, use instead.
- StructFieldRefAccess<T, F>(ref instance, fieldName) is functionally equivalent to StructFieldRefAccess<T, F>(fieldName)(ref instance).
-
-
-
-
-
- Creates a field reference delegate for an instance field of a struct
- The struct that defines the instance field
-
- The type of the field; or if the field's type is a reference type (a class or interface, NOT a struct or other value type),
- a type that is assignable from that type; or if the field's type is an enum type,
- either that type or the underlying integral type of that enum type
-
- The field
- A readable/assignable delegate
-
-
- This method is meant for cases where the field has already been obtained, avoiding the field searching cost in
- e.g. .
-
-
-
-
-
- Creates a field reference for an instance field of a struct
- The struct that defines the instance field
-
- The type of the field; or if the field's type is a reference type (a class or interface, NOT a struct or other value type),
- a type that is assignable from that type; or if the field's type is an enum type,
- either that type or the underlying integral type of that enum type
-
- The instance
- The field
- A readable/assignable reference to the field
-
-
- This method is meant for one-off access to a field's value for a single instance and where the field has already been obtained.
- If you need to access a field's value for potentially multiple instances, use instead.
- StructFieldRefAccess<T, F>(ref instance, fieldInfo) is functionally equivalent to StructFieldRefAccess<T, F>(fieldInfo)(ref instance).
-
-
-
-
-
- A readable/assignable reference delegate to a static field
-
- The type of the field; or if the field's type is a reference type (a class or interface, NOT a struct or other value type),
- a type that is assignable from that type; or if the field's type is an enum type,
- either that type or the underlying integral type of that enum type
-
- A readable/assignable reference to the field
-
-
-
- Creates a static field reference
- The type (can be class or struct) the field is defined in
-
- The type of the field; or if the field's type is a reference type (a class or interface, NOT a struct or other value type),
- a type that is assignable from that type; or if the field's type is an enum type,
- either that type or the underlying integral type of that enum type
-
- The name of the field
- A readable/assignable reference to the field
-
-
-
- Creates a static field reference
-
- The type of the field; or if the field's type is a reference type (a class or interface, NOT a struct or other value type),
- a type that is assignable from that type; or if the field's type is an enum type,
- either that type or the underlying integral type of that enum type
-
- The type (can be class or struct) the field is defined in
- The name of the field
- A readable/assignable reference to the field
-
-
-
- Creates a static field reference
- The type of the field
- The member in the form TypeFullName:MemberName, where TypeFullName matches the form recognized by Type.GetType like Some.Namespace.Type.
- A readable/assignable reference to the field
-
-
-
- Creates a static field reference
- An arbitrary type (by convention, the type the field is defined in)
-
- The type of the field; or if the field's type is a reference type (a class or interface, NOT a struct or other value type),
- a type that is assignable from that type; or if the field's type is an enum type,
- either that type or the underlying integral type of that enum type
-
- The field
- A readable/assignable reference to the field
-
- The type parameter is only used in exception messaging and to distinguish between this method overload
- and the overload (which returns a rather than a reference).
-
-
-
-
- Creates a static field reference delegate
-
- The type of the field; or if the field's type is a reference type (a class or interface, NOT a struct or other value type),
- a type that is assignable from that type; or if the field's type is an enum type,
- either that type or the underlying integral type of that enum type
-
- The field
- A readable/assignable delegate
-
-
-
- Creates a delegate to a given method
- The delegate Type
- The method to create a delegate from.
-
- Only applies for instance methods. If null (default), returned delegate is an open (a.k.a. unbound) instance delegate
- where an instance is supplied as the first argument to the delegate invocation; else, delegate is a closed (a.k.a. bound)
- instance delegate where the delegate invocation always applies to the given .
-
-
- Only applies for instance methods. If true (default) and is virtual, invocation of the delegate
- calls the instance method virtually (the instance type's most-derived/overriden implementation of the method is called);
- else, invocation of the delegate calls the exact specified (this is useful for calling base class methods)
- Note: if false and is an interface method, an ArgumentException is thrown.
-
- A delegate of given to given
-
-
- Delegate invocation is more performant and more convenient to use than
- at a one-time setup cost.
-
-
- Works for both type of static and instance methods, both open and closed (a.k.a. unbound and bound) instance methods,
- and both class and struct methods.
-
-
-
-
-
- Creates a delegate to a given method
- The delegate Type
- The method in the form TypeFullName:MemberName, where TypeFullName matches the form recognized by Type.GetType like Some.Namespace.Type.
-
- Only applies for instance methods. If null (default), returned delegate is an open (a.k.a. unbound) instance delegate
- where an instance is supplied as the first argument to the delegate invocation; else, delegate is a closed (a.k.a. bound)
- instance delegate where the delegate invocation always applies to the given .
-
-
- Only applies for instance methods. If true (default) and is virtual, invocation of the delegate
- calls the instance method virtually (the instance type's most-derived/overriden implementation of the method is called);
- else, invocation of the delegate calls the exact specified (this is useful for calling base class methods)
- Note: if false and is an interface method, an ArgumentException is thrown.
-
- A delegate of given to given
-
-
- Delegate invocation is more performant and more convenient to use than
- at a one-time setup cost.
-
-
- Works for both type of static and instance methods, both open and closed (a.k.a. unbound and bound) instance methods,
- and both class and struct methods.
-
-
-
-
-
- Creates a delegate for a given delegate definition, attributed with []
- The delegate Type, attributed with []
-
- Only applies for instance methods. If null (default), returned delegate is an open (a.k.a. unbound) instance delegate
- where an instance is supplied as the first argument to the delegate invocation; else, delegate is a closed (a.k.a. bound)
- instance delegate where the delegate invocation always applies to the given .
-
- A delegate of given to the method specified via []
- attributes on
-
- This calls with the method and virtualCall arguments
- determined from the [] attributes on ,
- and the given (for closed instance delegates).
-
-
-
-
- Returns who called the current method
- The calling method/constructor (excluding the caller)
-
-
-
- Rethrows an exception while preserving its stack trace (throw statement typically clobbers existing stack traces)
- The exception to rethrow
-
-
-
- True if the current runtime is based on Mono, false otherwise (.NET)
-
-
-
- True if the current runtime is .NET Framework, false otherwise (.NET Core or Mono, although latter isn't guaranteed)
-
-
-
- True if the current runtime is .NET Core, false otherwise (Mono or .NET Framework)
-
-
-
- Throws a missing member runtime exception
- The type that is involved
- A list of names
-
-
-
- Gets default value for a specific type
- The class/type
- The default value
-
-
-
- Creates an (possibly uninitialized) instance of a given type
- The class/type
- The new instance
-
-
-
- Creates an (possibly uninitialized) instance of a given type
- The class/type
- The new instance
-
-
-
-
- A cache for the or similar Add methods for different types.
-
-
-
- Makes a deep copy of any object
- The type of the instance that should be created; for legacy reasons, this must be a class or interface
- The original object
- A copy of the original object but of type T
-
-
-
- Makes a deep copy of any object
- The type of the instance that should be created
- The original object
- [out] The copy of the original object
- Optional value transformation function (taking a field name and src/dst instances)
- The optional path root to start with
-
-
-
- Makes a deep copy of any object
- The original object
- The type of the instance that should be created
- Optional value transformation function (taking a field name and src/dst instances)
- The optional path root to start with
- The copy of the original object
-
-
-
- Tests if a type is a struct
- The type
- True if the type is a struct
-
-
-
- Tests if a type is a class
- The type
- True if the type is a class
-
-
-
- Tests if a type is a value type
- The type
- True if the type is a value type
-
-
-
- Tests if a type is an integer type
- The type
- True if the type represents some integer
-
-
-
- Tests if a type is a floating point type
- The type
- True if the type represents some floating point
-
-
-
- Tests if a type is a numerical type
- The type
- True if the type represents some number
-
-
-
- Tests if a type is void
- The type
- True if the type is void
-
-
-
- Test whether an instance is of a nullable type
- Type of instance
- An instance to test
- True if instance is of nullable type, false if not
-
-
-
- Tests whether a type or member is static, as defined in C#
- The type or member
- True if the type or member is static
-
-
-
- Tests whether a type is static, as defined in C#
- The type
- True if the type is static
-
-
-
- Tests whether a property is static, as defined in C#
- The property
- True if the property is static
-
-
-
- Tests whether an event is static, as defined in C#
- The event
- True if the event is static
-
-
-
- Calculates a combined hash code for an enumeration of objects
- The objects
- The hash code
-
-
-
- A CodeInstruction match
-
-
- The name of the match
-
-
- The matched opcodes
-
-
- The matched operands
-
-
- The jumps from the match
-
-
- The jumps to the match
-
-
- The match predicate
-
-
- Creates a code match
- The optional opcode
- The optional operand
- The optional name
-
-
-
- Creates a code match that calls a method
- The lambda expression using the method
- The optional name
-
-
-
- Creates a code match that calls a method
- The lambda expression using the method
- The optional name
-
-
-
- Creates a code match
- The CodeInstruction
- An optional name
-
-
-
- Creates a code match
- The predicate
- An optional name
-
-
-
- Returns a string that represents the match
- A string representation
-
-
-
- A CodeInstruction matcher
-
-
- The current position
- The index or -1 if out of bounds
-
-
-
- Gets the number of code instructions in this matcher
- The count
-
-
-
- Checks whether the position of this CodeMatcher is within bounds
- True if this CodeMatcher is valid
-
-
-
- Checks whether the position of this CodeMatcher is outside its bounds
- True if this CodeMatcher is invalid
-
-
-
- Gets the remaining code instructions
- The remaining count
-
-
-
- Gets the opcode at the current position
- The opcode
-
-
-
- Gets the operand at the current position
- The operand
-
-
-
- Gets the labels at the current position
- The labels
-
-
-
- Gets the exception blocks at the current position
- The blocks
-
-
-
- Creates an empty code matcher
-
-
- Creates a code matcher from an enumeration of instructions
- The instructions (transpiler argument)
- An optional IL generator
-
-
-
- Makes a clone of this instruction matcher
- A copy of this matcher
-
-
-
- Gets instructions at the current position
- The instruction
-
-
-
- Gets instructions at the current position with offset
- The offset
- The instruction
-
-
-
- Gets all instructions
- A list of instructions
-
-
-
- Gets all instructions as an enumeration
- A list of instructions
-
-
-
- Gets some instructions counting from current position
- Number of instructions
- A list of instructions
-
-
-
- Gets all instructions within a range
- The start index
- The end index
- A list of instructions
-
-
-
- Gets all instructions within a range (relative to current position)
- The start offset
- The end offset
- A list of instructions
-
-
-
- Gets a list of all distinct labels
- The instructions (transpiler argument)
- A list of Labels
-
-
-
- Reports a failure
- The method involved
- The logger
- True if current position is invalid and error was logged
-
-
-
- Throw an InvalidOperationException if current state is invalid (position out of bounds / last match failed)
- Explanation of where/why the exception was thrown that will be added to the exception message
- The same code matcher
-
-
-
- Throw an InvalidOperationException if current state is invalid (position out of bounds / last match failed),
- or if the matches do not match at current position
- Explanation of where/why the exception was thrown that will be added to the exception message
- Some code matches
- The same code matcher
-
-
-
- Throw an InvalidOperationException if current state is invalid (position out of bounds / last match failed),
- or if the matches do not match at any point between current position and the end
- Explanation of where/why the exception was thrown that will be added to the exception message
- Some code matches
- The same code matcher
-
-
-
- Throw an InvalidOperationException if current state is invalid (position out of bounds / last match failed),
- or if the matches do not match at any point between current position and the start
- Explanation of where/why the exception was thrown that will be added to the exception message
- Some code matches
- The same code matcher
-
-
-
- Throw an InvalidOperationException if current state is invalid (position out of bounds / last match failed),
- or if the check function returns false
- Explanation of where/why the exception was thrown that will be added to the exception message
- Function that checks validity of current state. If it returns false, an exception is thrown
- The same code matcher
-
-
-
- Sets an instruction at current position
- The instruction to set
- The same code matcher
-
-
-
- Sets instruction at current position and advances
- The instruction
- The same code matcher
-
-
-
- Sets opcode and operand at current position
- The opcode
- The operand
- The same code matcher
-
-
-
- Sets opcode and operand at current position and advances
- The opcode
- The operand
- The same code matcher
-
-
-
- Sets opcode at current position and advances
- The opcode
- The same code matcher
-
-
-
- Sets operand at current position and advances
- The operand
- The same code matcher
-
-
-
- Creates a label at current position
- [out] The label
- The same code matcher
-
-
-
- Creates a label at a position
- The position
- [out] The new label
- The same code matcher
-
-
-
- Creates a label at a position
- The offset
- [out] The new label
- The same code matcher
-
-
-
- Adds an enumeration of labels to current position
- The labels
- The same code matcher
-
-
-
- Adds an enumeration of labels at a position
- The position
- The labels
- The same code matcher
-
-
-
- Sets jump to
- Branch instruction
- Destination for the jump
- [out] The created label
- The same code matcher
-
-
-
- Inserts some instructions
- The instructions
- The same code matcher
-
-
-
- Inserts an enumeration of instructions
- The instructions
- The same code matcher
-
-
-
- Inserts a branch
- The branch opcode
- Branch destination
- The same code matcher
-
-
-
- Inserts some instructions and advances the position
- The instructions
- The same code matcher
-
-
-
- Inserts an enumeration of instructions and advances the position
- The instructions
- The same code matcher
-
-
-
- Inserts a branch and advances the position
- The branch opcode
- Branch destination
- The same code matcher
-
-
-
- Removes current instruction
- The same code matcher
-
-
-
- Removes some instruction from current position by count
- Number of instructions
- The same code matcher
-
-
-
- Removes the instructions in a range
- The start
- The end
- The same code matcher
-
-
-
- Removes the instructions in a offset range
- The start offset
- The end offset
- The same code matcher
-
-
-
- Advances the current position
- The offset
- The same code matcher
-
-
-
- Moves the current position to the start
- The same code matcher
-
-
-
- Moves the current position to the end
- The same code matcher
-
-
-
- Searches forward with a predicate and advances position
- The predicate
- The same code matcher
-
-
-
- Searches backwards with a predicate and reverses position
- The predicate
- The same code matcher
-
-
-
- Matches forward and advances position to beginning of matching sequence
- Some code matches
- The same code matcher
-
-
-
- Matches forward and advances position to ending of matching sequence
- Some code matches
- The same code matcher
-
-
-
- Matches backwards and reverses position to beginning of matching sequence
- Some code matches
- The same code matcher
-
-
-
- Matches backwards and reverses position to ending of matching sequence
- Some code matches
- The same code matcher
-
-
-
- Repeats a match action until boundaries are met
- The match action
- An optional action that is executed when no match is found
- The same code matcher
-
-
-
- Gets a match by its name
- The match name
- An instruction
-
-
-
- General extensions for common cases
-
-
-
- Joins an enumeration with a value converter and a delimiter to a string
- The inner type of the enumeration
- The enumeration
- An optional value converter (from T to string)
- An optional delimiter
- The values joined into a string
-
-
-
- Converts an array of types (for example methods arguments) into a human readable form
- The array of types
- A human readable description including brackets
-
-
-
- A full description of a type
- The type
- A human readable description
-
-
-
- A a full description of a method or a constructor without assembly details but with generics
- The method/constructor
- A human readable description
-
-
-
- A helper converting parameter infos to types
- The array of parameter infos
- An array of types
-
-
-
- A helper to access a value via key from a dictionary
- The key type
- The value type
- The dictionary
- The key
- The value for the key or the default value (of T) if that key does not exist
-
-
-
- A helper to access a value via key from a dictionary with extra casting
- The value type
- The dictionary
- The key
- The value for the key or the default value (of T) if that key does not exist or cannot be cast to T
-
-
-
- Escapes Unicode and ASCII non printable characters
- The string to convert
- The string to convert
- A string literal surrounded by
-
-
-
- Extensions for
-
-
-
- Returns if an is initialized and valid
- The
-
-
-
- Shortcut for testing whether the operand is equal to a non-null value
- The
- The value
- True if the operand has the same type and is equal to the value
-
-
-
- Shortcut for testing whether the operand is equal to a non-null value
- The
- The value
- True if the operand is equal to the value
- This is an optimized version of for
-
-
-
- Shortcut for code.opcode == opcode && code.OperandIs(operand)
- The
- The
- The operand value
- True if the opcode is equal to the given opcode and the operand has the same type and is equal to the given operand
-
-
-
- Shortcut for code.opcode == opcode && code.OperandIs(operand)
- The
- The
- The operand value
- True if the opcode is equal to the given opcode and the operand is equal to the given operand
- This is an optimized version of for
-
-
-
- Tests for any form of Ldarg*
- The
- The (optional) index
- True if it matches one of the variations
-
-
-
- Tests for Ldarga/Ldarga_S
- The
- The (optional) index
- True if it matches one of the variations
-
-
-
- Tests for Starg/Starg_S
- The
- The (optional) index
- True if it matches one of the variations
-
-
-
- Tests for any form of Ldloc*
- The
- The optional local variable
- True if it matches one of the variations
-
-
-
- Tests for any form of Stloc*
- The
- The optional local variable
- True if it matches one of the variations
-
-
-
- Tests if the code instruction branches
- The
- The label if the instruction is a branch operation or if not
- True if the instruction branches
-
-
-
- Tests if the code instruction calls the method/constructor
- The
- The method
- True if the instruction calls the method or constructor
-
-
-
- Tests if the code instruction loads a constant
- The
- True if the instruction loads a constant
-
-
-
- Tests if the code instruction loads an integer constant
- The
- The integer constant
- True if the instruction loads the constant
-
-
-
- Tests if the code instruction loads a floating point constant
- The
- The floating point constant
- True if the instruction loads the constant
-
-
-
- Tests if the code instruction loads an enum constant
- The
- The enum
- True if the instruction loads the constant
-
-
-
- Tests if the code instruction loads a string constant
- The
- The string
- True if the instruction loads the constant
-
-
-
- Tests if the code instruction loads a field
- The
- The field
- Set to true if the address of the field is loaded
- True if the instruction loads the field
-
-
-
- Tests if the code instruction stores a field
- The
- The field
- True if the instruction stores this field
-
-
-
- Adds labels to the code instruction and return it
- The
- One or several to add
- The same code instruction
-
-
- Adds labels to the code instruction and return it
- The
- An enumeration of
- The same code instruction
-
-
- Extracts all labels from the code instruction and returns them
- The
- A list of
-
-
- Moves all labels from the code instruction to another one
- The to move the labels from
- The other to move the labels to
- The code instruction labels were moved from (now empty)
-
-
- Moves all labels from another code instruction to the current one
- The to move the labels to
- The other to move the labels from
- The code instruction that received the labels
-
-
- Adds ExceptionBlocks to the code instruction and return it
- The
- One or several to add
- The same code instruction
-
-
- Adds ExceptionBlocks to the code instruction and return it
- The
- An enumeration of
- The same code instruction
-
-
- Extracts all ExceptionBlocks from the code instruction and returns them
- The
- A list of
-
-
- Moves all ExceptionBlocks from the code instruction to another one
- The to move the ExceptionBlocks from
- The other to move the ExceptionBlocks to
- The code instruction blocks were moved from (now empty)
-
-
- Moves all ExceptionBlocks from another code instruction to the current one
- The to move the ExceptionBlocks to
- The other to move the ExceptionBlocks from
- The code instruction that received the blocks
-
-
- General extensions for collections
-
-
-
- A simple way to execute code for every element in a collection
- The inner type of the collection
- The collection
- The action to execute
-
-
-
- A simple way to execute code for elements in a collection matching a condition
- The inner type of the collection
- The collection
- The predicate
- The action to execute
-
-
-
- A helper to add an item to a collection
- The inner type of the collection
- The collection
- The item to add
- The collection containing the item
-
-
-
- A helper to add an item to an array
- The inner type of the collection
- The array
- The item to add
- The array containing the item
-
-
-
- A helper to add items to an array
- The inner type of the collection
- The array
- The items to add
- The array containing the items
-
-
-
- General extensions for collections
-
-
-
- Tests a class member if it has an IL method body (external methods for example don't have a body)
- The member to test
- Returns true if the member has an IL body or false if not
-
-
- A file log for debugging
-
-
-
- Set this to make Harmony write its log content to this stream
-
-
-
- Full pathname of the log file, defaults to a file called harmony.log.txt on your Desktop
-
-
-
- The indent character. The default is tab
-
-
-
- The current indent level
-
-
-
- Changes the indentation level
- The value to add to the indentation level
-
-
-
- Log a string in a buffered way. Use this method only if you are sure that FlushBuffer will be called
- or else logging information is incomplete in case of a crash
- The string to log
-
-
-
- Logs a list of string in a buffered way. Use this method only if you are sure that FlushBuffer will be called
- or else logging information is incomplete in case of a crash
- A list of strings to log (they will not be re-indented)
-
-
-
- Returns the log buffer and optionally empties it
- True to empty the buffer
- The buffer.
-
-
-
- Replaces the buffer with new lines
- The lines to store
-
-
-
- Flushes the log buffer to disk (use in combination with LogBuffered)
-
-
-
- Log a string directly to disk. Slower method that prevents missing information in case of a crash
- The string to log.
-
-
-
- Log a string directly to disk if Harmony.DEBUG is true. Slower method that prevents missing information in case of a crash
- The string to log.
-
-
-
- Resets and deletes the log
-
-
-
- Logs some bytes as hex values
- The pointer to some memory
- The length of bytes to log
-
-
-
- A helper class to retrieve reflection info for non-private methods
-
-
-
- Given a lambda expression that calls a method, returns the method info
- The lambda expression using the method
- The method in the lambda expression
-
-
-
- Given a lambda expression that calls a method, returns the method info
- The generic type
- The lambda expression using the method
- The method in the lambda expression
-
-
-
- Given a lambda expression that calls a method, returns the method info
- The generic type
- The generic result type
- The lambda expression using the method
- The method in the lambda expression
-
-
-
- Given a lambda expression that calls a method, returns the method info
- The lambda expression using the method
- The method in the lambda expression
-
-
-
- A reflection helper to read and write private elements
- The result type defined by GetValue()
-
-
-
- Creates a traverse instance from an existing instance
- The existing instance
-
-
-
- Gets/Sets the current value
- The value to read or write
-
-
-
- A reflection helper to read and write private elements
-
-
-
- Creates a new traverse instance from a class/type
- The class/type
- A instance
-
-
-
- Creates a new traverse instance from a class T
- The class
- A instance
-
-
-
- Creates a new traverse instance from an instance
- The object
- A instance
-
-
-
- Creates a new traverse instance from a named type
- The type name, for format see
- A instance
-
-
-
- Creates a new and empty traverse instance
-
-
-
- Creates a new traverse instance from a class/type
- The class/type
-
-
-
- Creates a new traverse instance from an instance
- The object
-
-
-
- Gets the current value
- The value
-
-
-
- Gets the current value
- The type of the value
- The value
-
-
-
- Invokes the current method with arguments and returns the result
- The method arguments
- The value returned by the method
-
-
-
- Invokes the current method with arguments and returns the result
- The type of the value
- The method arguments
- The value returned by the method
-
-
-
- Sets a value of the current field or property
- The value
- The same traverse instance
-
-
-
- Gets the type of the current field or property
- The type
-
-
-
- Moves the current traverse instance to a inner type
- The type name
- A traverse instance
-
-
-
- Moves the current traverse instance to a field
- The type name
- A traverse instance
-
-
-
- Moves the current traverse instance to a field
- The type of the field
- The type name
- A traverse instance
-
-
-
- Gets all fields of the current type
- A list of field names
-
-
-
- Moves the current traverse instance to a property
- The type name
- Optional property index
- A traverse instance
-
-
-
- Moves the current traverse instance to a field
- The type of the property
- The type name
- Optional property index
- A traverse instance
-
-
-
- Gets all properties of the current type
- A list of property names
-
-
-
- Moves the current traverse instance to a method
- The name of the method
- The arguments defining the argument types of the method overload
- A traverse instance
-
-
-
- Moves the current traverse instance to a method
- The name of the method
- The argument types of the method
- The arguments for the method
- A traverse instance
-
-
-
- Gets all methods of the current type
- A list of method names
-
-
-
- Checks if the current traverse instance is for a field
- True if its a field
-
-
-
- Checks if the current traverse instance is for a property
- True if its a property
-
-
-
- Checks if the current traverse instance is for a method
- True if its a method
-
-
-
- Checks if the current traverse instance is for a type
- True if its a type
-
-
-
- Iterates over all fields of the current type and executes a traverse action
- Original object
- The action receiving a instance for each field
-
-
-
- Iterates over all fields of the current type and executes a traverse action
- Original object
- Target object
- The action receiving a pair of instances for each field pair
-
-
-
- Iterates over all fields of the current type and executes a traverse action
- Original object
- Target object
- The action receiving a dot path representing the field pair and the instances
-
-
-
- Iterates over all properties of the current type and executes a traverse action
- Original object
- The action receiving a instance for each property
-
-
-
- Iterates over all properties of the current type and executes a traverse action
- Original object
- Target object
- The action receiving a pair of instances for each property pair
-
-
-
- Iterates over all properties of the current type and executes a traverse action
- Original object
- Target object
- The action receiving a dot path representing the property pair and the instances
-
-
-
- A default field action that copies fields to fields
-
-
-
- Returns a string that represents the current traverse
- A string representation
-
-
-
-
diff --git a/Assets/FastScriptReload/Plugins/Harmony/net48/0Harmony.xml.meta b/Assets/FastScriptReload/Plugins/Harmony/net48/0Harmony.xml.meta
deleted file mode 100644
index fe484c3..0000000
--- a/Assets/FastScriptReload/Plugins/Harmony/net48/0Harmony.xml.meta
+++ /dev/null
@@ -1,14 +0,0 @@
-fileFormatVersion: 2
-guid: 59922c0cd2ffd71478db2dea7fb3fb7a
-TextScriptImporter:
- externalObjects: {}
- userData:
- assetBundleName:
- assetBundleVariant:
-AssetOrigin:
- serializedVersion: 1
- productId: 239351
- packageName: Fast Script Reload
- packageVersion: 1.6.1
- assetPath: Assets/FastScriptReload/Plugins/Harmony/net48/0Harmony.xml
- uploadId: 710802
diff --git a/Assets/FastScriptReload/Plugins/ImmersiveVrToolsCommon.meta b/Assets/FastScriptReload/Plugins/ImmersiveVrToolsCommon.meta
deleted file mode 100644
index bfa8e7b..0000000
--- a/Assets/FastScriptReload/Plugins/ImmersiveVrToolsCommon.meta
+++ /dev/null
@@ -1,8 +0,0 @@
-fileFormatVersion: 2
-guid: fec618116c7eb7f42a3cf42dd1e125ea
-folderAsset: yes
-DefaultImporter:
- externalObjects: {}
- userData:
- assetBundleName:
- assetBundleVariant:
diff --git a/Assets/FastScriptReload/Plugins/ImmersiveVrToolsCommon/ImmersiveVRTools.Common.Editor.dll b/Assets/FastScriptReload/Plugins/ImmersiveVrToolsCommon/ImmersiveVRTools.Common.Editor.dll
deleted file mode 100644
index a06903e..0000000
Binary files a/Assets/FastScriptReload/Plugins/ImmersiveVrToolsCommon/ImmersiveVRTools.Common.Editor.dll and /dev/null differ
diff --git a/Assets/FastScriptReload/Plugins/ImmersiveVrToolsCommon/ImmersiveVRTools.Common.Editor.dll.meta b/Assets/FastScriptReload/Plugins/ImmersiveVrToolsCommon/ImmersiveVRTools.Common.Editor.dll.meta
deleted file mode 100644
index 629157c..0000000
--- a/Assets/FastScriptReload/Plugins/ImmersiveVrToolsCommon/ImmersiveVRTools.Common.Editor.dll.meta
+++ /dev/null
@@ -1,83 +0,0 @@
-fileFormatVersion: 2
-guid: 1f20b53a7360a6f40957117be6217b96
-PluginImporter:
- externalObjects: {}
- serializedVersion: 2
- iconMap: {}
- executionOrder: {}
- defineConstraints: []
- isPreloaded: 0
- isOverridable: 0
- isExplicitlyReferenced: 1
- validateReferences: 1
- platformData:
- - first:
- : Any
- second:
- enabled: 0
- settings:
- Exclude Android: 1
- Exclude Editor: 0
- Exclude Linux64: 1
- Exclude OSXUniversal: 1
- Exclude Win: 1
- Exclude Win64: 1
- - first:
- Android: Android
- second:
- enabled: 0
- settings:
- CPU: ARMv7
- - first:
- Any:
- second:
- enabled: 0
- settings: {}
- - first:
- Editor: Editor
- second:
- enabled: 1
- settings:
- CPU: AnyCPU
- DefaultValueInitialized: true
- OS: AnyOS
- - first:
- Standalone: Linux64
- second:
- enabled: 0
- settings:
- CPU: None
- - first:
- Standalone: OSXUniversal
- second:
- enabled: 0
- settings:
- CPU: None
- - first:
- Standalone: Win
- second:
- enabled: 0
- settings:
- CPU: None
- - first:
- Standalone: Win64
- second:
- enabled: 0
- settings:
- CPU: None
- - first:
- Windows Store Apps: WindowsStoreApps
- second:
- enabled: 0
- settings:
- CPU: AnyCPU
- userData:
- assetBundleName:
- assetBundleVariant:
-AssetOrigin:
- serializedVersion: 1
- productId: 239351
- packageName: Fast Script Reload
- packageVersion: 1.6.1
- assetPath: Assets/FastScriptReload/Plugins/ImmersiveVrToolsCommon/ImmersiveVRTools.Common.Editor.dll
- uploadId: 710802
diff --git a/Assets/FastScriptReload/Plugins/ImmersiveVrToolsCommon/ImmersiveVRTools.Common.Runtime.dll b/Assets/FastScriptReload/Plugins/ImmersiveVrToolsCommon/ImmersiveVRTools.Common.Runtime.dll
deleted file mode 100644
index 158a5f3..0000000
Binary files a/Assets/FastScriptReload/Plugins/ImmersiveVrToolsCommon/ImmersiveVRTools.Common.Runtime.dll and /dev/null differ
diff --git a/Assets/FastScriptReload/Plugins/ImmersiveVrToolsCommon/ImmersiveVRTools.Common.Runtime.dll.meta b/Assets/FastScriptReload/Plugins/ImmersiveVrToolsCommon/ImmersiveVRTools.Common.Runtime.dll.meta
deleted file mode 100644
index 7f58e6e..0000000
--- a/Assets/FastScriptReload/Plugins/ImmersiveVrToolsCommon/ImmersiveVRTools.Common.Runtime.dll.meta
+++ /dev/null
@@ -1,85 +0,0 @@
-fileFormatVersion: 2
-guid: 42c3f40ad0520e442aa80842ab9748a9
-PluginImporter:
- externalObjects: {}
- serializedVersion: 2
- iconMap: {}
- executionOrder:
- ImmersiveVRTools.Runtime.Common.Debug.RuntimeDebugDraw: 9990
- defineConstraints:
- - UNITY_EDITOR || LiveScriptReload_IncludeInBuild_Enabled
- isPreloaded: 0
- isOverridable: 0
- isExplicitlyReferenced: 1
- validateReferences: 1
- platformData:
- - first:
- : Any
- second:
- enabled: 0
- settings:
- Exclude Android: 0
- Exclude Editor: 0
- Exclude Linux64: 0
- Exclude OSXUniversal: 0
- Exclude Win: 0
- Exclude Win64: 0
- - first:
- Android: Android
- second:
- enabled: 1
- settings:
- CPU: ARMv7
- - first:
- Any:
- second:
- enabled: 1
- settings: {}
- - first:
- Editor: Editor
- second:
- enabled: 1
- settings:
- CPU: AnyCPU
- DefaultValueInitialized: true
- OS: AnyOS
- - first:
- Standalone: Linux64
- second:
- enabled: 1
- settings:
- CPU: AnyCPU
- - first:
- Standalone: OSXUniversal
- second:
- enabled: 1
- settings:
- CPU: None
- - first:
- Standalone: Win
- second:
- enabled: 1
- settings:
- CPU: x86
- - first:
- Standalone: Win64
- second:
- enabled: 1
- settings:
- CPU: x86_64
- - first:
- Windows Store Apps: WindowsStoreApps
- second:
- enabled: 0
- settings:
- CPU: AnyCPU
- userData:
- assetBundleName:
- assetBundleVariant:
-AssetOrigin:
- serializedVersion: 1
- productId: 239351
- packageName: Fast Script Reload
- packageVersion: 1.6.1
- assetPath: Assets/FastScriptReload/Plugins/ImmersiveVrToolsCommon/ImmersiveVRTools.Common.Runtime.dll
- uploadId: 710802
diff --git a/Assets/FastScriptReload/Plugins/ImmersiveVrToolsCommon/ImmersiveVRToolsCommonLicense.txt b/Assets/FastScriptReload/Plugins/ImmersiveVrToolsCommon/ImmersiveVRToolsCommonLicense.txt
deleted file mode 100644
index dd75623..0000000
--- a/Assets/FastScriptReload/Plugins/ImmersiveVrToolsCommon/ImmersiveVRToolsCommonLicense.txt
+++ /dev/null
@@ -1,3 +0,0 @@
-This code is part of the product and can be used with same licence as the one you got it with.
-
-Left in Plugins folder solely for convenience.
\ No newline at end of file
diff --git a/Assets/FastScriptReload/Plugins/ImmersiveVrToolsCommon/ImmersiveVRToolsCommonLicense.txt.meta b/Assets/FastScriptReload/Plugins/ImmersiveVrToolsCommon/ImmersiveVRToolsCommonLicense.txt.meta
deleted file mode 100644
index 29d1be5..0000000
--- a/Assets/FastScriptReload/Plugins/ImmersiveVrToolsCommon/ImmersiveVRToolsCommonLicense.txt.meta
+++ /dev/null
@@ -1,10 +0,0 @@
-fileFormatVersion: 2
-guid: 656785d4ce824de4ac3c58af77fec60d
-timeCreated: 1670158565
-AssetOrigin:
- serializedVersion: 1
- productId: 239351
- packageName: Fast Script Reload
- packageVersion: 1.6.1
- assetPath: Assets/FastScriptReload/Plugins/ImmersiveVrToolsCommon/ImmersiveVRToolsCommonLicense.txt
- uploadId: 710802
diff --git a/Assets/FastScriptReload/Plugins/Roslyn.meta b/Assets/FastScriptReload/Plugins/Roslyn.meta
deleted file mode 100644
index 3e29032..0000000
--- a/Assets/FastScriptReload/Plugins/Roslyn.meta
+++ /dev/null
@@ -1,8 +0,0 @@
-fileFormatVersion: 2
-guid: 99309b63b6416e44f8c19d3f300ee1c1
-folderAsset: yes
-DefaultImporter:
- externalObjects: {}
- userData:
- assetBundleName:
- assetBundleVariant:
diff --git a/Assets/FastScriptReload/Plugins/Roslyn/2019+.meta b/Assets/FastScriptReload/Plugins/Roslyn/2019+.meta
deleted file mode 100644
index 6b4c33d..0000000
--- a/Assets/FastScriptReload/Plugins/Roslyn/2019+.meta
+++ /dev/null
@@ -1,8 +0,0 @@
-fileFormatVersion: 2
-guid: 9bfedaf58be6fc243a48a4cc7e808d73
-folderAsset: yes
-DefaultImporter:
- externalObjects: {}
- userData:
- assetBundleName:
- assetBundleVariant:
diff --git a/Assets/FastScriptReload/Plugins/Roslyn/2019+/Microsoft.CodeAnalysis.CSharp.dll b/Assets/FastScriptReload/Plugins/Roslyn/2019+/Microsoft.CodeAnalysis.CSharp.dll
deleted file mode 100644
index c48d7ce..0000000
Binary files a/Assets/FastScriptReload/Plugins/Roslyn/2019+/Microsoft.CodeAnalysis.CSharp.dll and /dev/null differ
diff --git a/Assets/FastScriptReload/Plugins/Roslyn/2019+/Microsoft.CodeAnalysis.CSharp.dll.meta b/Assets/FastScriptReload/Plugins/Roslyn/2019+/Microsoft.CodeAnalysis.CSharp.dll.meta
deleted file mode 100644
index be33d27..0000000
--- a/Assets/FastScriptReload/Plugins/Roslyn/2019+/Microsoft.CodeAnalysis.CSharp.dll.meta
+++ /dev/null
@@ -1,84 +0,0 @@
-fileFormatVersion: 2
-guid: aa900f3e8ecf37343bb158cd68e5718d
-PluginImporter:
- externalObjects: {}
- serializedVersion: 2
- iconMap: {}
- executionOrder: {}
- defineConstraints:
- - UNITY_2019 || UNITY_2020
- isPreloaded: 0
- isOverridable: 0
- isExplicitlyReferenced: 1
- validateReferences: 1
- platformData:
- - first:
- : Any
- second:
- enabled: 0
- settings:
- Exclude Android: 1
- Exclude Editor: 0
- Exclude Linux64: 1
- Exclude OSXUniversal: 1
- Exclude Win: 1
- Exclude Win64: 1
- - first:
- Android: Android
- second:
- enabled: 0
- settings:
- CPU: ARMv7
- - first:
- Any:
- second:
- enabled: 0
- settings: {}
- - first:
- Editor: Editor
- second:
- enabled: 1
- settings:
- CPU: AnyCPU
- DefaultValueInitialized: true
- OS: AnyOS
- - first:
- Standalone: Linux64
- second:
- enabled: 0
- settings:
- CPU: None
- - first:
- Standalone: OSXUniversal
- second:
- enabled: 0
- settings:
- CPU: None
- - first:
- Standalone: Win
- second:
- enabled: 0
- settings:
- CPU: None
- - first:
- Standalone: Win64
- second:
- enabled: 0
- settings:
- CPU: None
- - first:
- Windows Store Apps: WindowsStoreApps
- second:
- enabled: 0
- settings:
- CPU: AnyCPU
- userData:
- assetBundleName:
- assetBundleVariant:
-AssetOrigin:
- serializedVersion: 1
- productId: 239351
- packageName: Fast Script Reload
- packageVersion: 1.6.1
- assetPath: Assets/FastScriptReload/Plugins/Roslyn/2019+/Microsoft.CodeAnalysis.CSharp.dll
- uploadId: 710802
diff --git a/Assets/FastScriptReload/Plugins/Roslyn/2019+/Microsoft.CodeAnalysis.dll b/Assets/FastScriptReload/Plugins/Roslyn/2019+/Microsoft.CodeAnalysis.dll
deleted file mode 100644
index 6bde7b7..0000000
Binary files a/Assets/FastScriptReload/Plugins/Roslyn/2019+/Microsoft.CodeAnalysis.dll and /dev/null differ
diff --git a/Assets/FastScriptReload/Plugins/Roslyn/2019+/Microsoft.CodeAnalysis.dll.meta b/Assets/FastScriptReload/Plugins/Roslyn/2019+/Microsoft.CodeAnalysis.dll.meta
deleted file mode 100644
index 3456847..0000000
--- a/Assets/FastScriptReload/Plugins/Roslyn/2019+/Microsoft.CodeAnalysis.dll.meta
+++ /dev/null
@@ -1,84 +0,0 @@
-fileFormatVersion: 2
-guid: b6ebf747d582ac34fa013efea6bda29d
-PluginImporter:
- externalObjects: {}
- serializedVersion: 2
- iconMap: {}
- executionOrder: {}
- defineConstraints:
- - UNITY_2019 || UNITY_2020
- isPreloaded: 0
- isOverridable: 0
- isExplicitlyReferenced: 1
- validateReferences: 1
- platformData:
- - first:
- : Any
- second:
- enabled: 0
- settings:
- Exclude Android: 1
- Exclude Editor: 0
- Exclude Linux64: 1
- Exclude OSXUniversal: 1
- Exclude Win: 1
- Exclude Win64: 1
- - first:
- Android: Android
- second:
- enabled: 0
- settings:
- CPU: ARMv7
- - first:
- Any:
- second:
- enabled: 0
- settings: {}
- - first:
- Editor: Editor
- second:
- enabled: 1
- settings:
- CPU: AnyCPU
- DefaultValueInitialized: true
- OS: AnyOS
- - first:
- Standalone: Linux64
- second:
- enabled: 0
- settings:
- CPU: None
- - first:
- Standalone: OSXUniversal
- second:
- enabled: 0
- settings:
- CPU: None
- - first:
- Standalone: Win
- second:
- enabled: 0
- settings:
- CPU: None
- - first:
- Standalone: Win64
- second:
- enabled: 0
- settings:
- CPU: None
- - first:
- Windows Store Apps: WindowsStoreApps
- second:
- enabled: 0
- settings:
- CPU: AnyCPU
- userData:
- assetBundleName:
- assetBundleVariant:
-AssetOrigin:
- serializedVersion: 1
- productId: 239351
- packageName: Fast Script Reload
- packageVersion: 1.6.1
- assetPath: Assets/FastScriptReload/Plugins/Roslyn/2019+/Microsoft.CodeAnalysis.dll
- uploadId: 710802
diff --git a/Assets/FastScriptReload/Plugins/Roslyn/2019+/RoslynLicense.txt b/Assets/FastScriptReload/Plugins/Roslyn/2019+/RoslynLicense.txt
deleted file mode 100644
index 89d7c4f..0000000
--- a/Assets/FastScriptReload/Plugins/Roslyn/2019+/RoslynLicense.txt
+++ /dev/null
@@ -1,23 +0,0 @@
-The MIT License (MIT)
-
-Copyright (c) .NET Foundation and Contributors
-
-All rights reserved.
-
-Permission is hereby granted, free of charge, to any person obtaining a copy
-of this software and associated documentation files (the "Software"), to deal
-in the Software without restriction, including without limitation the rights
-to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
-copies of the Software, and to permit persons to whom the Software is
-furnished to do so, subject to the following conditions:
-
-The above copyright notice and this permission notice shall be included in all
-copies or substantial portions of the Software.
-
-THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
-AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
-LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
-OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
-SOFTWARE.
\ No newline at end of file
diff --git a/Assets/FastScriptReload/Plugins/Roslyn/2019+/RoslynLicense.txt.meta b/Assets/FastScriptReload/Plugins/Roslyn/2019+/RoslynLicense.txt.meta
deleted file mode 100644
index 932c0aa..0000000
--- a/Assets/FastScriptReload/Plugins/Roslyn/2019+/RoslynLicense.txt.meta
+++ /dev/null
@@ -1,10 +0,0 @@
-fileFormatVersion: 2
-guid: 20fdb23994f768f4e89f8a9779e20213
-timeCreated: 1670158681
-AssetOrigin:
- serializedVersion: 1
- productId: 239351
- packageName: Fast Script Reload
- packageVersion: 1.6.1
- assetPath: Assets/FastScriptReload/Plugins/Roslyn/2019+/RoslynLicense.txt
- uploadId: 710802
diff --git a/Assets/FastScriptReload/Plugins/Roslyn/2019+/System.Collections.Immutable.dll b/Assets/FastScriptReload/Plugins/Roslyn/2019+/System.Collections.Immutable.dll
deleted file mode 100644
index 7e8bbed..0000000
Binary files a/Assets/FastScriptReload/Plugins/Roslyn/2019+/System.Collections.Immutable.dll and /dev/null differ
diff --git a/Assets/FastScriptReload/Plugins/Roslyn/2019+/System.Collections.Immutable.dll.meta b/Assets/FastScriptReload/Plugins/Roslyn/2019+/System.Collections.Immutable.dll.meta
deleted file mode 100644
index cfc6d4a..0000000
--- a/Assets/FastScriptReload/Plugins/Roslyn/2019+/System.Collections.Immutable.dll.meta
+++ /dev/null
@@ -1,84 +0,0 @@
-fileFormatVersion: 2
-guid: ef253369b6dd9f4438722b050ca92f39
-PluginImporter:
- externalObjects: {}
- serializedVersion: 2
- iconMap: {}
- executionOrder: {}
- defineConstraints:
- - UNITY_2019 || UNITY_2020
- isPreloaded: 0
- isOverridable: 0
- isExplicitlyReferenced: 1
- validateReferences: 1
- platformData:
- - first:
- : Any
- second:
- enabled: 0
- settings:
- Exclude Android: 1
- Exclude Editor: 0
- Exclude Linux64: 1
- Exclude OSXUniversal: 1
- Exclude Win: 1
- Exclude Win64: 1
- - first:
- Android: Android
- second:
- enabled: 0
- settings:
- CPU: ARMv7
- - first:
- Any:
- second:
- enabled: 0
- settings: {}
- - first:
- Editor: Editor
- second:
- enabled: 1
- settings:
- CPU: AnyCPU
- DefaultValueInitialized: true
- OS: AnyOS
- - first:
- Standalone: Linux64
- second:
- enabled: 0
- settings:
- CPU: None
- - first:
- Standalone: OSXUniversal
- second:
- enabled: 0
- settings:
- CPU: None
- - first:
- Standalone: Win
- second:
- enabled: 0
- settings:
- CPU: None
- - first:
- Standalone: Win64
- second:
- enabled: 0
- settings:
- CPU: None
- - first:
- Windows Store Apps: WindowsStoreApps
- second:
- enabled: 0
- settings:
- CPU: AnyCPU
- userData:
- assetBundleName:
- assetBundleVariant:
-AssetOrigin:
- serializedVersion: 1
- productId: 239351
- packageName: Fast Script Reload
- packageVersion: 1.6.1
- assetPath: Assets/FastScriptReload/Plugins/Roslyn/2019+/System.Collections.Immutable.dll
- uploadId: 710802
diff --git a/Assets/FastScriptReload/Plugins/Roslyn/2019+/System.Reflection.Metadata.dll b/Assets/FastScriptReload/Plugins/Roslyn/2019+/System.Reflection.Metadata.dll
deleted file mode 100644
index 49b7997..0000000
Binary files a/Assets/FastScriptReload/Plugins/Roslyn/2019+/System.Reflection.Metadata.dll and /dev/null differ
diff --git a/Assets/FastScriptReload/Plugins/Roslyn/2019+/System.Reflection.Metadata.dll.meta b/Assets/FastScriptReload/Plugins/Roslyn/2019+/System.Reflection.Metadata.dll.meta
deleted file mode 100644
index ed4d28c..0000000
--- a/Assets/FastScriptReload/Plugins/Roslyn/2019+/System.Reflection.Metadata.dll.meta
+++ /dev/null
@@ -1,84 +0,0 @@
-fileFormatVersion: 2
-guid: f3873ad25446a8b469c55b876e3b4577
-PluginImporter:
- externalObjects: {}
- serializedVersion: 2
- iconMap: {}
- executionOrder: {}
- defineConstraints:
- - UNITY_2019 || UNITY_2020
- isPreloaded: 0
- isOverridable: 0
- isExplicitlyReferenced: 1
- validateReferences: 1
- platformData:
- - first:
- : Any
- second:
- enabled: 0
- settings:
- Exclude Android: 1
- Exclude Editor: 0
- Exclude Linux64: 1
- Exclude OSXUniversal: 1
- Exclude Win: 1
- Exclude Win64: 1
- - first:
- Android: Android
- second:
- enabled: 0
- settings:
- CPU: ARMv7
- - first:
- Any:
- second:
- enabled: 0
- settings: {}
- - first:
- Editor: Editor
- second:
- enabled: 1
- settings:
- CPU: AnyCPU
- DefaultValueInitialized: true
- OS: AnyOS
- - first:
- Standalone: Linux64
- second:
- enabled: 0
- settings:
- CPU: None
- - first:
- Standalone: OSXUniversal
- second:
- enabled: 0
- settings:
- CPU: None
- - first:
- Standalone: Win
- second:
- enabled: 0
- settings:
- CPU: None
- - first:
- Standalone: Win64
- second:
- enabled: 0
- settings:
- CPU: None
- - first:
- Windows Store Apps: WindowsStoreApps
- second:
- enabled: 0
- settings:
- CPU: AnyCPU
- userData:
- assetBundleName:
- assetBundleVariant:
-AssetOrigin:
- serializedVersion: 1
- productId: 239351
- packageName: Fast Script Reload
- packageVersion: 1.6.1
- assetPath: Assets/FastScriptReload/Plugins/Roslyn/2019+/System.Reflection.Metadata.dll
- uploadId: 710802
diff --git a/Assets/FastScriptReload/Plugins/Roslyn/2019+/System.Threading.Tasks.Extensions.dll b/Assets/FastScriptReload/Plugins/Roslyn/2019+/System.Threading.Tasks.Extensions.dll
deleted file mode 100644
index a1234ce..0000000
Binary files a/Assets/FastScriptReload/Plugins/Roslyn/2019+/System.Threading.Tasks.Extensions.dll and /dev/null differ
diff --git a/Assets/FastScriptReload/Plugins/Roslyn/2019+/System.Threading.Tasks.Extensions.dll.meta b/Assets/FastScriptReload/Plugins/Roslyn/2019+/System.Threading.Tasks.Extensions.dll.meta
deleted file mode 100644
index 82a7738..0000000
--- a/Assets/FastScriptReload/Plugins/Roslyn/2019+/System.Threading.Tasks.Extensions.dll.meta
+++ /dev/null
@@ -1,84 +0,0 @@
-fileFormatVersion: 2
-guid: c90f5e7176b3a054684c79065480027d
-PluginImporter:
- externalObjects: {}
- serializedVersion: 2
- iconMap: {}
- executionOrder: {}
- defineConstraints:
- - UNITY_2019 || UNITY_2020
- isPreloaded: 0
- isOverridable: 0
- isExplicitlyReferenced: 1
- validateReferences: 1
- platformData:
- - first:
- : Any
- second:
- enabled: 0
- settings:
- Exclude Android: 1
- Exclude Editor: 0
- Exclude Linux64: 1
- Exclude OSXUniversal: 1
- Exclude Win: 1
- Exclude Win64: 1
- - first:
- Android: Android
- second:
- enabled: 0
- settings:
- CPU: ARMv7
- - first:
- Any:
- second:
- enabled: 0
- settings: {}
- - first:
- Editor: Editor
- second:
- enabled: 1
- settings:
- CPU: AnyCPU
- DefaultValueInitialized: true
- OS: AnyOS
- - first:
- Standalone: Linux64
- second:
- enabled: 0
- settings:
- CPU: None
- - first:
- Standalone: OSXUniversal
- second:
- enabled: 0
- settings:
- CPU: None
- - first:
- Standalone: Win
- second:
- enabled: 0
- settings:
- CPU: None
- - first:
- Standalone: Win64
- second:
- enabled: 0
- settings:
- CPU: None
- - first:
- Windows Store Apps: WindowsStoreApps
- second:
- enabled: 0
- settings:
- CPU: AnyCPU
- userData:
- assetBundleName:
- assetBundleVariant:
-AssetOrigin:
- serializedVersion: 1
- productId: 239351
- packageName: Fast Script Reload
- packageVersion: 1.6.1
- assetPath: Assets/FastScriptReload/Plugins/Roslyn/2019+/System.Threading.Tasks.Extensions.dll
- uploadId: 710802
diff --git a/Assets/FastScriptReload/Plugins/Roslyn/2021+.meta b/Assets/FastScriptReload/Plugins/Roslyn/2021+.meta
deleted file mode 100644
index 3730ddf..0000000
--- a/Assets/FastScriptReload/Plugins/Roslyn/2021+.meta
+++ /dev/null
@@ -1,8 +0,0 @@
-fileFormatVersion: 2
-guid: 70d195e83e3a18d429e11445ca3df423
-folderAsset: yes
-DefaultImporter:
- externalObjects: {}
- userData:
- assetBundleName:
- assetBundleVariant:
diff --git a/Assets/FastScriptReload/Plugins/Roslyn/2021+/Microsoft.CodeAnalysis.CSharp.dll b/Assets/FastScriptReload/Plugins/Roslyn/2021+/Microsoft.CodeAnalysis.CSharp.dll
deleted file mode 100644
index fbd43cb..0000000
Binary files a/Assets/FastScriptReload/Plugins/Roslyn/2021+/Microsoft.CodeAnalysis.CSharp.dll and /dev/null differ
diff --git a/Assets/FastScriptReload/Plugins/Roslyn/2021+/Microsoft.CodeAnalysis.CSharp.dll.meta b/Assets/FastScriptReload/Plugins/Roslyn/2021+/Microsoft.CodeAnalysis.CSharp.dll.meta
deleted file mode 100644
index 0b1a0ff..0000000
--- a/Assets/FastScriptReload/Plugins/Roslyn/2021+/Microsoft.CodeAnalysis.CSharp.dll.meta
+++ /dev/null
@@ -1,84 +0,0 @@
-fileFormatVersion: 2
-guid: 139b14934c1c2ce4dac3f527ac5e78e9
-PluginImporter:
- externalObjects: {}
- serializedVersion: 2
- iconMap: {}
- executionOrder: {}
- defineConstraints:
- - UNITY_2021_1_OR_NEWER
- isPreloaded: 0
- isOverridable: 0
- isExplicitlyReferenced: 1
- validateReferences: 1
- platformData:
- - first:
- : Any
- second:
- enabled: 0
- settings:
- Exclude Android: 1
- Exclude Editor: 0
- Exclude Linux64: 1
- Exclude OSXUniversal: 1
- Exclude Win: 1
- Exclude Win64: 1
- - first:
- Android: Android
- second:
- enabled: 0
- settings:
- CPU: ARMv7
- - first:
- Any:
- second:
- enabled: 0
- settings: {}
- - first:
- Editor: Editor
- second:
- enabled: 1
- settings:
- CPU: AnyCPU
- DefaultValueInitialized: true
- OS: AnyOS
- - first:
- Standalone: Linux64
- second:
- enabled: 0
- settings:
- CPU: None
- - first:
- Standalone: OSXUniversal
- second:
- enabled: 0
- settings:
- CPU: None
- - first:
- Standalone: Win
- second:
- enabled: 0
- settings:
- CPU: None
- - first:
- Standalone: Win64
- second:
- enabled: 0
- settings:
- CPU: None
- - first:
- Windows Store Apps: WindowsStoreApps
- second:
- enabled: 0
- settings:
- CPU: AnyCPU
- userData:
- assetBundleName:
- assetBundleVariant:
-AssetOrigin:
- serializedVersion: 1
- productId: 239351
- packageName: Fast Script Reload
- packageVersion: 1.6.1
- assetPath: Assets/FastScriptReload/Plugins/Roslyn/2021+/Microsoft.CodeAnalysis.CSharp.dll
- uploadId: 710802
diff --git a/Assets/FastScriptReload/Plugins/Roslyn/2021+/Microsoft.CodeAnalysis.dll b/Assets/FastScriptReload/Plugins/Roslyn/2021+/Microsoft.CodeAnalysis.dll
deleted file mode 100644
index c710e0d..0000000
Binary files a/Assets/FastScriptReload/Plugins/Roslyn/2021+/Microsoft.CodeAnalysis.dll and /dev/null differ
diff --git a/Assets/FastScriptReload/Plugins/Roslyn/2021+/Microsoft.CodeAnalysis.dll.meta b/Assets/FastScriptReload/Plugins/Roslyn/2021+/Microsoft.CodeAnalysis.dll.meta
deleted file mode 100644
index 2db563a..0000000
--- a/Assets/FastScriptReload/Plugins/Roslyn/2021+/Microsoft.CodeAnalysis.dll.meta
+++ /dev/null
@@ -1,84 +0,0 @@
-fileFormatVersion: 2
-guid: aab00a18aeb22e84882f5e659c0314da
-PluginImporter:
- externalObjects: {}
- serializedVersion: 2
- iconMap: {}
- executionOrder: {}
- defineConstraints:
- - UNITY_2021_1_OR_NEWER
- isPreloaded: 0
- isOverridable: 0
- isExplicitlyReferenced: 1
- validateReferences: 1
- platformData:
- - first:
- : Any
- second:
- enabled: 0
- settings:
- Exclude Android: 1
- Exclude Editor: 0
- Exclude Linux64: 1
- Exclude OSXUniversal: 1
- Exclude Win: 1
- Exclude Win64: 1
- - first:
- Android: Android
- second:
- enabled: 0
- settings:
- CPU: ARMv7
- - first:
- Any:
- second:
- enabled: 0
- settings: {}
- - first:
- Editor: Editor
- second:
- enabled: 1
- settings:
- CPU: AnyCPU
- DefaultValueInitialized: true
- OS: AnyOS
- - first:
- Standalone: Linux64
- second:
- enabled: 0
- settings:
- CPU: None
- - first:
- Standalone: OSXUniversal
- second:
- enabled: 0
- settings:
- CPU: None
- - first:
- Standalone: Win
- second:
- enabled: 0
- settings:
- CPU: None
- - first:
- Standalone: Win64
- second:
- enabled: 0
- settings:
- CPU: None
- - first:
- Windows Store Apps: WindowsStoreApps
- second:
- enabled: 0
- settings:
- CPU: AnyCPU
- userData:
- assetBundleName:
- assetBundleVariant:
-AssetOrigin:
- serializedVersion: 1
- productId: 239351
- packageName: Fast Script Reload
- packageVersion: 1.6.1
- assetPath: Assets/FastScriptReload/Plugins/Roslyn/2021+/Microsoft.CodeAnalysis.dll
- uploadId: 710802
diff --git a/Assets/FastScriptReload/Plugins/Roslyn/2021+/RoslynLicense.txt b/Assets/FastScriptReload/Plugins/Roslyn/2021+/RoslynLicense.txt
deleted file mode 100644
index 89d7c4f..0000000
--- a/Assets/FastScriptReload/Plugins/Roslyn/2021+/RoslynLicense.txt
+++ /dev/null
@@ -1,23 +0,0 @@
-The MIT License (MIT)
-
-Copyright (c) .NET Foundation and Contributors
-
-All rights reserved.
-
-Permission is hereby granted, free of charge, to any person obtaining a copy
-of this software and associated documentation files (the "Software"), to deal
-in the Software without restriction, including without limitation the rights
-to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
-copies of the Software, and to permit persons to whom the Software is
-furnished to do so, subject to the following conditions:
-
-The above copyright notice and this permission notice shall be included in all
-copies or substantial portions of the Software.
-
-THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
-AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
-LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
-OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
-SOFTWARE.
\ No newline at end of file
diff --git a/Assets/FastScriptReload/Plugins/Roslyn/2021+/RoslynLicense.txt.meta b/Assets/FastScriptReload/Plugins/Roslyn/2021+/RoslynLicense.txt.meta
deleted file mode 100644
index d426261..0000000
--- a/Assets/FastScriptReload/Plugins/Roslyn/2021+/RoslynLicense.txt.meta
+++ /dev/null
@@ -1,10 +0,0 @@
-fileFormatVersion: 2
-guid: d7099df6462159544838be814444129f
-timeCreated: 1670158681
-AssetOrigin:
- serializedVersion: 1
- productId: 239351
- packageName: Fast Script Reload
- packageVersion: 1.6.1
- assetPath: Assets/FastScriptReload/Plugins/Roslyn/2021+/RoslynLicense.txt
- uploadId: 710802
diff --git a/Assets/FastScriptReload/Plugins/Roslyn/2021+/System.Collections.Immutable.FSR.dll b/Assets/FastScriptReload/Plugins/Roslyn/2021+/System.Collections.Immutable.FSR.dll
deleted file mode 100644
index fd518a6..0000000
Binary files a/Assets/FastScriptReload/Plugins/Roslyn/2021+/System.Collections.Immutable.FSR.dll and /dev/null differ
diff --git a/Assets/FastScriptReload/Plugins/Roslyn/2021+/System.Collections.Immutable.FSR.dll.meta b/Assets/FastScriptReload/Plugins/Roslyn/2021+/System.Collections.Immutable.FSR.dll.meta
deleted file mode 100644
index 73e093b..0000000
--- a/Assets/FastScriptReload/Plugins/Roslyn/2021+/System.Collections.Immutable.FSR.dll.meta
+++ /dev/null
@@ -1,84 +0,0 @@
-fileFormatVersion: 2
-guid: 9136761bcf6d7f54d94a6763da626ceb
-PluginImporter:
- externalObjects: {}
- serializedVersion: 2
- iconMap: {}
- executionOrder: {}
- defineConstraints:
- - UNITY_2021_1_OR_NEWER
- isPreloaded: 0
- isOverridable: 0
- isExplicitlyReferenced: 1
- validateReferences: 1
- platformData:
- - first:
- : Any
- second:
- enabled: 0
- settings:
- Exclude Android: 1
- Exclude Editor: 0
- Exclude Linux64: 1
- Exclude OSXUniversal: 1
- Exclude Win: 1
- Exclude Win64: 1
- - first:
- Android: Android
- second:
- enabled: 0
- settings:
- CPU: ARMv7
- - first:
- Any:
- second:
- enabled: 0
- settings: {}
- - first:
- Editor: Editor
- second:
- enabled: 1
- settings:
- CPU: AnyCPU
- DefaultValueInitialized: true
- OS: AnyOS
- - first:
- Standalone: Linux64
- second:
- enabled: 0
- settings:
- CPU: None
- - first:
- Standalone: OSXUniversal
- second:
- enabled: 0
- settings:
- CPU: None
- - first:
- Standalone: Win
- second:
- enabled: 0
- settings:
- CPU: None
- - first:
- Standalone: Win64
- second:
- enabled: 0
- settings:
- CPU: None
- - first:
- Windows Store Apps: WindowsStoreApps
- second:
- enabled: 0
- settings:
- CPU: AnyCPU
- userData:
- assetBundleName:
- assetBundleVariant:
-AssetOrigin:
- serializedVersion: 1
- productId: 239351
- packageName: Fast Script Reload
- packageVersion: 1.6.1
- assetPath: Assets/FastScriptReload/Plugins/Roslyn/2021+/System.Collections.Immutable.FSR.dll
- uploadId: 710802
diff --git a/Assets/FastScriptReload/Plugins/Roslyn/2021+/System.Collections.Immutable.dll b/Assets/FastScriptReload/Plugins/Roslyn/2021+/System.Collections.Immutable.dll
deleted file mode 100644
index 7e8bbed..0000000
Binary files a/Assets/FastScriptReload/Plugins/Roslyn/2021+/System.Collections.Immutable.dll and /dev/null differ
diff --git a/Assets/FastScriptReload/Plugins/Roslyn/2021+/System.Collections.Immutable.dll.meta b/Assets/FastScriptReload/Plugins/Roslyn/2021+/System.Collections.Immutable.dll.meta
deleted file mode 100644
index d185019..0000000
--- a/Assets/FastScriptReload/Plugins/Roslyn/2021+/System.Collections.Immutable.dll.meta
+++ /dev/null
@@ -1,84 +0,0 @@
-fileFormatVersion: 2
-guid: 8fe61eaaa3c4e714c8b9c78ce0303b3a
-PluginImporter:
- externalObjects: {}
- serializedVersion: 2
- iconMap: {}
- executionOrder: {}
- defineConstraints:
- - UNITY_2021_1_OR_NEWER
- isPreloaded: 0
- isOverridable: 0
- isExplicitlyReferenced: 1
- validateReferences: 1
- platformData:
- - first:
- : Any
- second:
- enabled: 0
- settings:
- Exclude Android: 1
- Exclude Editor: 0
- Exclude Linux64: 1
- Exclude OSXUniversal: 1
- Exclude Win: 1
- Exclude Win64: 1
- - first:
- Android: Android
- second:
- enabled: 0
- settings:
- CPU: ARMv7
- - first:
- Any:
- second:
- enabled: 0
- settings: {}
- - first:
- Editor: Editor
- second:
- enabled: 1
- settings:
- CPU: AnyCPU
- DefaultValueInitialized: true
- OS: AnyOS
- - first:
- Standalone: Linux64
- second:
- enabled: 0
- settings:
- CPU: None
- - first:
- Standalone: OSXUniversal
- second:
- enabled: 0
- settings:
- CPU: None
- - first:
- Standalone: Win
- second:
- enabled: 0
- settings:
- CPU: None
- - first:
- Standalone: Win64
- second:
- enabled: 0
- settings:
- CPU: None
- - first:
- Windows Store Apps: WindowsStoreApps
- second:
- enabled: 0
- settings:
- CPU: AnyCPU
- userData:
- assetBundleName:
- assetBundleVariant:
-AssetOrigin:
- serializedVersion: 1
- productId: 239351
- packageName: Fast Script Reload
- packageVersion: 1.6.1
- assetPath: Assets/FastScriptReload/Plugins/Roslyn/2021+/System.Collections.Immutable.dll
- uploadId: 710802
diff --git a/Assets/FastScriptReload/Plugins/Roslyn/2021+/System.Reflection.Metadata.dll b/Assets/FastScriptReload/Plugins/Roslyn/2021+/System.Reflection.Metadata.dll
deleted file mode 100644
index 29d38f9..0000000
Binary files a/Assets/FastScriptReload/Plugins/Roslyn/2021+/System.Reflection.Metadata.dll and /dev/null differ
diff --git a/Assets/FastScriptReload/Plugins/Roslyn/2021+/System.Reflection.Metadata.dll.meta b/Assets/FastScriptReload/Plugins/Roslyn/2021+/System.Reflection.Metadata.dll.meta
deleted file mode 100644
index da25bee..0000000
--- a/Assets/FastScriptReload/Plugins/Roslyn/2021+/System.Reflection.Metadata.dll.meta
+++ /dev/null
@@ -1,84 +0,0 @@
-fileFormatVersion: 2
-guid: 65b841640a4bf8d40b71eaa00a711049
-PluginImporter:
- externalObjects: {}
- serializedVersion: 2
- iconMap: {}
- executionOrder: {}
- defineConstraints:
- - UNITY_2021_1_OR_NEWER
- isPreloaded: 0
- isOverridable: 0
- isExplicitlyReferenced: 1
- validateReferences: 1
- platformData:
- - first:
- : Any
- second:
- enabled: 0
- settings:
- Exclude Android: 1
- Exclude Editor: 0
- Exclude Linux64: 1
- Exclude OSXUniversal: 1
- Exclude Win: 1
- Exclude Win64: 1
- - first:
- Android: Android
- second:
- enabled: 0
- settings:
- CPU: ARMv7
- - first:
- Any:
- second:
- enabled: 0
- settings: {}
- - first:
- Editor: Editor
- second:
- enabled: 1
- settings:
- CPU: AnyCPU
- DefaultValueInitialized: true
- OS: AnyOS
- - first:
- Standalone: Linux64
- second:
- enabled: 0
- settings:
- CPU: None
- - first:
- Standalone: OSXUniversal
- second:
- enabled: 0
- settings:
- CPU: None
- - first:
- Standalone: Win
- second:
- enabled: 0
- settings:
- CPU: None
- - first:
- Standalone: Win64
- second:
- enabled: 0
- settings:
- CPU: None
- - first:
- Windows Store Apps: WindowsStoreApps
- second:
- enabled: 0
- settings:
- CPU: AnyCPU
- userData:
- assetBundleName:
- assetBundleVariant:
-AssetOrigin:
- serializedVersion: 1
- productId: 239351
- packageName: Fast Script Reload
- packageVersion: 1.6.1
- assetPath: Assets/FastScriptReload/Plugins/Roslyn/2021+/System.Reflection.Metadata.dll
- uploadId: 710802
diff --git a/Assets/FastScriptReload/Plugins/Roslyn/2021+/System.Reflection.Metadata.xml b/Assets/FastScriptReload/Plugins/Roslyn/2021+/System.Reflection.Metadata.xml
deleted file mode 100644
index 62f2068..0000000
--- a/Assets/FastScriptReload/Plugins/Roslyn/2021+/System.Reflection.Metadata.xml
+++ /dev/null
@@ -1,8431 +0,0 @@
-
-
-
- System.Reflection.Metadata
-
-
-
-
- Content type masked bits that correspond to values of .
-
-
- Just-In-Time (JIT) compiler optimization is disabled for the assembly.
-
-
- Just-In-Time (JIT) compiler tracking is enabled for the assembly.
-
-
- The assembly reference holds the full (unhashed) public key. Not applicable on assembly definition.
-
-
- The implementation of the referenced assembly used at runtime is not expected to match the version seen at compile time.
-
-
- The assembly contains Windows Runtime code.
-
-
- Specifies the hash algorithms used for hashing assembly files and for generating the strong name.
-
-
-
- Retrieves the MD5 message-digest algorithm.
- Due to collision problems with MD5, Microsoft recommends SHA256.
- MD5 was developed by Rivest in 1991. It is basically MD4 with safety-belts and, while it is slightly slower than MD4, it helps provide more security. The algorithm consists of four distinct rounds, which has a slightly different design from that of MD4. Message-digest size, as well as padding requirements, remain the same.
-
-
-
-
- A mask indicating that there is no hash algorithm.
- If you specify for a multi-module assembly, the common language runtime defaults to the SHA1 algorithm, since multi-module assemblies need to generate a hash.
-
-
-
-
- Retrieves a revision of the Secure Hash Algorithm that corrects an unpublished flaw in SHA.
- Due to collision problems with SHA1, Microsoft recommends SHA256.
-
-
-
- Retrieves a version of the Secure Hash Algorithm with a hash size of 256 bits.
-
-
- Retrieves a version of the Secure Hash Algorithm with a hash size of 384 bits.
-
-
- Retrieves a version of the Secure Hash Algorithm with a hash size of 512 bits.
-
-
- Specifies the security actions that can be performed using declarative security.
-
-
- The calling code can access the resource identified by the current permission object, even if callers higher in the stack have not been granted permission to access the resource.
-
-
- Check that all callers in the call chain have been granted the specified permission.
-
-
- Without further checks refuse Demand for the specified permission.
-
-
- The derived class inheriting the class or overriding a method is required to have the specified permission.
-
-
- Check that the immediate caller has been granted the specified permission.
-
-
- No declarative security action.
-
-
- Without further checks, refuse the demand for all permissions other than those specified.
-
-
- Request the minimum permissions required for code to run. This action can only be used within the scope of the assembly.
-
-
- Request additional permissions that are optional (not required to run). This request implicitly refuses all other permissions not specifically requested. This action can only be used within the scope of the assembly.
-
-
- Request that permissions that might be misused not be granted to the calling code. This action can only be used within the scope of the assembly.
-
-
-
- The resource is not exported from the assembly.
-
-
- The resource is exported from the assembly.
-
-
- Masks just the visibility-related attributes.
-
-
- Represents the shape of an array type.
-
-
- Initializes a new instance of the structure.
- The number of dimensions in the array.
- The size of each dimension.
- The lower-bound of each dimension.
-
-
- Gets the lower-bounds of all dimensions. Length may be smaller than rank, in which case the trailing dimensions have unspecified lower bounds.
- An array of lower-bounds.
-
-
- Gets the number of dimensions in the array.
- The number of dimensions.
-
-
- Gets the sizes of all dimensions.
- An array of sizes.
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- Indicates whether the current object is equal to another object of the same type.
- An object to compare with this object.
-
- if the current object is equal to the parameter; otherwise, .
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- Gets a value that indicates whether the file contains metadata.
-
- if the file contains metadata, otherwise.
-
-
- Gets the hash value of the file content calculated using .
- A instance representing the hash value of the file content.
-
-
- Gets the file name, including its extension.
- A instance representing the file name with its extension.
-
-
-
-
-
-
- Indicates whether the current object is equal to another object of the same type.
- An object to compare with this object.
-
- if the current object is equal to the parameter; otherwise, .
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- Represents a collection of .
-
-
-
- Returns an enumerator that iterates through the collection.
- An enumerator that can be used to iterate through the collection.
-
-
- Returns an enumerator that iterates through a collection.
- An object that can be used to iterate through the collection.
-
-
- Gets the number of elements in the collection.
- The number of elements in the collection.
-
-
-
- Advances the enumerator to the next element of the collection.
-
- if the enumerator was successfully advanced to the next element; if the enumerator has passed the end of the collection.
-
-
- Sets the enumerator to its initial position, which is before the first element in the collection.
-
-
- Performs application-defined tasks associated with freeing, releasing, or resetting unmanaged resources.
-
-
- Gets the element in the collection at the current position of the enumerator.
- The element in the collection at the current position of the enumerator.
-
-
- Gets the element in the collection at the current position of the enumerator.
- The element in the collection at the current position of the enumerator.
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- Indicates whether the current object is equal to another object of the same type.
- An object to compare with this object.
-
- if the current object is equal to the parameter; otherwise, .
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- A collection of assembly references.
-
-
-
- Returns an enumerator that iterates through the collection.
- An enumerator that can be used to iterate through the collection.
-
-
- Returns an enumerator that iterates through a collection.
- An object that can be used to iterate through the collection.
-
-
- Gets the number of elements in the collection.
- The number of elements in the collection.
-
-
-
- Advances the enumerator to the next element of the collection.
-
- if the enumerator was successfully advanced to the next element; if the enumerator has passed the end of the collection.
-
-
- Sets the enumerator to its initial position, which is before the first element in the collection.
-
-
- Performs application-defined tasks associated with freeing, releasing, or resetting unmanaged resources.
-
-
- Gets the element in the collection at the current position of the enumerator.
- The element in the collection at the current position of the enumerator.
-
-
- Gets the element in the collection at the current position of the enumerator.
- The element in the collection at the current position of the enumerator.
-
-
-
-
-
-
-
-
-
-
-
- The builder is not writable; it has been linked with another one.
-
-
-
-
-
-
- Compares the current content of this writer with another one.
- A instance to compare with this one.
- Content is not available; the builder has been linked with another one.
-
- if equal; otherwise, .
-
-
-
-
- Returns a sequence of all blobs that represent the content of the builder.
- Content is not available; the builder has been linked with another one.
- A sequence of blobs.
-
-
-
-
- is .
- The builder is not writable; it has been linked with another one.
-
-
-
-
- is .
- The builder is not writable; it has been linked with another one.
-
-
-
- The builder is not writable; it has been linked with another one.
-
-
- Reserves a contiguous block of bytes.
-
-
- is negative.
- The builder is not writable; it has been linked with another one.
-
-
- Content is not available; the builder has been linked with another one.
-
-
-
-
- The range specified by and falls outside of the bounds of the buffer content.
- Content is not available; the builder has been linked with another one.
-
-
- Content is not available; the builder has been linked with another one.
-
-
-
-
- The range specified by and falls outside of the bounds of the buffer content.
- Content is not available; the builder has been linked with another one.
-
-
- Attempts to write a sequence of bytes to the builder. A return value indicates the number of bytes successfully written.
-
-
-
- is .
-
- is negative.
- The builder is not writable; it has been linked with another one.
- The number of bytes successfully written from .
-
-
- Writes a value to the builder.
- The value to write.
- The builder is not writable; it has been linked with another one.
-
-
- Writes a value to the builder.
- The value to write.
- The builder is not writable; it has been linked with another one.
-
-
- Writes a specified number of bytes from a buffer to the builder.
-
- The number of bytes to write.
-
- is .
-
- is negative.
- The builder is not writable, it has been linked with another one.
-
-
- Writes a specified number of occurrences of a byte value to the builder.
-
- The number of occurences of to write.
-
- is negative.
- The builder is not writable, it has been linked with another one.
-
-
- Writes the contents of a byte array to the builder.
- The byte array to write.
-
- is .
- The builder is not writable; it has been linked with another one.
-
-
- Writes a specified number of bytes starting at a specified index in a byte array to the builder.
-
-
- The number of bytes to write.
-
- is .
- The range specified by and falls outside of the bounds of .
- The builder is not writable; it has been linked with another one.
-
-
- Writes the contents of an immutable byte array to the builder.
- The array to write.
-
- is .
- The builder is not writable; it has been linked with another one.
-
-
- Writes a specified number of bytes starting at a specified index of an immutable array to the builder.
-
-
- The number of bytes to write.
-
- is .
- The range specified by and falls outside of the bounds of the .
- The builder is not writable; it has been linked with another one.
-
-
- Implements compressed unsigned integer encoding as defined by ECMA-335-II chapter 23.2: Blobs and signatures.
- The value to write.
-
- can't be represented as a compressed unsigned integer.
- The builder is not writable; it has been linked with another one.
-
-
- Implements compressed signed integer encoding as defined by ECMA-335-II chapter 23.2: Blobs and signatures.
- The value to write.
-
- can't be represented as a compressed signed integer.
- The builder is not writable; it has been linked with another one.
-
-
- Writes a constant value (see ECMA-335 Partition II section 22.9) at the current position.
- The constant value to write.
-
- is not of a constant type.
- The builder is not writable; it has been linked with another one.
-
-
-
-
- is .
- Content is not available, the builder has been linked with another one.
-
-
-
-
- is .
- Content is not available, the builder has been linked with another one.
-
-
-
-
- is default ().
- Content is not available, the builder has been linked with another one.
-
-
-
- Builder is not writable, it has been linked with another one.
-
-
-
- Builder is not writable, it has been linked with another one.
-
-
-
- Builder is not writable, it has been linked with another one.
-
-
-
- Builder is not writable, it has been linked with another one.
-
-
-
- Builder is not writable, it has been linked with another one.
-
-
-
- Builder is not writable, it has been linked with another one.
-
-
-
- Builder is not writable, it has been linked with another one.
-
-
-
- Builder is not writable, it has been linked with another one.
-
-
-
- Builder is not writable, it has been linked with another one.
-
-
- Writes a reference to a heap (heap offset) or a table (row number).
- Heap offset or table row number.
-
- to encode the reference as a 16-bit integer; to encode it as a 32-bit integer.
- Builder is not writable, it has been linked with another one.
-
-
-
- Builder is not writable, it has been linked with another one.
-
-
- Writes a string in SerString format (see ECMA-335-II 23.3 Custom attributes).
-
- Builder is not writable, it has been linked with another one.
-
-
-
- Builder is not writable, it has been linked with another one.
-
-
-
- Builder is not writable, it has been linked with another one.
-
-
-
- Builder is not writable, it has been linked with another one.
-
-
-
- Builder is not writable, it has been linked with another one.
-
-
-
- Builder is not writable, it has been linked with another one.
-
-
-
- Builder is not writable, it has been linked with another one.
-
-
- Writes a string in User String (#US) heap format (see ECMA-335-II 24.2.4 #US and #Blob heaps).
-
- Builder is not writable, it has been linked with another one.
-
-
- Writes a UTF16 (little-endian) encoded character array at the current position.
-
-
- is .
- Builder is not writable, it has been linked with another one.
-
-
- Writes UTF16 (little-endian) encoded string at the current position.
-
-
- is .
- Builder is not writable, it has been linked with another one.
-
-
- Writes a UTF8 encoded string at the current position.
- Constant value.
-
- to encode unpaired surrogates as specified; to replace them with a U+FFFD character.
-
- is .
- Builder is not writable, it has been linked with another one.
-
-
-
-
-
-
-
- Advances the enumerator to the next element of the collection.
-
- if the enumerator was successfully advanced to the next element; if the enumerator has passed the end of the collection.
-
-
- Sets the enumerator to its initial position, which is before the first element in the collection.
-
-
- Returns an enumerator that iterates through the collection.
- An enumerator that can be used to iterate through the collection.
-
-
- Returns an enumerator that iterates through a collection.
- An object that can be used to iterate through the collection.
-
-
- Performs application-defined tasks associated with freeing, releasing, or resetting unmanaged resources.
-
-
- Gets the element in the collection at the current position of the enumerator.
- The element in the collection at the current position of the enumerator.
-
-
- Gets the element in the collection at the current position of the enumerator.
- The element in the collection at the current position of the enumerator.
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- Indicates whether the current object is equal to another object of the same type.
- An object to compare with this object.
-
- if the current object is equal to the parameter; otherwise, .
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- Indicates whether the current object is equal to another object of the same type.
- An object to compare with this object.
-
- if the current object is equal to the parameter; otherwise, .
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- Creates a reader of the specified memory block.
- A pointer to the start of the memory block.
- Length in bytes of the memory block.
-
- is and is greater than zero.
-
- is negative.
- The current platform is not little-endian.
-
-
- Repositions the reader forward by the number of bytes required to satisfy the given alignment.
-
-
-
- Searches for a specified byte in the blob following the current position.
- The byte value to find.
- The index relative to the current position, or -1 if the byte is not found in the blob following the current position.
-
-
- Reads a Blob heap handle encoded as a compressed integer.
-
-
-
-
- Reads bytes starting at the current position.
- The number of bytes to read.
-
- bytes not available.
- The byte array.
-
-
- Reads bytes starting at the current position and writes them to the specified buffer starting at the specified offset.
- The number of bytes to read.
- The destination buffer the bytes read will be written to.
- The offset in the destination buffer where the bytes read will be written.
-
- bytes not available.
-
-
-
- Reads an unsigned compressed integer value. See Metadata Specification section II.23.2: Blobs and signatures.
- The data at the current position was not a valid compressed integer.
- The value of the compressed integer that was read.
-
-
- Reads a signed compressed integer value. See Metadata Specification section II.23.2: Blobs and signatures.
- The data at the current position was not a valid compressed integer.
- The value of the compressed integer that was read.
-
-
- Reads a constant value (see ECMA-335 Partition II section 22.9) from the current position.
-
- Error while reading from the blob.
-
- is not a valid .
- A boxed constant value. To avoid allocating the object use Read* methods directly.
-
-
-
- Reads a number.
- The data at the current position was not a valid number.
-
-
-
-
-
-
-
-
- Reads a type code encoded in a serialized custom attribute value.
-
- if the encoding is invalid.
-
-
- Reads a string encoded as a compressed integer containing its length followed by its contents in UTF8. Null strings are encoded as a single 0xFF byte.
- The encoding is invalid.
- A string value, or .
-
-
-
- Reads a type code encoded in a signature.
- The type code encoded in the serialized custom attribute value if the encoding is valid, or if the encoding is invalid.
-
-
-
- Reads a type handle encoded in a signature as TypeDefOrRefOrSpecEncoded (see ECMA-335 II.23.2.8).
- The handle when the encoding is valid. Otherwise, a handle where the property is .
-
-
-
-
-
- Reads a UTF16 (little-endian) encoded string starting at the current position.
- The number of bytes to read.
-
- bytes not available.
- The string.
-
-
- Reads a UTF8 encoded string starting at the current position.
- The number of bytes to read.
-
- bytes not available.
- The string.
-
-
- Repositions the reader to the start of the underlying memory block.
-
-
- Reads an unsigned compressed integer value. See Metadata Specification section II.23.2: Blobs and signatures.
- The value of the compressed integer that was read.
-
- if the value was read successfully. if the data at the current position was not a valid compressed integer.
-
-
- Reads a signed compressed integer value. See Metadata Specification section II.23.2: Blobs and signatures.
- The value of the compressed integer that was read.
-
- if the value was read successfully. if the data at the current position was not a valid compressed integer.
-
-
- Gets a pointer to the byte at the current position of the reader.
-
-
- Gets the total length of the underlying memory block.
-
-
- Gets or sets the offset from the start of the blob to the current position.
- The offset is set outside the bounds of the underlying reader.
-
-
- Gets the number of bytes remaining from current position to the end of the underlying memory block.
-
-
- Gets a pointer to the byte at the start of the underlying memory block.
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- Compares the current content of this writer with another one.
-
-
-
-
-
-
-
-
-
- The range specified by and falls outside of the bounds of the buffer content.
-
-
-
-
-
- Range specified by and falls outside of the bounds of the buffer content.
-
-
-
-
-
-
-
-
-
-
-
- is .
-
- is negative.
-
-
-
-
-
- is negative.
-
-
-
-
- is .
-
-
-
-
-
-
- is .
- Range specified by and falls outside of the bounds of the .
-
-
-
-
- is .
-
-
-
-
-
-
- is .
- Range specified by and falls outside of the bounds of the .
-
-
-
-
-
- is .
-
- is negative.
-
-
-
-
- is .
-
-
- Implements compressed unsigned integer encoding as defined by ECMA-335-II chapter 23.2: Blobs and signatures.
-
-
- can't be represented as a compressed unsigned integer.
-
-
- Implements compressed signed integer encoding as defined by ECMA-335-II chapter 23.2: Blobs and signatures.
-
-
- can't be represented as a compressed signed integer.
-
-
- Writes a constant value (see ECMA-335 Partition II section 22.9) at the current position.
-
-
- is not of a constant type.
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- Writes a reference to a heap (heap offset) or a table (row number).
- Heap offset or table row number.
-
- to encode the reference as 16-bit integer, to encode as 32-bit integer.
-
-
-
-
-
- Writes a string in SerString format (see ECMA-335-II 23.3 Custom attributes).
-
- The builder is not writable; it has been linked with another one.
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- Writes a string in User String (#US) heap format (see ECMA-335-II 24.2.4 #US and #Blob heaps).
-
- Builder is not writable, it has been linked with another one.
-
-
- Writes a UTF16 (little-endian) encoded string at the current position.
-
-
- is .
-
-
- Writes a UTF16 (little-endian) encoded string at the current position.
-
-
- is .
-
-
- Writes a UTF8 encoded string at the current position.
-
-
-
- is .
-
-
-
-
-
-
-
- Gets the parent handle (, , or ).
-
-
- Gets a type code that identifies the type of the constant value.
-
-
- Gets the constant value.
-
-
-
-
-
-
- Indicates whether the current object is equal to another object of the same type.
- An object to compare with this object.
-
- if the current object is equal to the parameter; otherwise, .
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- Specifies values that represent types of metadata constants.
-
-
- A Boolean type.
-
-
- An unsigned 1-byte integer.
-
-
- A character type.
-
-
- An 8-byte floating point type.
-
-
- A signed 2-byte integer type.
-
-
- A signed 4-byte integer type.
-
-
- A signed 8-byte integer type.
-
-
- An invalid type.
-
-
- A null reference.
-
-
- A signed 1-byte integer type.
-
-
- A 4-byte floating point type.
-
-
- A type.
-
-
- An unsigned 2-byte integer type.
-
-
- An unsigned 4-byte integer type.
-
-
- An unsigned 8-byte integer type.
-
-
-
- Decodes the arguments encoded in the value blob.
-
-
-
-
- Gets the constructor (the or ) of the custom attribute type.
-
-
- Gets the handle of the metadata entity the attribute is applied to.
-
-
- Gets the value of the attribute.
-
-
-
-
-
-
- Indicates whether the current object is equal to another object of the same type.
- An object to compare with this object.
-
- if the current object is equal to the parameter; otherwise, .
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- Returns an enumerator that iterates through the collection.
- An enumerator that can be used to iterate through the collection.
-
-
- Returns an enumerator that iterates through a collection.
- An object that can be used to iterate through the collection.
-
-
- Gets the number of elements in the collection.
- The number of elements in the collection.
-
-
-
- Advances the enumerator to the next element of the collection.
-
- if the enumerator was successfully advanced to the next element; if the enumerator has passed the end of the collection.
-
-
- Sets the enumerator to its initial position, which is before the first element in the collection.
-
-
- Performs application-defined tasks associated with freeing, releasing, or resetting unmanaged resources.
-
-
- Gets the element in the collection at the current position of the enumerator.
- The element in the collection at the current position of the enumerator.
-
-
- Gets the element in the collection at the current position of the enumerator.
- The element in the collection at the current position of the enumerator.
-
-
- Represents a named argument decoded from a custom attribute signature.
- The type used to represent types of values decoded from the custom attribute signature.
-
-
- Initializes a new instance of the structure using the specified name, kind, type, and value.
- The name of the argument.
- The kind of the argument.
- The type of the argument.
- The value of the argument.
-
-
- Gets the kind of argument.
- The argument kind.
-
-
- Gets the name of the argument.
- The argument name.
-
-
- Gets the type of the argument.
- The argument type.
-
-
- Gets the value of the argument.
- An object containing the argument value.
-
-
- Specifies constants that define the kinds of arguments in a custom attribute signature.
-
-
- A field argument.
-
-
- A property argument.
-
-
- Represents a typed argument for a custom metadata attribute.
- The type of the argument.
-
-
- Initializes a new instance of the structure using the specified argument type and value.
- The type of the argument.
- The argument value.
-
-
- Gets the type of the argument.
- The argument type.
-
-
- Gets the value of the argument.
- The argument value.
-
-
- Represents a custom attribute of the type specified by .
- The attribute type.
-
-
- Initializes a new instance of the structure using the specified fixed arguments and named arguments.
- The fixed arguments.
- The named arguments.
-
-
- Gets the fixed arguments for the custom attribute.
- An immutable array of arguments.
-
-
- Gets the named arguments for the custom attribute value.
- An immutable array of arguments.
-
-
-
-
-
-
-
-
-
-
- Indicates whether the current object is equal to another object of the same type.
- An object to compare with this object.
-
- if the current object is equal to the parameter; otherwise, .
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- Returns an enumerator that iterates through the collection.
- An enumerator that can be used to iterate through the collection.
-
-
- Returns an enumerator that iterates through a collection.
- An object that can be used to iterate through the collection.
-
-
- Gets the number of elements in the collection.
- The number of elements in the collection.
-
-
-
- Advances the enumerator to the next element of the collection.
-
- if the enumerator was successfully advanced to the next element; if the enumerator has passed the end of the collection.
-
-
- Sets the enumerator to its initial position, which is before the first element in the collection.
-
-
- Performs application-defined tasks associated with freeing, releasing, or resetting unmanaged resources.
-
-
- Gets the element in the collection at the current position of the enumerator.
- The element in the collection at the current position of the enumerator.
-
-
- Gets the element in the collection at the current position of the enumerator.
- The element in the collection at the current position of the enumerator.
-
-
-
-
-
- Gets the offset (in bytes) from the start of the metadata blob to the start of the blob.
-
-
-
-
-
-
-
-
-
-
- Indicates whether the current object is equal to another object of the same type.
- An object to compare with this object.
-
- if the current object is equal to the parameter; otherwise, .
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- Returns an enumerator that iterates through the collection.
- An enumerator that can be used to iterate through the collection.
-
-
- Returns an enumerator that iterates through a collection.
- An object that can be used to iterate through the collection.
-
-
- Gets the number of elements in the collection.
- The number of elements in the collection.
-
-
-
- Advances the enumerator to the next element of the collection.
-
- if the enumerator was successfully advanced to the next element; if the enumerator has passed the end of the collection.
-
-
- Sets the enumerator to its initial position, which is before the first element in the collection.
-
-
- Performs application-defined tasks associated with freeing, releasing, or resetting unmanaged resources.
-
-
- Gets the element in the collection at the current position of the enumerator.
- The element in the collection at the current position of the enumerator.
-
-
- Gets the element in the collection at the current position of the enumerator.
- The element in the collection at the current position of the enumerator.
-
-
- The source document in the debug metadata.
-
-
- Gets the document content hash.
-
-
- Gets the hash algorithm used to calculate the (SHA1, SHA256, etc.).
-
-
- Gets the source code language (C#, VB, F#, etc.).
-
-
- Gets the document name blob.
-
-
-
-
-
-
- Indicates whether the current object is equal to another object of the same type.
- An object to compare with this object.
-
- if the current object is equal to the parameter; otherwise, .
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- Returns an enumerator that iterates through the collection.
- An enumerator that can be used to iterate through the collection.
-
-
- Returns an enumerator that iterates through a collection.
- An object that can be used to iterate through the collection.
-
-
- Gets the number of elements in the collection.
- The number of elements in the collection.
-
-
-
- Advances the enumerator to the next element of the collection.
-
- if the enumerator was successfully advanced to the next element; if the enumerator has passed the end of the collection.
-
-
- Sets the enumerator to its initial position, which is before the first element in the collection.
-
-
- Performs application-defined tasks associated with freeing, releasing, or resetting unmanaged resources.
-
-
- Gets the element in the collection at the current position of the enumerator.
- The element in the collection at the current position of the enumerator.
-
-
- Gets the element in the collection at the current position of the enumerator.
- The element in the collection at the current position of the enumerator.
-
-
- A representing a blob on #Blob heap in Portable PDB structured as Document Name.
-
-
-
-
-
- Indicates whether the current object is equal to another object of the same type.
- An object to compare with this object.
-
- if the current object is equal to the parameter; otherwise, .
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- Encodes array shape.
- The number of dimensions in the array (shall be 1 or more).
- Dimension sizes. The array may be shorter than but not longer.
- Dimension lower bounds, or default() to set all lower bounds to 0.
- The array may be shorter than but not longer.
-
- is outside of range [1, 0xffff], smaller than , or smaller than .
-
- is .
-
-
-
-
-
-
-
- Encodes custom attribute signature blob.
- Called first, to encode fixed arguments.
- Called second, to encode named arguments.
-
- or is .
-
-
- Encodes custom attribute signature blob.
- Returns a pair of encoders that must be used in the order they appear in the parameter list.
- Use first, to encode fixed arguments.
- Use second, to encode named arguments.
-
-
- Encodes Field Signature blob, with additional support for encoding ref fields, custom modifiers and typed references.
- Encoder of the field type.
-
-
- Encodes field signature blob.
- Encoder of the field type.
-
-
- Encodes local variable signature.
- Number of local variables.
-
- is not in range [0, 0x1fffffff].
- Encoder of a sequence of local variables.
-
-
- Encodes method signature blob.
- Calling convention.
- Number of generic parameters.
-
- to encode an instance method signature, to encode a static method signature.
-
- is not in range [0, 0xffff].
- An encoder of the rest of the signature including return value and parameters.
-
-
- Encodes method specification signature blob.
- Number of generic arguments.
-
- is not in range [0, 0xffff].
- Encoder of generic arguments.
-
-
- Encodes permission set arguments.
- Number of arguments in the set.
- Encoder of the arguments of the set.
-
-
- Encodes a permission set blob.
- Number of attributes in the set.
-
- is not in range [0, 0x1fffffff].
- Permission set encoder.
-
-
- Encodes property signature blob.
-
- to encode an instance property signature, to encode a static property signature.
- An encoder of the rest of the signature including return value and parameters, which has the same structure as method signature.
-
-
- Encodes type specification signature.
- Type encoder of the structured type represented by the type specification (it shall not encode a primitive type).
-
-
-
-
- Calculates a CustomAttributeType coded index for the specified handle.
-
- or .
- The handle type is unexpected.
-
-
- Calculates a HasConstant coded index for the specified handle.
-
- , , or .
- The handle type is unexpected.
-
-
- Calculates a HasCustomAttribute coded index for the specified handle.
-
- , , , , , , , , , , , , , , , , , , , , or .
- The handle type is unexpected.
-
-
- Calculates a HasCustomDebugInformation coded index for the specified handle.
-
- , , , , , , , , , , , , , , , , , , , , , , , , , or .
- The handle type is unexpected.
-
-
- Calculates a HasDeclSecurity coded index for the specified handle.
-
- , , or .
- The handle type is unexpected.
-
-
- Calculates a HasFieldMarshal coded index for the specified handle.
-
- or .
- The handle type is unexpected.
-
-
- Calculates a HasSemantics coded index for the specified handle.
-
- or .
- The handle type is unexpected.
-
-
- Calculates an implementation coded index for the specified handle.
-
- , or .
- The handle type is unexpected.
-
-
- Calculates a MemberForwarded coded index for the specified handle.
-
- , .
- The handle type is unexpected.
-
-
- Calculates a MemberRefParent coded index for the specified handle.
-
- , , , , or .
- The handle type is unexpected.
-
-
- Calculates a MethodDefOrRef coded index for the specified handle.
-
- or .
- The handle type is unexpected.
-
-
- Calculates a ResolutionScope coded index for the specified handle.
-
- , , or .
- The handle type is unexpected.
-
-
- Calculates a TypeDefOrRef coded index for the specified handle.
-
- or .
- The handle type is unexpected.
-
-
- Calculates a TypeDefOrRefOrSpec coded index for the specified handle.
-
- , or .
- The handle type is unexpected.
-
-
- Calculates a TypeOrMethodDef coded index for the specified handle.
-
- or .
- The handle type is unexpected.
-
-
- Emits branches and exception blocks in a method body.
-
-
-
- Adds catch region.
- Label marking the first instruction of the try block.
- Label marking the instruction immediately following the try block.
- Label marking the first instruction of the handler.
- Label marking the instruction immediately following the handler.
- The type of exception to be caught: , or .
- A label was not defined by an instruction encoder this builder is associated with.
-
--or-
-
- is not a valid type handle.
- A label has default value.
-
-
- Adds fault region.
- Label marking the first instruction of the try block.
- Label marking the instruction immediately following the try block.
- Label marking the first instruction of the handler.
- Label marking the instruction immediately following the handler.
- A label was not defined by an instruction encoder this builder is associated with.
- A label has default value.
-
-
- Adds catch region.
- Label marking the first instruction of the try block.
- Label marking the instruction immediately following the try block.
- Label marking the first instruction of the handler.
- Label marking the instruction immediately following the handler.
- Label marking the first instruction of the filter block.
- A label was not defined by an instruction encoder this builder is associated with.
- A label has default value.
-
-
- Adds finally region.
- Label marking the first instruction of the try block.
- Label marking the instruction immediately following the try block.
- Label marking the first instruction of the handler.
- Label marking the instruction immediately following the handler.
- A label was not defined by an instruction encoder this builder is associated with.
- A label has default value.
-
-
- Clears the object's internal state, allowing the same instance to be reused.
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- Encodes a custom modifier.
-
- , or .
- Is optional modifier.
-
- is or of an unexpected kind.
- Encoder of subsequent modifiers.
-
-
-
-
-
-
-
-
-
-
-
- Indicates whether the current object is equal to another object of the same type.
- An object to compare with this object.
-
- if the current object is equal to the parameter; otherwise, .
-
-
-
-
-
-
-
-
-
-
-
-
-
- Adds an exception clause.
- Clause kind.
- Try block start offset.
- Try block length.
- Handler start offset.
- Handler length.
-
- , or , or nil if is not .
- Offset of the filter block, or 0 if the is not .
-
- is invalid.
-
- has an invalid value.
-
--or-
-
-, , , or is out of range.
- Method body was not declared to have exception regions.
- Encoder for the next clause.
-
-
- Adds a fault clause.
- Try block start offset.
- Try block length.
- Handler start offset.
- Handler length.
-
- , or .
-
- is invalid.
-
- , , or is out of range.
- Method body was not declared to have exception regions.
- Encoder for the next clause.
-
-
- Adds a fault clause.
- Try block start offset.
- Try block length.
- Handler start offset.
- Handler length.
-
- , , or is out of range.
- Method body was not declared to have exception regions.
- Encoder for the next clause.
-
-
- Adds a fault clause.
- Try block start offset.
- Try block length.
- Handler start offset.
- Handler length.
- Offset of the filter block.
-
- , , or is out of range.
- Method body was not declared to have exception regions.
- Encoder for the next clause.
-
-
- Adds a finally clause.
- Try block start offset.
- Try block length.
- Handler start offset.
- Handler length.
-
- , , or is out of range.
- Method body was not declared to have exception regions.
- Encoder for the next clause.
-
-
- Returns if the region fits small format.
- Start offset of the region.
- Length of the region.
-
-
- Returns if the number of exception regions first small format.
- Number of exception regions.
-
-
- The underlying builder.
-
-
-
- if the encoder uses small format.
-
-
- Provides an extension method to access the TypeDefinitionId column of the ExportedType table.
-
-
- Gets a hint at the likely row number of the target type in the TypeDef table of its module.
- If the namespaces and names do not match, resolution falls back to a full search of the target TypeDef table. Ignored and should be zero if is .
-
-
-
- Provides encoder for field signature blob, with additional support for encoding ref fields, custom modifiers and typed references.
-
-
- Initializes a new instance of the struct.
- Builder to write encoded field signature to.
-
-
- Gets the custom modifiers encoder to the field signature.
- The encoder that specifies the custom modifiers to the field signature.
-
-
- Encodes the field type signature.
- Determines if the field is ByRef
- Encoder of the field type.
-
-
- Write .
-
-
- Underlying builder where encoded field signature is written to.
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- Encodes Common Intermediate Language (CIL) instructions.
-
-
- Creates an encoder backed by code and control-flow builders.
- Builder to write encoded instructions to.
- Builder tracking labels, branches and exception handlers.
- Must be specified to be able to use some of the control-flow factory methods of , such as , , etc.
-
-
- Encodes a branch instruction.
- Branch instruction to encode.
- Label of the target location in instruction stream.
-
- is not a branch instruction.
-
--or-
-
- was not defined by this encoder.
-
- is .
-
- has default value.
-
-
- Encodes call instruction and its operand.
-
-
-
- Encodes call instruction and its operand.
-
-
-
- Encodes call instruction and its operand.
-
-
-
- Encodes call instruction and its operand.
-
-
-
- Encodes calli instruction and its operand.
-
-
-
- Defines a label that can later be used to mark and refer to a location in the instruction stream.
-
- is .
- Label handle.
-
-
- Encodes argument load instruction.
- Index of the argument.
-
- is negative.
-
-
- Encodes argument address load instruction.
- Index of the argument.
-
- is negative.
-
-
- Encodes constant load instruction.
-
-
-
- Encodes constant load instruction.
-
-
-
- Encodes constant load instruction.
-
-
-
- Encodes constant load instruction.
-
-
-
- Encodes local variable load instruction.
- Index of the local variable slot.
-
- is negative.
-
-
- Encodes local variable address load instruction.
- Index of the local variable slot.
-
- is negative.
-
-
- Encodes ldstr instruction and its operand.
-
-
-
- Associates specified label with the current IL offset.
- Label to mark.
-
- is .
-
- was not defined by this encoder.
-
- has default value.
-
-
- Encodes specified op-code.
-
-
-
- Encodes argument store instruction.
- Index of the argument.
-
- is negative.
-
-
- Encodes local variable store instruction.
- Index of the local variable slot.
-
- is negative.
-
-
- Encodes a token.
-
-
-
- Encodes a token.
-
-
-
- Underlying builder where encoded instructions are written to.
-
-
- Builder tracking labels, branches and exception handlers.
-
-
- Offset of the next encoded instruction.
-
-
-
-
-
-
- Indicates whether the current object is equal to another object of the same type.
- An object to compare with this object.
-
- if the current object is equal to the parameter; otherwise, .
-
-
-
-
-
-
-
-
-
-
-
- 1-based id identifying the label within the context of a .
-
-
-
- Provides methods for encoding literals.
-
-
- Creates a new instance of the class with the specified blob builder.
-
-
- Returns the encoder used to encode the literal value.
- The encoder of the literal value.
-
-
- Encodes the type and the value of a literal using the specified delegates.
- A delegate used to encode the type of the literal. Called first by this method.
- A delegate used to encode the value of the literal. Called second by this method.
-
- or is .
-
-
- Returns a pair of encoders that must be used to encode the type and value of a literal in the order they appear in the parameter list.
- When this method returns, a custom attribute element type encoder used to encode the type of the literal.
- When this method returns, a scalar encoded used to encode the value of the literal.
-
-
- Encodes the type and the items of a vector literal using the specified delegates.
- A delegate used to encode the type of the vector. Called first by this method.
- A delegate used to encode the items of the vector. Called second by this method.
-
- or is .
-
-
- Returns a pair of encoders that must be used to encode the type and the items of a vector literal in the order they appear in the parameter list.
- When this method returns, a custom attribute array type encoder used to encode the type of the vector.
- When this method returns, a vector encoder used to encode the items of the vector.
-
-
- Gets a vector encoder used to encode the items of a vector.
- A vector encoder used to encode the items of a vector.
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- Calculates the handle of the entity within the metadata generation it is defined in, given a handle of an entity in an aggregate metadata.
- Handle of an entity in an aggregate metadata.
- The generation the entity is defined in.
- Handle of the entity within the metadata .
-
-
- The MetadataBuilder class reads and writes metadata for an assembly in a highly performant manner. It is designed for use by compilers and other assembly generation tools.
-
-
- Creates a builder for metadata tables and heaps.
- The start offset of the User String heap. The cumulative size of User String heaps of all previous EnC generations should be 0 unless the metadata is EnC delta metadata.
- The start offset of the String heap. The cumulative size of String heaps of all previous EnC generations should be 0 unless the metadata is EnC delta metadata.
- The start offset of the Blob heap. The cumulative size of Blob heaps of all previous EnC generations should be 0 unless the metadata is EnC delta metadata.
- The start offset of the Guid heap. The cumulative size of Guid heaps of all previous EnC generations should be 0 unless the metadata is EnC delta metadata.
- Offset is too big.
- Offset is negative.
-
- is not a multiple of size of GUID.
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- Adds a default value for a parameter, field or property.
- The parent entity handle, which can be one of the following: , , or .
- The constant value.
-
- doesn't have the expected handle kind.
- A handle to the added constant.
-
-
- Adds a custom attribute.
- An entity to attach the custom attribute to: a , , , , , , , , , , , , , , , , , , , , , or a .
- A custom attribute constructor: a or .
- A custom attribute value blob.
-
- doesn't have the expected handle kind.
- A handle to the added custom attribute.
-
-
- Adds custom debug information.
- An entity to attach the debug information to: a , , , , , , , , , , , , , , , , , , , , , , , , , , or a .
- The information kind. Determines the structure of the blob.
- The custom debug information blob.
-
- doesn't have the expected handle kind.
- A handle to the added custom debug information.
-
-
- Adds a declarative security attribute to a type, method, or assembly.
- The parent entity handle, which can be one of the following: a , , or a .
- A declarative security action.
- The permission set blob.
-
- doesn't have the expected handle kind.
- A handle to the added declarative security attribute.
-
-
- Adds document debug information.
- The document name blob.
- THe GUID of the hash algorithm used to calculate the value of .
- The hash of the document content.
- The GUID of the language.
- A handle to the added document.
-
-
-
-
-
-
-
-
-
- Adds an event definition.
- The event attributes.
- The event name.
- The type of the event: a , , or .
-
- doesn't have the expected handle kind.
- A handle to the added event definition.
-
-
-
-
-
-
- Adds an exported type.
- The type attributes.
- The type namespace.
- The type name.
- The implementation entity handle, which can be one of the following: an , , or .
- The type definition ID.
-
- doesn't have the expected handle kind.
- A handle to the added exported type.
-
-
- Adds a field definition.
- The field attributes.
- The field name.
- The field signature. Use to construct the blob.
- A handle to the added field definition.
-
-
- Defines a field layout of a field definition.
- The field definition handle.
- The byte offset of the field within the declaring type instance.
-
-
- Adds a mapping from a field to its initial value stored in the PE image.
- The field definition handle.
- The offset within the block in the PE image that stores initial values of mapped fields (usually in the .text section).
-
- is negative.
-
-
- Adds a generic parameter definition.
- The parent entity handle, which can be either a or .
- The generic parameter attributes.
- The parameter name.
- The zero-based parameter index.
-
- doesn't have the expected handle kind.
-
- is greater than UInt16.MaxValue.
- A handle to the added generic parameter.
-
-
- Adds a type constraint to a generic parameter.
- The generic parameter to constrain.
- The type constraint, which can be one of the following: a , or a .
-
- doesn't have the expected handle kind.
- A handle to the added generic parameter constraint.
-
-
- Adds local scope debug information.
- The parent scope handle.
- The import scope handle.
- A handle to the added import scope.
-
-
- Adds an interface implementation to a type.
- The type implementing the interface.
- The interface being implemented, which can be one of the following: , , or .
-
- doesn't have the expected handle kind.
- A handle to the added interface implementation.
-
-
- Adds local constant debug information.
- The name of the variable.
- The LocalConstantSig blob.
- A handle to the added local constant.
-
-
- Adds local scope debug information.
- The containing method.
- The handle of the associated import scope.
- If the scope declares variables, set this to the handle of the first one. Otherwise, set this to the handle of the first variable declared by the next scope definition. If no scope defines any variables, .
- If the scope declares constants, set this the handle of the first one. Otherwise, set this to the handle of the first constant declared by the next scope definition. If no scope defines any constants, .
- The offset of the first instruction covered by the scope.
- The length (in bytes) of the scope.
- A handle to the added local scope.
-
-
- Adds local variable debug information.
- The local variable attributes.
- The zero-base index of the local variable in the local signature.
- The name of the variable.
-
- is greater than UInt16.MaxValue.
- A handle to the added local variable.
-
-
- Adds a manifest resource.
- The manifest resource attributes.
- The name of the manifest resource.
- The implementation entity handle, which can be one of the following: , , or .
- Specifies the byte offset within the referenced file at which this resource record begins.
-
- doesn't have the expected handle kind.
- A handle to the added manifest resource.
-
-
- Adds marshalling information to a field or a parameter.
- The parent entity handle, which can be one of the following: or .
- The descriptor blob.
-
- doesn't have the expected handle kind.
-
-
- Adds a MemberRef table row.
- The containing entity, which can be one of the following: , , , , or .
- The member name.
- The member signature.
-
- doesn't have the expected handle kind.
- A handle to the added member reference.
-
-
- Adds method debug information.
- The handle of a single document containing all sequence points of the method, or if the method doesn't have sequence points or spans multiple documents.
- The sequence Points blob, or if the method doesn't have sequence points.
- A handle to the added method debug information.
-
-
- Adds a method definition.
- The method attributes.
- The method implementation attributes.
- The method name.
- The method signature.
- Offset within the block in the PE image that stores method bodies (the IL stream), or -1 if the method doesn't have a body.
- If the method declares parameters in the Params table, set this to the handle of the first one. Otherwise, set this to the handle of the first parameter declared by the next method definition. If no parameters are declared in the module, .
-
- is less than -1.
- A handle to the added method definition.
-
-
- Defines an implementation for a method declaration within a type.
- The type definition.
- The method body entity handle, which can be one of the following: or .
- The method declaration entity handle, which can be one of the following: or .
-
- or doesn't have the expected handle kind.
- A handle to the added method implementation.
-
-
- Adds import information to a method definition.
- The method definition handle.
- The method import attributes.
- The unmanaged method name.
- The module containing the unmanaged method.
-
-
- Associates a method (a getter, a setter, an adder, etc.) with a property or an event.
- The association entity handle, which can be one of the following: or .
- The method semantics attributes.
- The method definition.
-
- doesn't have the expected handle kind.
-
-
- Adds a method specification (an instantiation).
- The generic method entity handle, which can be one of the following: or .
- The instantiation blob encoding the generic arguments of the method.
-
- doesn't have the expected handle kind.
- A handle to the added method specification.
-
-
-
-
-
-
-
-
-
-
-
-
- Defines a nesting relationship to specified type definitions.
- The nested type definition handle.
- The enclosing type definition handle.
-
-
- Adds a parameter definition.
- The parameter attributes.
- Optional. The parameter name.
- The sequence number of the parameter. A value of 0 refers to the owner method's return type; its parameters are then numbered from 1 onward.
-
- is greater than UInt16.MaxValue.
- A handle to the added parameter.
-
-
- Adds a property definition.
- The property attributes.
- The property name.
- The signature of the property.
- A handle to the added property definition.
-
-
-
-
-
-
-
-
-
- Adds state machine method debug information.
- The handle of the method of the state machine (the compiler-generated method).
- The handle of the kickoff method (the user defined iterator/async method).
-
-
- Adds a type definition.
- The type attributes.
- The type namespace.
- The type name.
- The base type entity handle, which can be one of the following: , , , or .
- If the type declares fields, set this to the handle of the first one. Otherwise, set this to the handle of the first field declared by the next type definition. If no type defines any fields in the module, .
- If the type declares methods, the handle of the first one. Otherwise, the handle of the first method declared by the next type definition. If no type defines any methods in the module, .
-
- doesn't have the expected handle kind.
- A handle to the added type definition.
-
-
- Defines a type layout of a type definition.
- The type definition.
- Specifies that fields should be placed within the type instance at byte addresses which are a multiple of , or at natural alignment for that field type, whichever is smaller. Its value should be one of the following: 0, 1, 2, 4, 8, 16, 32, 64, or 128. A value of zero indicates that the packing size used should match the default for the current platform.
- Indicates a minimum size of the type instance and is intended to allow for padding. The amount of memory allocated is the maximum of the size calculated from the layout and . Note that if this directive applies to a value type, then the size will be less than 1 MB.
-
-
- Adds a type reference.
- The entity declaring the target type, which can be one of the following: , , , , or .
- The type reference namespace.
- The type reference name.
-
- doesn't have the expected handle kind.
- A handle to the added type reference.
-
-
-
-
-
- Adds the specified blob to the Blob heap, if it's not there already.
- The array containing the blob.
-
- is .
- A handle to the added or existing blob.
-
-
- Adds the specified blob from a byte array to the Blob heap, if it's not there already.
- The array containing the blob.
-
- is .
- A handle to the added or existing blob.
-
-
- Adds the specified blob from an immutable byte array to the Blob heap, if it's not there already.
- The blob builder instance containing the blob.
-
- is .
- A handle to the added or existing blob.
-
-
- Encodes a string using UTF16 encoding to a blob and adds it to the Blob heap, if it's not there already.
- The string to add.
-
- is .
- A handle to the added or existing blob.
-
-
- Encodes a string using UTF8 encoding to a blob and adds it to the Blob heap, if it's not there already.
- The value to add.
-
- to encode the unpaired surrogates as specified; to replace them with the U+FFFD character.
-
- is .
- A handle to the added or existing blob.
-
-
- Encodes a constant value to a blob and adds it to the Blob heap, if it's not there already. Uses UTF16 to encode string constants.
- The constant value to add.
- A handle to the added or existing blob.
-
-
- Encodes a debug document name and adds it to the Blob heap, if it's not there already.
- The document name to add.
-
- is .
- A handle to the added or existing document name blob.
-
-
- Adds the specified Guid to the Guid heap, if it's not there already.
- The Guid to add.
- A handle to the added or existing Guid.
-
-
- Adds the specified string to the string heap, if it's not there already.
- The string to add.
-
- is .
- A handle to the added or existing string.
-
-
- Adds the specified string to the user string heap, if it's not there already.
- The string to add.
- The remaining space on the heap is too small to fit the string.
-
- is .
- A handle to the added or existing string. This value may be used in .
-
-
- Returns the current number of items in the specified table.
- The table index.
-
- is not a valid table index.
- The number of items in the table.
-
-
- Returns the current number of items in each table.
- An array of size , with each item filled with the current row count of the corresponding table.
-
-
- Reserves space on the Guid heap for a GUID.
- The remaining space on the heap is too small to fit the string.
- A handle to the reserved Guid and a representing the GUID blob as stored on the heap.
-
-
- Reserves space on the user string heap for a string of the specified length.
- The number of characters to reserve.
- The remaining space on the heap is too small to fit the string.
-
- is negative.
- A handle to the reserved user string and a representing the entire User String blob (including its length and terminal character). The handle may be used in .
- Use to fill in the blob content.
-
-
- Sets the capacity of the specified heap.
- The heap index.
- The number of bytes.
-
- is not a valid heap index.
-
--or-
-
- is negative.
-
-
- Sets the capacity of the specified table.
- The table index.
- The number of rows in the table.
-
- is not a valid table index.
-
--or-
-
- is negative.
-
-
- Provides extension methods for working with certain raw elements of the ECMA-335 metadata tables and heaps.
-
-
- Enumerates entries of EnC log.
-
-
- is .
-
-
- Enumerates entries of EnC map.
-
-
- is .
-
-
- Returns the offset from the start of metadata to the specified heap.
-
-
-
- is .
-
- is not a valid heap index.
-
-
- Returns the size of the specified heap.
-
-
-
- is .
-
- is not a valid heap index.
-
-
- Returns the handle to the that follows the given one in the heap or a nil handle if it is the last one.
-
-
-
- is .
-
-
- Returns the a handle to the string that follows the given one in the string heap, or a nil handle if it is the last one.
-
-
-
- is .
-
-
- Returns the a handle to the UserString that follows the given one in the UserString heap or a nil handle if it is the last one.
-
-
-
- is .
-
-
- Returns the offset from the start of metadata to the specified table.
-
-
-
- is .
-
- is not a valid table index.
-
-
- Returns the number of rows in the specified table.
-
-
-
- is .
-
- is not a valid table index.
-
-
- Returns the size of a row in the specified table.
-
-
-
- is .
-
- is not a valid table index.
-
-
- Enumerate types that define one or more events.
-
- The resulting sequence corresponds exactly to entries in EventMap table, i.e. n-th returned is stored in n-th row of EventMap.
-
-
- Enumerate types that define one or more properties.
-
- The resulting sequence corresponds exactly to entries in the property map table, that is, the n-th returned is stored in n-th row of the property map.
-
-
- Given a type handle and a raw type kind found in a signature blob determines whether the target type is a value type or a reference type.
-
-
-
-
-
- Builder of a Metadata Root to be embedded in a Portable Executable image.
-
-
- Creates a builder of a metadata root.
- Builder populated with metadata entities stored in tables and values stored in heaps. The entities and values will be enumerated when serializing the metadata root.
- The version string written to the metadata header. The default value is "v4.0.30319".
-
- to suppress basic validation of metadata tables during serialization; otherwise, .
-
- is .
-
- is too long (the number of bytes when UTF8-encoded must be less than 255).
-
-
- Serializes metadata root content into the given .
- Builder to write to.
- The relative virtual address of the start of the method body stream. Used to calculate the final value of RVA fields of MethodDef table.
- The relative virtual address of the start of the field init data stream. Used to calculate the final value of RVA fields of FieldRVA table.
-
- is .
-
- or is negative.
- A metadata table is not ordered as required by the specification and is .
-
-
- The metadata version.
- A string that represents the metadata version.
-
-
- Returns sizes of various metadata structures.
-
-
- Determines if basic validation of metadata tables should be suppressed. The validation verifies that entries in the tables were added in order required by the ECMA specification. It does not enforce all specification requirements on metadata tables.
-
- to suppress basic validation of metadata tables; otherwise, .
-
-
- Provides information on sizes of various metadata structures.
-
-
- Returns aligned size of the specified heap.
-
-
-
- External table row count.
-
-
- Exact (unaligned) heap sizes.
-
-
- Table row counts.
-
-
-
- Maximum number of tables that can be present in Ecma335 metadata.
-
-
- Maximum number of tables that can be present in Ecma335 metadata.
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- Creates an entity handle from a token value.
-
-
- is not a valid metadata entity token.
-
-
- Creates an from a token value.
-
-
-
- is not a valid table index.
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- Gets the offset of metadata heap data that corresponds to the specified .
-
- Zero based offset, or -1 if can only be interpreted in a context of a specific or .
-
-
- Gets the offset of metadata heap data that corresponds to the specified .
-
- 1-based index into the #Guid heap. Unlike other heaps, which are essentially byte arrays, the #Guid heap is an array of 16-byte GUIDs.
-
-
- Gets the offset of metadata heap data that corresponds to the specified .
-
- An offset in the corresponding heap, or -1 if can only be interpreted in a context of a specific or .
-
-
- Gets the offset of metadata heap data that corresponds to the specified in the context of .
-
-
- The operation is not supported for the specified .
- The is invalid.
- Zero based offset, or -1 if isn't a metadata heap handle.
-
-
- Gets the offset of metadata heap data that corresponds to the specified .
-
- Zero-based offset, or -1 if can only be interpreted in a context of a specific or .
-
-
- Gets the offset of metadata heap data that corresponds to the specified .
-
- Zero-based offset.
-
-
- Gets the row number of a metadata table entry that corresponds to the specified .
-
- One based row number, or -1 if can only be interpreted in a context of a specific .
- See .
-
-
- Gets the row number of a metadata table entry that corresponds to the specified in the context of .
-
-
- The is not a valid metadata table handle.
- One based row number.
-
-
- Gets the metadata token of the specified .
-
- Metadata token, or 0 if can only be interpreted in a context of a specific .
-
-
- Gets the metadata token of the specified .
-
- Handle represents a metadata entity that doesn't have a token.
- A token can only be retrieved for a metadata table handle or a heap handle of type .
- Metadata token, or 0 if can only be interpreted in a context of a specific .
-
-
- Gets the metadata token of the specified in the context of .
-
-
- The operation is not supported for the specified .
- Metadata token.
-
-
- Gets the metadata token of the specified in the context of .
-
-
- Handle represents a metadata entity that doesn't have a token.
- A token can only be retrieved for a metadata table handle or a heap handle of type .
- The operation is not supported for the specified .
- Metadata token.
-
-
-
-
-
- Creates a handle from a token value.
-
-
- is not a valid metadata token.
- It must encode a metadata table entity or an offset in the heap.
-
-
- Creates an from a token value.
-
-
-
- is not a valid table index.
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- Gets the of the heap corresponding to the specified .
- Handle type.
- Heap index.
-
- if the handle type corresponds to an Ecma335 heap; otherwise.
-
-
- Gets the of the table corresponding to the specified .
- Handle type.
- Table index.
-
- if the handle type corresponds to an Ecma335 or Portable PDB table; otherwise.
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- Defines method body attributes.
-
-
- Initializes any locals the method defines to zero and dynamically allocates local memory.
-
-
- Performs no local memory initialization.
-
-
- Provides an encoder for a method body stream.
-
-
-
-
-
- Encodes a method body and adds it to the method body stream, using the provided code size, maximum stack size, number of exception regions, local variables' signature handle, method body attributes and allowing to indicate whether the exception regions should be encoded in small format or not.
- The number of bytes to be reserved for instructions.
- The maximum stack size.
- The number of exception regions.
-
- if the exception regions should be encoded in small format; otherwise.
- The local variables' signature handle.
- The method body attributes.
-
- , , or is out of the allowed range.
- The offset of the encoded body within the method body stream.
-
-
- Encodes a method body and adds it to the method body stream, using the provided code size, maximum stack size, number of exception regions, local variables' signature handle, method body attributes, allowing to indicate whether the exception regions should be encoded in small format or not, and allowing to indicate whether the method should allocate from the dynamic local memory pool or not.
- The number of bytes to be reserved for instructions.
- The maximum stack size.
- The number of exception regions.
-
- if the exception regions should be encoded in small format; otherwise.
- The local variables' signature handle.
- The method body attributes.
-
- if the method allocates from the dynamic local memory pool (the instruction); otherwise.
-
- , , or is out of the allowed range.
- The offset of the encoded body within the method body stream.
-
-
- Encodes a method body and adds it to the method body stream.
- The instruction encoder.
- The maximum stack size.
- The local variables' signature handle.
- The method body attributes.
-
- has default value.
-
- is out of range [0, UInt16.MaxValue].
- A label targeted by a branch in the instruction stream has not been marked, or the distance between a branch instruction and the target label doesn't fit the size of the instruction operand.
- The offset of the encoded body within the method body stream.
-
-
- Encodes a method body and adds it to the method body stream, using the provided instruction encoder, maximum stack size, local variables' signature handle, method body attributes, and allowing to indicate whether the method should allocate from the dynamic local memory pool or not.
- The instruction encoder.
- The maximum stack size.
- The local variables' signature handle.
- The method body attributes.
-
- if the method allocates from the dynamic local memory pool (the IL contains the instruction); otherwise.
-
- has default value.
-
- is out of range [0, UInt16.MaxValue].
- A label targeted by a branch in the instruction stream has not been marked, or the distance between a branch instruction and the target label doesn't fit the size of the instruction operand.
- The offset of the encoded body within the method body stream.
-
-
-
- Describes a method body. This class is meant to used along with the class.
-
-
- Gets an encoder object that can be used to encode exception regions to the method body.
- An exception region encoder instance.
-
-
- Gets a blob reserved for instructions.
- A blob reserved for instructions.
-
-
- Gets the offset of the encoded method body in the method body stream.
- The offset of the encoded method body in the method body stream.
-
-
- Provides an encoder for method signatures.
-
-
-
-
-
-
- Encodes the provided return type and parameters.
- The number of parameters.
- The method that is called first to encode the return type.
- The method that is called second to encode the parameters.
-
- or is .
-
-
- Encodes the provided return type and parameters, which must be used in the order they appear in the parameter list.
- The number of parameters.
- The method that is called first to encode the return types.
- The method that is called second to encode the parameters.
-
-
-
-
-
- Initializes a new instance of the structure.
- A builder for encoding the named argument.
-
-
- Encodes a named argument (a field or property).
-
- to encode a field, to encode a property.
- The method to call first to encode the type of the argument.
- The method to call second to encode the name of the field or property.
- The method to call third to encode the literal value of the argument.
-
- , or is .
-
-
- Encodes a named argument (a field or property) and returns three encoders that must be used in the order they appear in the parameter list.
-
- to encode a field, to encode a property.
- The method to call first to encode the type of the argument.
- The method to call second to encode the name of the field or property.
- The method to call third to encode the literal value of the argument.
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- Represents the builder of a Portable PDB image.
-
-
- Creates a builder of a Portable PDB image.
- A builder populated with debug metadata entities stored in tables and values stored in heaps. The entities and values are enumerated when serializing the Portable PDB image.
- The row counts of all tables that the associated type system metadata contain. Each slot in the array corresponds to a table (). The length of the array must be equal .
- An entry point method definition handle.
- A function that calculates the ID of content represented as a sequence of blobs. If not specified, a default function that ignores the content and returns a content ID based on the current time is used (). You must specify a deterministic function to produce a deterministic Portable PDB image.
-
- or is .
-
-
- Serializes portable PDB content into the given .
- The builder to write to.
-
- is .
- The ID of the serialized content.
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- Encodes a constant literal.
- A constant of type , , , , , , , , , , , (encoded as a two-byte Unicode character), (encoded as SerString), or (encoded as the underlying integer value).
- Unexpected constant type.
-
-
- Encodes a literal of type .
-
-
- Encodes a literal of type (which can possibly be ).
- The name of the type, or .
-
- is empty.
-
-
-
- Decodes signature blobs.
-
-
-
-
- Creates a new .
- The provider used to obtain type symbols as the signature is decoded.
- The metadata reader from which the signature was obtained. It may be if the given provider allows it.
- Additional context needed to resolve generic parameters.
-
-
- Decodes a field signature blob and advances the reader past the signature.
- The blob reader positioned at a field signature.
- The decoded field type.
-
-
- Decodes a local variable signature blob and advances the reader past the signature.
- The blob reader positioned at a local variable signature.
- The local variable signature is invalid.
- The local variable types.
-
-
- Decodes a method (definition, reference, or standalone) or a property signature blob.
- A blob reader positioned at a method signature.
- The method signature is invalid.
- The decoded method signature.
-
-
- Decodes a method specification signature blob and advances the reader past the signature.
- A blob reader positioned at a valid method specification signature.
- The types used to instantiate a generic method via the method specification.
-
-
- Decodes a type embedded in a signature and advances the reader past the type.
- The blob reader positioned at the leading .
-
- to allow a to follow a (CLASS | VALUETYPE) in the signature; otherwise.
- The reader was not positioned at a valid signature type.
- The decoded type.
-
-
-
-
-
-
- Encodes an array type.
- Called first, to encode the type of the element.
- Called second, to encode the shape of the array.
-
- or is .
-
-
- Encodes an array type. Returns a pair of encoders that must be used in the order they appear in the parameter list.
- Use first, to encode the type of the element.
- Use second, to encode the shape of the array.
-
-
-
-
-
- Starts a signature of a type with custom modifiers.
-
-
-
- Starts a function pointer signature.
- Calling convention.
- Function pointer attributes.
- Generic parameter count.
-
- is invalid.
-
- is not in range [0, 0xffff].
-
-
- Starts a generic instantiation signature.
-
- or .
- Generic argument count.
-
- to mark the type as value type, to mark it as a reference type in the signature.
-
- doesn't have the expected handle kind.
-
- is not in range [1, 0xffff].
-
-
- Encodes a reference to type parameter of a containing generic method.
- Parameter index.
-
- is not in range [0, 0xffff].
-
-
- Encodes a reference to type parameter of a containing generic type.
- Parameter index.
-
- is not in range [0, 0xffff].
-
-
-
-
-
-
-
- Starts pointer signature.
-
-
- Writes primitive type code.
- Any primitive type code except for and .
-
- is not valid in this context.
-
-
-
-
-
- Starts SZ array (vector) signature.
-
-
- Encodes a reference to a type.
-
- or .
-
- to mark the type as value type, to mark it as a reference type in the signature.
-
- doesn't have the expected handle kind.
-
-
-
-
-
-
- Encodes a void pointer (void*).
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- Represents a metadata entity (such as a type reference, type definition, type specification, method definition, or custom attribute).
-
-
-
-
- Returns a value that indicates whether the current instance and the specified object are equal.
- The object to compare with the current instance.
-
- if is an and is equal to the current instance; otherwise, .
-
-
- Returns a value that indicates whether the current instance and the specified are equal.
- The value to compare with the current instance.
-
- if the current instance and are equal; otherwise, .
-
-
- Returns the hash code for this instance.
- The hash code for this instance.
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- Indicates whether the current object is equal to another object of the same type.
- An object to compare with this object.
-
- if the current object is equal to the parameter; otherwise, .
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- Returns an enumerator that iterates through the collection.
- An enumerator that can be used to iterate through the collection.
-
-
- Returns an enumerator that iterates through a collection.
- An object that can be used to iterate through the collection.
-
-
- Gets the number of elements in the collection.
- The number of elements in the collection.
-
-
-
- Advances the enumerator to the next element of the collection.
-
- if the enumerator was successfully advanced to the next element; if the enumerator has passed the end of the collection.
-
-
- Sets the enumerator to its initial position, which is before the first element in the collection.
-
-
- Performs application-defined tasks associated with freeing, releasing, or resetting unmanaged resources.
-
-
- Gets the element in the collection at the current position of the enumerator.
- The element in the collection at the current position of the enumerator.
-
-
- Gets the element in the collection at the current position of the enumerator.
- The element in the collection at the current position of the enumerator.
-
-
-
- Gets a TypeRef, TypeDef, or TypeSpec handle if the region represents a catch, or a nil token otherwise (()).
-
-
- Gets the IL offset of the start of the filter block, or -1 if the region is not a filter.
-
-
- Gets the length in bytes of the exception handler.
-
-
- Gets the starting IL offset of the exception handler.
-
-
-
- Gets the length in bytes of the try block.
-
-
- Gets the starting IL offset of the try block.
-
-
-
-
-
-
-
-
-
-
- Gets a handle to resolve the implementation of the target type.
-
-
-
-
- representing another module in the assembly.
-
-
-
- representing another assembly if is .
-
-
-
- representing the declaring exported type in which this was is nested.
-
-
-
-
-
-
- Gets the name of the target type, or if the type is nested or defined in a root namespace.
- A struct instance.
-
-
- Gets the full name of the namespace that contains the target type, or if the type is nested or defined in a root namespace.
-
-
- Gets the definition handle of the namespace where the target type is defined, or if the type is nested or defined in a root namespace.
-
-
-
-
-
-
- Indicates whether the current object is equal to another object of the same type.
- An object to compare with this object.
-
- if the current object is equal to the parameter; otherwise, .
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- Represents a collection of instances.
-
-
-
- Returns an enumerator that iterates through the collection.
- An enumerator that can be used to iterate through the collection.
-
-
- Returns an enumerator that iterates through a collection.
- An object that can be used to iterate through the collection.
-
-
- Gets the number of elements in the collection.
- The number of elements in the collection.
-
-
-
- Advances the enumerator to the next element of the collection.
-
- if the enumerator was successfully advanced to the next element; if the enumerator has passed the end of the collection.
-
-
- Sets the enumerator to its initial position, which is before the first element in the collection.
-
-
- Performs application-defined tasks associated with freeing, releasing, or resetting unmanaged resources.
-
-
- Gets the element in the collection at the current position of the enumerator.
- The element in the collection at the current position of the enumerator.
-
-
- Gets the element in the collection at the current position of the enumerator.
- The element in the collection at the current position of the enumerator.
-
-
-
-
-
-
-
-
-
-
-
-
-
- Returns the field layout offset, or -1 if it is not available.
- The field definition offset, or -1 if it is not available.
-
-
-
-
-
-
-
-
-
-
- Indicates whether the current object is equal to another object of the same type.
- An object to compare with this object.
-
- if the current object is equal to the parameter; otherwise, .
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- Returns an enumerator that iterates through the collection.
- An enumerator that can be used to iterate through the collection.
-
-
- Returns an enumerator that iterates through a collection.
- An object that can be used to iterate through the collection.
-
-
- Gets the number of elements in the collection.
- The number of elements in the collection.
-
-
-
- Advances the enumerator to the next element of the collection.
-
- if the enumerator was successfully advanced to the next element; if the enumerator has passed the end of the collection.
-
-
- Sets the enumerator to its initial position, which is before the first element in the collection.
-
-
- Performs application-defined tasks associated with freeing, releasing, or resetting unmanaged resources.
-
-
- Gets the element in the collection at the current position of the enumerator.
- The element in the collection at the current position of the enumerator.
-
-
- Gets the element in the collection at the current position of the enumerator.
- The element in the collection at the current position of the enumerator.
-
-
-
-
-
- Gets the attributes specifying variance and constraints.
-
-
- Gets the zero-based index of the parameter within the declaring generic type or method declaration.
-
-
- Gets the name of the generic parameter.
-
-
- Gets a or that represents the parent of this generic parameter.
-
-
-
-
- Gets the constrained .
-
-
- Gets a handle (, , or )
- specifying from which type this generic parameter is constrained to derive,
- or which interface this generic parameter is constrained to implement.
- An instance.
-
-
-
-
-
-
- Indicates whether the current object is equal to another object of the same type.
- An object to compare with this object.
-
- if the current object is equal to the parameter; otherwise, .
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- Represents a collection of constraints of a generic type parameter.
-
-
-
- Returns an enumerator that iterates through the collection.
- An enumerator that can be used to iterate through the collection.
-
-
- Returns an enumerator that iterates through a collection.
- An object that can be used to iterate through the collection.
-
-
- Gets the number of elements in the collection.
- The number of elements in the collection.
-
-
- Gets the element at the specified index in the read-only list.
- The zero-based index of the element to get.
- The element at the specified index in the read-only list.
-
-
-
- Advances the enumerator to the next element of the collection.
-
- if the enumerator was successfully advanced to the next element; if the enumerator has passed the end of the collection.
-
-
- Sets the enumerator to its initial position, which is before the first element in the collection.
-
-
- Performs application-defined tasks associated with freeing, releasing, or resetting unmanaged resources.
-
-
- Gets the element in the collection at the current position of the enumerator.
- The element in the collection at the current position of the enumerator.
-
-
- Gets the element in the collection at the current position of the enumerator.
- The element in the collection at the current position of the enumerator.
-
-
-
-
-
-
- Indicates whether the current object is equal to another object of the same type.
- An object to compare with this object.
-
- if the current object is equal to the parameter; otherwise, .
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- Represents a collection of generic type parameters of a method or type.
-
-
-
- Returns an enumerator that iterates through the collection.
- An enumerator that can be used to iterate through the collection.
-
-
- Returns an enumerator that iterates through a collection.
- An object that can be used to iterate through the collection.
-
-
- Gets the number of elements in the collection.
- The number of elements in the collection.
-
-
- Gets the element at the specified index in the read-only list.
- The zero-based index of the element to get.
- The element at the specified index in the read-only list.
-
-
-
- Advances the enumerator to the next element of the collection.
-
- if the enumerator was successfully advanced to the next element; if the enumerator has passed the end of the collection.
-
-
- Sets the enumerator to its initial position, which is before the first element in the collection.
-
-
- Performs application-defined tasks associated with freeing, releasing, or resetting unmanaged resources.
-
-
- Gets the element in the collection at the current position of the enumerator.
- The element in the collection at the current position of the enumerator.
-
-
- Gets the element in the collection at the current position of the enumerator.
- The element in the collection at the current position of the enumerator.
-
-
-
-
-
-
- Indicates whether the current object is equal to another object of the same type.
- An object to compare with this object.
-
- if the current object is equal to the parameter; otherwise, .
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- Represents any metadata entity (such as a type reference, a type definition, a type specification, a method definition, or a custom attribute) or value (a string, blob, guid, or user string).
-
-
-
-
-
-
-
- Indicates whether the current object is equal to another object of the same type.
- An object to compare with this object.
-
- if the current object is equal to the parameter; otherwise, .
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- Compares two entity handles.
- The first entity handle to compare.
- The second entity handle to compare.
- Zero if the two entity handles are equal, and a non-zero value of they are not.
-
-
- Compares two handles.
- The first handle to compare.
- The second handle to compare.
- Zero if the two handles are equal, and a non-zero value if they are not.
-
-
- Determines whether the specified objects are equal.
- The first object of type to compare.
- The second object of type to compare.
-
- if the specified objects are equal; otherwise, .
-
-
- Determines whether the specified objects are equal.
- The first object of type to compare.
- The second object of type to compare.
-
- if the specified objects are equal; otherwise, .
-
-
- Returns a hash code for the specified object.
- The for which a hash code is to be returned.
- A hash code for the specified object.
-
-
- Returns a hash code for the specified object.
- The for which a hash code is to be returned.
- A hash code for the specified object.
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- Gets the type symbol for a generalized array of the given element type and shape.
- The type of the elements in the array.
- The shape (rank, sizes, and lower bounds) of the array.
-
-
- Gets the type symbol for a managed pointer to the given element type.
-
-
-
- Gets the type symbol for a generic instantiation of the given generic type with the given type arguments.
-
-
-
-
- Gets the type symbol for an unmanaged pointer to the given element type.
-
-
-
-
-
-
- Gets the representation for .
-
-
- Gets the type symbol for the given serialized type name.
- The serialized type name in so-called "reflection notation" format (as understood by the method.)
- The name is malformed.
- A instance.
-
-
- Gets the underlying type of the given enum type symbol.
- An enum type.
- The given type symbol does not represent an enum.
- A type code that indicates the underlying type of the enumeration.
-
-
- Verifies if the given type represents .
- The type to verify.
-
- if the given type is a , otherwise.
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- Calculates the size of the specified branch instruction operand.
- The branch op-code.
- The specified is not a branch op-code.
- 1 if is a short branch, or 4 if it is a long branch.
-
-
- Gets a long form of the specified branch op-code.
- The branch op-code.
- The specified is not a branch op-code.
- The long form of the branch op-code.
-
-
- Gets a short form of the specified branch op-code.
- The branch op-code.
- The specified is not a branch op-code.
- The short form of the branch op-code.
-
-
- Verifies if the specified op-code is a branch to a label.
-
-
- if the specified op-code is a branch to a label, otherwise.
-
-
- The exception that is thrown when an attempt to write metadata exceeds a limit given by the format specification. For example, when the heap size limit is exceeded.
-
-
- Initializes a new instance of the class.
-
-
- Initializes a new instance of the class with serialized data.
- The object that holds the serialized object data.
- The contextual information about the source or destination.
-
-
- Initializes a new instance of the class with a specified error message.
- The error message that explains the reason for this exception.
-
-
- Initializes a new instance of the class with a specified error message and the exception that is the cause of this exception.
- The error message that explains the reason for this exception.
- The exception that is the cause of the current exception, or if no inner exception is specified.
-
-
-
-
-
-
-
-
-
-
- Returns an enumerator that iterates through the collection.
- An enumerator that can be used to iterate through the collection.
-
-
- Returns an enumerator that iterates through a collection.
- An object that can be used to iterate through the collection.
-
-
-
- Advances the enumerator to the next element of the collection.
- Invalid blob format.
-
- if the enumerator was successfully advanced to the next element; if the enumerator has passed the end of the collection.
-
-
- Sets the enumerator to its initial position, which is before the first element in the collection.
-
-
- Performs application-defined tasks associated with freeing, releasing, or resetting unmanaged resources.
-
-
- Gets the element in the collection at the current position of the enumerator.
- The element in the collection at the current position of the enumerator.
-
-
- Gets the element in the collection at the current position of the enumerator.
- The element in the collection at the current position of the enumerator.
-
-
-
-
-
-
-
-
-
-
-
-
- Provides information about the lexical scope within which a group of imports are available. This information is stored in debug metadata.
-
-
-
-
-
-
-
- Returns an enumerator that iterates through the collection.
- An enumerator that can be used to iterate through the collection.
-
-
- Returns an enumerator that iterates through a collection.
- An object that can be used to iterate through the collection.
-
-
- Gets the number of elements in the collection.
- The number of elements in the collection.
-
-
-
- Advances the enumerator to the next element of the collection.
-
- if the enumerator was successfully advanced to the next element; if the enumerator has passed the end of the collection.
-
-
- Sets the enumerator to its initial position, which is before the first element in the collection.
-
-
- Performs application-defined tasks associated with freeing, releasing, or resetting unmanaged resources.
-
-
- Gets the element in the collection at the current position of the enumerator.
- The element in the collection at the current position of the enumerator.
-
-
- Gets the element in the collection at the current position of the enumerator.
- The element in the collection at the current position of the enumerator.
-
-
-
-
-
-
- Indicates whether the current object is equal to another object of the same type.
- An object to compare with this object.
-
- if the current object is equal to the parameter; otherwise, .
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- Gets the interface that is implemented (, , or ).
-
-
-
-
-
-
- Indicates whether the current object is equal to another object of the same type.
- An object to compare with this object.
-
- if the current object is equal to the parameter; otherwise, .
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- Returns an enumerator that iterates through the collection.
- An enumerator that can be used to iterate through the collection.
-
-
- Returns an enumerator that iterates through a collection.
- An object that can be used to iterate through the collection.
-
-
- Gets the number of elements in the collection.
- The number of elements in the collection.
-
-
-
- Advances the enumerator to the next element of the collection.
-
- if the enumerator was successfully advanced to the next element; if the enumerator has passed the end of the collection.
-
-
- Sets the enumerator to its initial position, which is before the first element in the collection.
-
-
- Performs application-defined tasks associated with freeing, releasing, or resetting unmanaged resources.
-
-
- Gets the element in the collection at the current position of the enumerator.
- The element in the collection at the current position of the enumerator.
-
-
- Gets the element in the collection at the current position of the enumerator.
- The element in the collection at the current position of the enumerator.
-
-
-
-
-
-
- Gets the type symbol for the function pointer type of the given method .
-
- The type symbol for the function pointer type.
-
-
- Gets the type symbol for the generic method parameter at the given zero-based .
-
-
- The type symbol for the generic method parameter at .
-
-
- Gets the type symbol for the generic type parameter at the given zero-based .
-
-
- The type symbol for the generic type parameter at the given zero-based .
-
-
- Gets the type symbol for a type with a custom modifier applied.
- The modifier type applied.
- The type symbol of the underlying type without modifiers applied.
-
- if the modifier is required, if it's optional.
- The type symbol.
-
-
- Gets the type symbol for a local variable type that is marked as pinned.
-
- The type symbol for the local variable type.
-
-
- Gets the type symbol for a type specification.
- The metadata reader that was passed to the signature decoder. It may be .
- The context that was passed to the signature decoder.
- The type specification handle.
- The kind of the type, as specified in the signature. To interpret this value, use .
- The type symbol for the type specification.
-
-
-
-
-
- Gets the type symbol for a primitive type.
-
- The type symbol for .
-
-
- Gets the type symbol for a type definition.
- The metadata reader that was passed to the signature decoder. It may be .
- The type definition handle.
- The kind of the type, as specified in the signature. To interpret this value use .
- The type symbol.
-
-
- Gets the type symbol for a type reference.
- The metadata reader that was passed to the signature decoder. It may be .
- The type definition handle.
- The kind of the type as specified in the signature. To interpret this value, use .
- The type symbol.
-
-
-
-
-
- Gets the type symbol for a single-dimensional array of the given element type with a lower bounds of zero.
-
- A instance.
-
-
- Provides information about local constants. This information is stored in debug metadata.
-
-
-
- Gets the constant signature.
- The constant signature.
-
-
-
-
-
-
- Indicates whether the current object is equal to another object of the same type.
- An object to compare with this object.
-
- if the current object is equal to the parameter; otherwise, .
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- Returns an enumerator that iterates through the collection.
- An enumerator that can be used to iterate through the collection.
-
-
- Returns an enumerator that iterates through a collection.
- An object that can be used to iterate through the collection.
-
-
- Gets the number of elements in the collection.
- The number of elements in the collection.
-
-
-
- Advances the enumerator to the next element of the collection.
-
- if the enumerator was successfully advanced to the next element; if the enumerator has passed the end of the collection.
-
-
- Sets the enumerator to its initial position, which is before the first element in the collection.
-
-
- Performs application-defined tasks associated with freeing, releasing, or resetting unmanaged resources.
-
-
- Gets the element in the collection at the current position of the enumerator.
- The element in the collection at the current position of the enumerator.
-
-
- Gets the element in the collection at the current position of the enumerator.
- The element in the collection at the current position of the enumerator.
-
-
- Provides information about the scope of local variables and constants. This information is stored in debug metadata.
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- Indicates whether the current object is equal to another object of the same type.
- An object to compare with this object.
-
- if the current object is equal to the parameter; otherwise, .
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- Returns an enumerator that iterates through the collection.
- An enumerator that can be used to iterate through the collection.
-
-
- Returns an enumerator that iterates through a collection.
- An object that can be used to iterate through the collection.
-
-
- Gets the number of elements in the collection.
- The number of elements in the collection.
-
-
-
- Advances the enumerator to the next element of the collection.
-
- if the enumerator was successfully advanced to the next element; if the enumerator has passed the end of the collection.
-
-
- Sets the enumerator to its initial position, which is before the first element in the collection.
-
-
- Performs application-defined tasks associated with freeing, releasing, or resetting unmanaged resources.
-
-
- Gets the element in the collection at the current position of the enumerator.
- The element in the collection at the current position of the enumerator.
-
-
- Gets the element in the collection at the current position of the enumerator.
- The element in the collection at the current position of the enumerator.
-
-
-
- Advances the enumerator to the next element of the collection.
-
- if the enumerator was successfully advanced to the next element; if the enumerator has passed the end of the collection.
-
-
- Sets the enumerator to its initial position, which is before the first element in the collection.
-
-
- Performs application-defined tasks associated with freeing, releasing, or resetting unmanaged resources.
-
-
- Gets the element in the collection at the current position of the enumerator.
- The element in the collection at the current position of the enumerator.
-
-
- Gets the element in the collection at the current position of the enumerator.
- The element in the collection at the current position of the enumerator.
-
-
- Provides information about local variables. This information is stored in debug metadata.
-
-
-
-
-
-
-
-
-
-
-
-
- Indicates whether the current object is equal to another object of the same type.
- An object to compare with this object.
-
- if the current object is equal to the parameter; otherwise, .
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- Returns an enumerator that iterates through the collection.
- An enumerator that can be used to iterate through the collection.
-
-
- Returns an enumerator that iterates through a collection.
- An object that can be used to iterate through the collection.
-
-
- Gets the number of elements in the collection.
- The number of elements in the collection.
-
-
-
- Advances the enumerator to the next element of the collection.
-
- if the enumerator was successfully advanced to the next element; if the enumerator has passed the end of the collection.
-
-
- Sets the enumerator to its initial position, which is before the first element in the collection.
-
-
- Performs application-defined tasks associated with freeing, releasing, or resetting unmanaged resources.
-
-
- Gets the element in the collection at the current position of the enumerator.
- The element in the collection at the current position of the enumerator.
-
-
- Gets the element in the collection at the current position of the enumerator.
- The element in the collection at the current position of the enumerator.
-
-
-
-
- Gets the manifest resource attributes.
- A bitwise combination of the enumeration values that specify the manifest resource attributes.
-
-
- Gets the implementation entity handle.
- An EntityHandle instance. If the property is , the returned handle will have default values.
-
-
- Gets the resource name.
- The resource name.
-
-
- Gets the byte offset within the referenced file at which this resource record begins.
- The byte offset within the referenced file at which this resource record begins.
-
-
-
-
-
-
- Indicates whether the current object is equal to another object of the same type.
- An object to compare with this object.
-
- if the current object is equal to the parameter; otherwise, .
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- Represents a collection of instances.
-
-
-
- Returns an enumerator that iterates through the collection.
- An enumerator that can be used to iterate through the collection.
-
-
- Returns an enumerator that iterates through a collection.
- An object that can be used to iterate through the collection.
-
-
- Gets the number of elements in the collection.
- The number of elements in the collection.
-
-
-
- Advances the enumerator to the next element of the collection.
-
- if the enumerator was successfully advanced to the next element; if the enumerator has passed the end of the collection.
-
-
- Sets the enumerator to its initial position, which is before the first element in the collection.
-
-
- Performs application-defined tasks associated with freeing, releasing, or resetting unmanaged resources.
-
-
- Gets the element in the collection at the current position of the enumerator.
- The element in the collection at the current position of the enumerator.
-
-
- Gets the element in the collection at the current position of the enumerator.
- The element in the collection at the current position of the enumerator.
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- Determines if the member reference is to a method or field.
- The member reference signature is invalid.
- One of the enumeration values that indicates the kind of member reference.
-
-
-
- Gets the parent entity handle.
- An entity handle instance. If the property is , the returned handle will have default values.
-
-
- Gets a handle to the signature blob.
- A handle to the signature blob.
-
-
-
-
-
-
- Indicates whether the current object is equal to another object of the same type.
- An object to compare with this object.
-
- if the current object is equal to the parameter; otherwise, .
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- Represents a collection of instances.
-
-
-
- Returns an enumerator that iterates through the collection.
- An enumerator that can be used to iterate through the collection.
-
-
- Returns an enumerator that iterates through a collection.
- An object that can be used to iterate through the collection.
-
-
- Gets the number of elements in the collection.
- The number of elements in the collection.
-
-
-
- Advances the enumerator to the next element of the collection.
-
- if the enumerator was successfully advanced to the next element; if the enumerator has passed the end of the collection.
-
-
- Sets the enumerator to its initial position, which is before the first element in the collection.
-
-
- Performs application-defined tasks associated with freeing, releasing, or resetting unmanaged resources.
-
-
- Gets the element in the collection at the current position of the enumerator.
- The element in the collection at the current position of the enumerator.
-
-
- Gets the element in the collection at the current position of the enumerator.
- The element in the collection at the current position of the enumerator.
-
-
- Specifies constants that indicate whether a references a method or field.
-
-
- The references a field.
-
-
- The references a method.
-
-
-
- CLI metadata.
-
-
- Windows metadata generated by managed compilers.
-
-
- Windows metadata.
-
-
- Reads metadata as defined by the ECMA 335 CLI specification.
-
-
- Initializes a new instance of the class from the metadata stored at the given memory location.
- A pointer to the first byte in a block of metadata.
- The number of bytes in the block.
-
-
- Initializes a new instance of the class from the metadata stored at the given memory location.
-
-
-
-
-
- Initializes a new instance of the class from the metadata stored at the given memory location.
-
-
-
-
-
- is not positive.
-
- is .
- The encoding of is not .
- The current platform is big-endian.
- Bad metadata header.
-
-
-
-
-
-
- Gets the for a given file.
- The path to the assembly for which is to be returned.
-
- is .
-
- is invalid.
-
- is not found.
-
- is not a valid assembly.
- An that represents the given .
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- Gets the information decoded from #Pdb stream, or if the stream is not present.
- The information decoded from #Pdb stream, or if the stream is not present.
-
-
-
-
-
-
-
-
- Gets a value that indicates whether the metadata represents an assembly.
-
- if the metadata represents an assembly; otherwise, .
-
-
-
-
-
-
-
- Gets the metadata kind.
- One of the enumeration values that specifies the metadata kind.
-
-
- Gets the length of the underlying data.
- The length of the underlying data.
-
-
- Gets the pointer to the underlying data.
- The pointer to the underlying data.
-
-
- Gets the version string read from metadata header.
- The version string read from metadata header.
-
-
-
-
- Gets the passed to the constructor.
- A bitwise combination of the enumeration values that describes the enum value.
-
-
-
- Gets the comparer used to compare strings stored in metadata.
- The comparer used to compare strings stored in metadata.
-
-
-
-
- Gets the decoder used by the reader to produce string instances from UTF8-encoded byte sequences.
- The decoder used by the reader to produce string instances from UTF8-encoded byte sequences.
-
-
-
- Windows Runtime projections are enabled (on by default).
-
-
- The options that are used when a is obtained via an overload that does not take a argument.
-
-
- All options are disabled.
-
-
- Provides a for metadata stored in an array of bytes, a memory block, or a stream.
-
-
- Disposes all memory allocated by the reader.
-
-
- Creates a metadata provider over an image stored in memory.
- Pointer to the start of the metadata blob.
- The size of the metadata blob.
-
- is .
-
- is negative.
- The new metadata provider.
-
-
- Creates a provider over a byte array.
- Metadata image.
-
- is .
- The new provider.
-
-
- Creates a provider for a stream of the specified size beginning at its current position.
- A instance.
- Options specifying how sections of the image are read from the stream.
- Size of the metadata blob in the stream. If not specified, the metadata blob is assumed to span to the end of the stream.
-
- is .
-
- doesn't support read and seek operations.
- Size is negative or extends past the end of the stream.
- Error reading from the stream (only when is specified).
- The new provider.
-
-
- Creates a portable PDB metadata provider over a blob stored in memory.
- Pointer to the start of the portable PDB blob.
- The size of the portable PDB blob.
-
- is .
-
- is negative.
- The new portable PDB metadata provider.
-
-
- Creates a portable PDB metadata provider over a byte array.
- A portable PDB image.
-
- is .
- The new portable PDB metadata provider .
-
-
- Creates a provider for a stream of the specified size beginning at its current position.
- The stream.
- Options specifying how sections of the image are read from the stream.
- Size of the metadata blob in the stream. If not specified, the metadata blob is assumed to span to the end of the stream.
-
- is .
-
- doesn't support read and seek operations.
- Size is negative or extends past the end of the stream.
- A instance.
-
-
- Gets a from a .
- A bitwise combination of the enumeration values that represent the configuration when reading the metadata.
- The encoding to use.
- The encoding of is not .
- The current platform is big-endian.
- IO error while reading from the underlying stream.
- Provider has been disposed.
- A instance.
-
-
-
- By default, the stream is disposed when is disposed and sections of the PE image are read lazily.
-
-
- Keeps the stream open when the is disposed.
-
-
-
- Reads PDB metadata into memory right away.
- The underlying file may be closed and even deleted after the is constructed. closes the stream automatically by the time the constructor returns unless is specified.
-
-
-
- Provides string comparison helpers to query strings in metadata while avoiding allocation if possible.
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- Provides the with a custom mechanism for decoding byte sequences in metadata that represent text.
-
-
- Initializes a new instance of the class using the given encoding.
- The encoding to use.
-
-
- Obtains strings for byte sequences in metadata. Override this to cache strings if required. Otherwise, it is implemented by forwarding straight to and every call will allocate a new string.
- Pointer to bytes to decode.
- Number of bytes to decode.
- The decoded string.
-
-
- Gets the default decoder used by to decode UTF-8 when no decoder is provided to the constructor.
- The default decoder used by to decode UTF-8.
-
-
- Gets the encoding used by this instance.
- The encoding used by this instance.
-
-
- Represents the method body in ECMA 335 assembly.
-
-
- Creates a new instance of the class using the specified blob reader.
- The blob reader to read the method body.
-
- The method body data in the specified blob reader is invalid.
- A new instance of the class.
-
-
- Gets the IL bytecode of this method body as a byte array.
- A byte array with the IL bytecode of this method body.
-
-
- Gets the IL bytecode of this method body as an immutable array.
- An immutable byte array with the IL bytecode of this method body.
-
-
- Gets a blob reader that reads the IL bytecode of this method body.
- A blob reader that reads the IL bytecode of this method body.
-
-
- Gets the array of exception regions in this method body.
- The array of exception regions.
-
-
- Gets the handle to the local variables signature.
- The handle to the local variables signature.
-
-
- Gets a value that indicates whether local variables in this method are initialized to default values of their types.
-
- if local variables are initialized; otherwise, .
-
-
- Gets the maximum number of items on the evaluation stack for this method.
- The maximum number of items on the evaluation stack.
-
-
- Gets the size of the method body, including the header, IL, and exception regions.
- The size of the method body.
-
-
- Provides debug information associated with a method definition. This information is stored in debug metadata.
-
-
- Returns a collection of sequence points decoded from .
- A collection of sequence points.
-
-
- Returns the kickoff method of the state machine.
- The kickoff method of the state machine, if the method is a MoveNext method of a state machine. Otherwise, it returns a handle whose property is .
-
-
- Gets the handle of the single document containing all sequence points of the method.
- The handle of the single document containing all sequence points of the method, or a handle whose property is if the method doesn't have sequence points or spans multiple documents.
-
-
- Returns a local signature handle.
- A local signature handle, or a handle whose property is if the method doesn't define any local variables.
-
-
- Returns a blob encoding sequence points.
- A blob encoding sequence points, or a handle whose property is if the method doesn't have sequence points.
-
-
-
-
-
-
- Indicates whether the current object is equal to another object of the same type.
- An object to compare with this object.
-
- if the current object is equal to the parameter; otherwise, .
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- Returns a handle to a that corresponds to this handle.
- A method definition handle that corresponds to this handle.
-
-
-
-
-
- Returns an enumerator that iterates through the collection.
- An enumerator that can be used to iterate through the collection.
-
-
- Returns an enumerator that iterates through a collection.
- An object that can be used to iterate through the collection.
-
-
- Gets the number of elements in the collection.
- The number of elements in the collection.
-
-
-
- Advances the enumerator to the next element of the collection.
-
- if the enumerator was successfully advanced to the next element; if the enumerator has passed the end of the collection.
-
-
- Sets the enumerator to its initial position, which is before the first element in the collection.
-
-
- Performs application-defined tasks associated with freeing, releasing, or resetting unmanaged resources.
-
-
- Gets the element in the collection at the current position of the enumerator.
- The element in the collection at the current position of the enumerator.
-
-
- Gets the element in the collection at the current position of the enumerator.
- The element in the collection at the current position of the enumerator.
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- Indicates whether the current object is equal to another object of the same type.
- An object to compare with this object.
-
- if the current object is equal to the parameter; otherwise, .
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- Returns a handle to a that corresponds to this handle.
- A method debug information handle that corresponds to this handle.
-
-
-
-
-
- Returns an enumerator that iterates through the collection.
- An enumerator that can be used to iterate through the collection.
-
-
- Returns an enumerator that iterates through a collection.
- An object that can be used to iterate through the collection.
-
-
- Gets the number of elements in the collection.
- The number of elements in the collection.
-
-
-
- Advances the enumerator to the next element of the collection.
-
- if the enumerator was successfully advanced to the next element; if the enumerator has passed the end of the collection.
-
-
- Sets the enumerator to its initial position, which is before the first element in the collection.
-
-
- Performs application-defined tasks associated with freeing, releasing, or resetting unmanaged resources.
-
-
- Gets the element in the collection at the current position of the enumerator.
- The element in the collection at the current position of the enumerator.
-
-
- Gets the element in the collection at the current position of the enumerator.
- The element in the collection at the current position of the enumerator.
-
-
-
-
-
-
-
-
-
-
-
- Indicates whether the current object is equal to another object of the same type.
- An object to compare with this object.
-
- if the current object is equal to the parameter; otherwise, .
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- Returns an enumerator that iterates through the collection.
- An enumerator that can be used to iterate through the collection.
-
-
- Returns an enumerator that iterates through a collection.
- An object that can be used to iterate through the collection.
-
-
- Gets the number of elements in the collection.
- The number of elements in the collection.
-
-
-
- Advances the enumerator to the next element of the collection.
-
- if the enumerator was successfully advanced to the next element; if the enumerator has passed the end of the collection.
-
-
- Sets the enumerator to its initial position, which is before the first element in the collection.
-
-
- Performs application-defined tasks associated with freeing, releasing, or resetting unmanaged resources.
-
-
- Gets the element in the collection at the current position of the enumerator.
- The element in the collection at the current position of the enumerator.
-
-
- Gets the element in the collection at the current position of the enumerator.
- The element in the collection at the current position of the enumerator.
-
-
-
-
-
-
- Represents a method (definition, reference, or standalone) or property signature. In the case of properties, the signature matches that of a getter with a distinguishing .
- The method type.
-
-
- Initializes a new instance of the structure using the specified header, return type, and parameter information.
- The information in the leading byte of the signature (kind, calling convention, flags).
- The return type of the method.
- The number of required parameters.
- The number of generic type parameters.
- The parameter types.
-
-
- Gets the number of generic type parameters for the method.
- The number of generic type parameters, or 0 for non-generic methods.
-
-
- Gets the information in the leading byte of the signature (kind, calling convention, flags).
- The header signature.
-
-
- Gets the method's parameter types.
- An immutable collection of parameter types.
-
-
- Gets the number of parameters that are required for the method.
- The number of required parameters.
-
-
- Gets the return type of the method.
- The return type.
-
-
-
-
-
-
-
-
-
-
- Gets a or handle specifying which generic method this instance refers to (that is, which generic method it is an instantiation of).
- A or handle specifying which generic method this instance refers to.
-
-
- Gets a handle to the signature blob.
- A handle to the signature blob.
-
-
-
-
-
-
- Indicates whether the current object is equal to another object of the same type.
- An object to compare with this object.
-
- if the current object is equal to the parameter; otherwise, .
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- Indicates whether the current object is equal to another object of the same type.
- An object to compare with this object.
-
- if the current object is equal to the parameter; otherwise, .
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- Indicates whether the current object is equal to another object of the same type.
- An object to compare with this object.
-
- if the current object is equal to the parameter; otherwise, .
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- Gets all exported types that reside directly in a namespace.
- An immutable array of exported type handles.
-
-
- Gets the unqualified name of the namespace definition.
- The unqualified name of the namespace definition.
-
-
- Gets the namespace definitions that are direct children of the current namespace definition.
- An immutable array of namespace definitions that are direct children of the current namespace definition.
-
-
- Gets the parent namespace.
- The parent namespace.
-
-
- Gets all type definitions that reside directly in a namespace.
- An immutable array of type definition handles.
-
-
- Provides a handle to a namespace definition.
-
-
-
-
-
- Indicates whether the current object is equal to another object of the same type.
- An object to compare with this object.
-
- if the current object is equal to the parameter; otherwise, .
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- Indicates whether the current object is equal to another object of the same type.
- An object to compare with this object.
-
- if the current object is equal to the parameter; otherwise, .
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- Contains a collection of parameters of a specified method.
-
-
-
- Returns an enumerator that iterates through the collection.
- An enumerator that can be used to iterate through the collection.
-
-
- Returns an enumerator that iterates through a collection.
- An object that can be used to iterate through the collection.
-
-
- Gets the number of elements in the collection.
- The number of elements in the collection.
-
-
-
- Advances the enumerator to the next element of the collection.
-
- if the enumerator was successfully advanced to the next element; if the enumerator has passed the end of the collection.
-
-
- Sets the enumerator to its initial position, which is before the first element in the collection.
-
-
- Performs application-defined tasks associated with freeing, releasing, or resetting unmanaged resources.
-
-
- Gets the element in the collection at the current position of the enumerator.
- The element in the collection at the current position of the enumerator.
-
-
- Gets the element in the collection at the current position of the enumerator.
- The element in the collection at the current position of the enumerator.
-
-
-
- Gets a from a .
- The current instance.
-
- is .
- The current platform is big-endian.
- IO error while reading from the underlying stream.
- A metadata reader.
-
-
- Gets a metadata reader with the specified metadata reading configuration from a .
- The current instance.
- An enumeration value indicating the metadata reading configuration.
-
- is .
- The current platform is big-endian.
- IO error while reading from the underlying stream.
- A metadata reader with the specified metadata reading configuration.
-
-
- Gets a metadata reader with the specified metadata reading configuration and encoding configuration from a .
- The current instance.
- An enumeration value indicating the metadata reading configuration.
- A metadata string decoder with the encoding configuration.
-
- is .
- The encoding of is not .
- The current platform is big-endian.
- IO error while reading from the underlying stream.
- >A metadata reader with the specified metadata reading configuration and encoding configuration.
-
-
- Returns a body block of a method with the specified Relative Virtual Address (RVA).
- The current instance.
- The Relative Virtual Address (RVA).
-
- is .
- The body is not found in the metadata or is invalid.
- The section where the method is stored is not available.
- IO error occurred while reading from the underlying stream.
- A method block body instance.
-
-
- Specifies constants that define the type codes used to encode types of primitive values in a value blob.
-
-
- A type.
-
-
- An unsigned 1-byte integer type.
-
-
- A type.
-
-
- An 8-byte floating point type.
-
-
- A signed 2-byte integer type.
-
-
- A signed 4-byte integer type.
-
-
- A signed 8-byte integer type.
-
-
- A signed 1-byte integer type.
-
-
- A 4-byte floating point type.
-
-
- A type.
-
-
- An unsigned 2-byte integer type.
-
-
- An unsigned 4-byte integer type.
-
-
- An unsigned 8-byte integer type.
-
-
- Specifies constants that define primitive types found in metadata signatures.
-
-
- A type.
-
-
- A type.
-
-
- A type.
-
-
- A type.
-
-
- An type.
-
-
- An type.
-
-
- An type.
-
-
- An type.
-
-
- An type.
-
-
- An type.
-
-
- A type.
-
-
- A type.
-
-
- A typed reference.
-
-
- A type.
-
-
- A type.
-
-
- A type.
-
-
- A type.
-
-
- A type.
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- Indicates whether the current object is equal to another object of the same type.
- An object to compare with this object.
-
- if the current object is equal to the parameter; otherwise, .
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- Returns an enumerator that iterates through the collection.
- An enumerator that can be used to iterate through the collection.
-
-
- Returns an enumerator that iterates through a collection.
- An object that can be used to iterate through the collection.
-
-
- Gets the number of elements in the collection.
- The number of elements in the collection.
-
-
-
- Advances the enumerator to the next element of the collection.
-
- if the enumerator was successfully advanced to the next element; if the enumerator has passed the end of the collection.
-
-
- Sets the enumerator to its initial position, which is before the first element in the collection.
-
-
- Performs application-defined tasks associated with freeing, releasing, or resetting unmanaged resources.
-
-
- Gets the element in the collection at the current position of the enumerator.
- The element in the collection at the current position of the enumerator.
-
-
- Gets the element in the collection at the current position of the enumerator.
- The element in the collection at the current position of the enumerator.
-
-
- Represents a handle and a corresponding blob on a metadata heap that was reserved for future content update.
-
-
-
- Returns a to be used to update the content.
- A blob writer to be used to update the content.
-
-
-
- Gets the reserved blob handle.
- The reserved bloc handle.
-
-
- Represents a Portable PDB sequence point.
-
-
- Specifies a line number value for a hidden sequence point.
-
-
- Indicates whether the current sequence point is equal to the specified object.
- The object to compare with the current object.
-
- if the current sequence point is equal to the parameter; otherwise, .
-
-
- Indicates whether the current object is equal to another object of the same type.
- An object to compare with this object.
-
- if the current object is equal to the parameter; otherwise, .
-
-
- Gets the hash code of this sequence point.
- The hash code of this sequence point.
-
-
- Gets the source document that contains this sequence point.
- The source document that contains this sequence point.
-
-
- Gets the column number of the last character in this sequence point.
- The column number of the last character in this sequence point.
-
-
- Gets the line number of the last character in this sequence point.
- The line number of the last character in this sequence point.
-
-
- Gets a value that indicates whether this sequence point is hidden.
-
- if this sequence point is hidden; otherwise, .
-
-
- Gets the IL offset of this sequence point from the start of the method body, in bytes.
- The IL offset of this sequence point from the start of the method body, in bytes.
-
-
- Gets the column number of the first character in this sequence point.
- The column number of the first character in this sequence point.
-
-
- Gets the line number of the first character in this sequence point.
- The line number of the first character in this sequence point.
-
-
-
-
- Returns an enumerator that iterates through the collection.
- An enumerator that can be used to iterate through the collection.
-
-
- Returns an enumerator that iterates through a collection.
- An object that can be used to iterate through the collection.
-
-
-
- Advances the enumerator to the next element of the collection.
-
- if the enumerator was successfully advanced to the next element; if the enumerator has passed the end of the collection.
-
-
- Sets the enumerator to its initial position, which is before the first element in the collection.
-
-
- Performs application-defined tasks associated with freeing, releasing, or resetting unmanaged resources.
-
-
- Gets the element in the collection at the current position of the enumerator.
- The element in the collection at the current position of the enumerator.
-
-
- Gets the element in the collection at the current position of the enumerator.
- The element in the collection at the current position of the enumerator.
-
-
- Specifies type codes used to encode the types of values in a blob.
-
-
- A value equivalent to .
-
-
- A value equivalent to .
-
-
- A value equivalent to .
-
-
- A value equivalent to .
-
-
- The attribute argument is an Enum instance.
-
-
- A value equivalent to .
-
-
- A value equivalent to .
-
-
- A value equivalent to .
-
-
- A value equivalent to .
-
-
- A value equivalent to .
-
-
- A value equivalent to .
-
-
- A value equivalent to .
-
-
- A value equivalent to .
-
-
- The attribute argument is "boxed" (passed to a parameter, field, or property of type object) and carries type information in the attribute blob.
-
-
- The attribute argument is a instance.
-
-
- A value equivalent to .
-
-
- A value equivalent to .
-
-
- A value equivalent to .
-
-
- Specifies additional flags that can be applied to method signatures. The underlying values of the fields in this type correspond to the representation in the leading signature byte represented by a structure.
-
-
- Indicates the first explicitly declared parameter that represents the instance pointer.
-
-
- A generic method.
-
-
-
- An instance method.
- The Ecma 335 CLI Specification refers to this flag as .
-
-
-
- No flags.
-
-
- Specifies how arguments in a given signature are passed from the caller to the callee. The underlying values of the fields in this type correspond to the representation in the leading signature byte represented by a structure.
-
-
- An unmanaged C/C++ style calling convention where the call stack is cleaned by the caller.
-
-
- A managed calling convention with a fixed-length argument list.
-
-
- An unmanaged calling convention where arguments are passed in registers when possible.
-
-
- An unmanaged calling convention where the call stack is cleaned up by the callee.
-
-
- An unmanaged C++ style calling convention for calling instance member functions with a fixed argument list.
-
-
- Indicates that the specifics of the unmanaged calling convention are encoded as modopts.
-
-
- A managed calling convention for passing extra arguments.
-
-
- Represents the signature characteristics specified by the leading byte of signature blobs.
-
-
- Gets the mask value for the calling convention or signature kind. The default value is 15 (0x0F).
-
-
- Initializes a new instance of the structure using the specified byte value.
- The byte.
-
-
- Initializes a new instance of the structure using the specified signature kind, calling convention and signature attributes.
- The signature kind.
- The calling convention.
- The signature attributes.
-
-
- Compares the specified object with this for equality.
- The object to compare.
-
- if the objects are equal; otherwise, .
-
-
- Compares two values for equality.
- The value to compare.
-
- if the values are equal; otherwise, .
-
-
- Gets a hash code for the current object.
- A hash code for the current object.
-
-
- Compares two values for equality.
- The first value to compare.
- The second value to compare.
-
- if the values are equal; otherwise, .
-
-
- Determines whether two values are unequal.
- The first value to compare.
- The second value to compare.
-
- if the values are unequal; otherwise, .
-
-
- Returns a string that represents the current object.
- A string that represents the current object.
-
-
- Gets the signature attributes.
- The attributes.
-
-
- Gets the calling convention.
- The calling convention.
-
-
- Gets a value that indicates whether this structure has the signature attribute.
-
- if the attribute is present; otherwise, .
-
-
- Gets a value that indicates whether this structure has the signature attribute.
-
- if the attribute is present; otherwise, .
-
-
- Gets a value that indicates whether this structure has the signature attribute.
-
- if the attribute is present; otherwise, .
-
-
- Gets the signature kind.
- The signature kind.
-
-
- Gets the raw value of the header byte.
- The raw value of the header byte.
-
-
- Specifies the signature kind. The underlying values of the fields in this type correspond to the representation in the leading signature byte represented by a structure.
-
-
- A field signature.
-
-
- A local variables signature.
-
-
- A method reference, method definition, or standalone method signature.
-
-
- A method specification signature.
-
-
- A property signature.
-
-
- Specifies constants that define type codes used in signature encoding.
-
-
- Represents a generalized in signatures.
-
-
- Represents a in signatures.
-
-
- Represents managed pointers (byref return values and parameters) in signatures. It is followed in the blob by the signature encoding of the underlying type.
-
-
- Represents a in signatures.
-
-
- Represents a in signatures.
-
-
- Represents a in signatures.
-
-
- Represents function pointer types in signatures.
-
-
- Represents a generic method parameter used within a signature.
-
-
- Represents the instantiation of a generic type in signatures.
-
-
- Represents a generic type parameter used within a signature.
-
-
- Represents an in signatures.
-
-
- Represents an in signatures.
-
-
- Represents an in signatures.
-
-
- Represents an in signatures.
-
-
- Represents an invalid or uninitialized type code. It will not appear in valid signatures.
-
-
- Represents an in signatures.
-
-
- Represents a custom modifier applied to a type within a signature that the caller can ignore.
-
-
- Represents a local variable that is pinned by garbage collector.
-
-
- Represents an unmanaged pointer in signatures. It is followed in the blob by the signature encoding of the underlying type.
-
-
- Represents a custom modifier applied to a type within a signature that the caller must understand.
-
-
- Represents an in signatures.
-
-
- Represents a marker to indicate the end of fixed arguments and the beginning of variable arguments.
-
-
- Represents a in signatures.
-
-
- Represents a in signatures.
-
-
- Represents a single dimensional with a lower bound of 0.
-
-
- Represents a typed reference in signatures.
-
-
- Precedes a type in signatures. In raw metadata, this is encoded as either ELEMENT_TYPE_CLASS (0x12) for reference types or ELEMENT_TYPE_VALUETYPE (0x11) for value types. This is collapsed to a single code because Windows Runtime projections can project from class to value type or vice-versa, and the raw code is misleading in those cases.
-
-
- Represents a in signatures.
-
-
- Represents a in signatures.
-
-
- Represents a in signatures.
-
-
- Represents a in signatures.
-
-
- Represents in signatures.
-
-
- Indicates the type definition of the signature.
-
-
- The type definition or reference refers to a class.
-
-
- It isn't known in the current context if the type reference or definition is a class or value type.
-
-
- The type definition or reference refers to a value type.
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- Determines the kind of signature, which can be or .
- The signature is invalid.
- An enumeration value that indicates the signature kind.
-
-
- Gets a handle to the signature blob.
- A handle to the signature blob.
-
-
-
-
-
-
- Indicates whether the current object is equal to another object of the same type.
- An object to compare with this object.
-
- if the current object is equal to the parameter; otherwise, .
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- Indicates whether a represents a standalone method or local variable signature.
-
-
- The references a local variable signature.
-
-
- The represents a standalone method signature.
-
-
-
-
-
-
- Indicates whether the current object is equal to another object of the same type.
- An object to compare with this object.
-
- if the current object is equal to the parameter; otherwise, .
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- Returns the enclosing type of a specified nested type.
- The enclosing type of the specified nested type, or a handle a handle whose property is if the type is not nested.
-
-
-
-
-
-
-
-
-
- Returns an array of types nested in the specified type.
- An immutable array of type definition handles that represent types nested in the specified type.
-
-
-
-
- Gets the base type of the type definition: either , or .
- The base type of the type definition.
-
-
- Gets a value that indicates whether this is a nested type.
-
- if it is a nested type, otherwise.
-
-
- Gets the name of the type.
- The name of the type.
-
-
- Gets the full name of the namespace where the type is defined.
- The full name of the namespace where the type is defined, or a handle whose property is if the type is nested or defined in a root namespace.
-
-
- Gets the definition handle of the namespace where the type is defined.
- The definition handle of the namespace where the type is defined, or a handle whose property is if the type is nested or defined in a root namespace.
-
-
-
-
-
-
- Indicates whether the current object is equal to another object of the same type.
- An object to compare with this object.
-
- if the current object is equal to the parameter; otherwise, .
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- Contains a collection of instances.
-
-
-
- Returns an enumerator that iterates through the collection.
- An enumerator that can be used to iterate through the collection.
-
-
- Returns an enumerator that iterates through a collection.
- An object that can be used to iterate through the collection.
-
-
- Gets the number of elements in the collection.
- The number of elements in the collection.
-
-
-
- Advances the enumerator to the next element of the collection.
-
- if the enumerator was successfully advanced to the next element; if the enumerator has passed the end of the collection.
-
-
- Sets the enumerator to its initial position, which is before the first element in the collection.
-
-
- Performs application-defined tasks associated with freeing, releasing, or resetting unmanaged resources.
-
-
- Gets the element in the collection at the current position of the enumerator.
- The element in the collection at the current position of the enumerator.
-
-
- Gets the element in the collection at the current position of the enumerator.
- The element in the collection at the current position of the enumerator.
-
-
-
-
-
-
-
-
-
-
-
- Gets the name of the target type.
- The name of the target type.
-
-
- Gets the full name of the namespace where the target type is defined.
- The full name of the namespace where the target type is defined, or a handle whose the property is if the type is nested or defined in a root namespace.
-
-
- Gets the resolution scope in which the target type is defined and is uniquely identified by the specified and .
- The resolution scope in which the target type is uniquely defined.
-
-
-
-
-
-
- Indicates whether the current object is equal to another object of the same type.
- An object to compare with this object.
-
- if the current object is equal to the parameter; otherwise, .
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- Contains a collection of instances.
-
-
-
- Returns an enumerator that iterates through the collection.
- An enumerator that can be used to iterate through the collection.
-
-
- Returns an enumerator that iterates through a collection.
- An object that can be used to iterate through the collection.
-
-
- Gets the number of elements in the collection.
- The number of elements in the collection.
-
-
-
- Advances the enumerator to the next element of the collection.
-
- if the enumerator was successfully advanced to the next element; if the enumerator has passed the end of the collection.
-
-
- Sets the enumerator to its initial position, which is before the first element in the collection.
-
-
- Performs application-defined tasks associated with freeing, releasing, or resetting unmanaged resources.
-
-
- Gets the element in the collection at the current position of the enumerator.
- The element in the collection at the current position of the enumerator.
-
-
- Gets the element in the collection at the current position of the enumerator.
- The element in the collection at the current position of the enumerator.
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- Indicates whether the current object is equal to another object of the same type.
- An object to compare with this object.
-
- if the current object is equal to the parameter; otherwise, .
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- Represents a handle to the user string heap.
-
-
-
-
-
- Indicates whether the current object is equal to another object of the same type.
- An object to compare with this object.
-
- if the current object is equal to the parameter; otherwise, .
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- Specifies flags for the unmanaged method import attributes.
-
-
- Specifies that the best-fit mapping behavior when converting Unicode characters to ANSI characters is disabled.
-
-
- Specifies that the best-fit mapping behavior when converting Unicode characters to ANSI characters is enabled.
-
-
- Specifies whether the best-fit mapping behavior when converting Unicode characters to ANSI characters is enabled or disabled.
-
-
- Specifies that the calling convention is CDecl.
-
-
- Specifies that the calling convention is FastCall.
-
-
- Specifies the calling convention.
-
-
- Specifies that the calling convention is StdCall.
-
-
- Specifies that the calling convention is ThisCall.
-
-
- Specifies that the default platform calling convention is used (StdCall on Windows x86, CDecl on Linux x86).
-
-
- Specifies that strings are marshalled as multiple-byte character strings: the system default Windows (ANSI) code page on Windows, and UTF-8 on Unix.
-
-
- Specifies that the character set is chosen automatically. See Charsets and marshaling for details.
-
-
- Specifies the character set used for string marshalling.
-
-
- Specifies that strings are marshalled as Unicode 2-byte character strings.
-
-
- Specifies that the Common Language Runtime should not try an entry-point names with charset-specific suffixes when searching for the imported method.
-
-
- Specifies default method import attributes.
-
-
- Specifies that the imported method calls the SetLastError Windows API function before returning.
-
-
- Specifies that an exception should not be thrown when an unmappable Unicode character is converted to an ANSI character.
-
-
- Specifies that an exception should be thrown when an unmappable Unicode character is converted to an ANSI character.
-
-
- Specifies whether an exception should be thrown when an unmappable Unicode character is converted to an ANSI character.
-
-
-
-
- Used to add a handler for an event. Corresponds to the flag in the Ecma 335 CLI specification.
- CLS-compliant adders are named the with prefix.
-
-
-
-
- Reads the value of the property.
- CLS-compliant getters are named with get_ prefix.
-
-
-
- Other method for a property (not a getter or setter) or an event (not an adder, remover, or raiser).
-
-
-
- Used to indicate that an event has occurred. Corresponds to the flag in the Ecma 335 CLI specification.
- CLS-compliant raisers are named with the prefix.
-
-
-
-
- Used to remove a handler for an event. Corresponds to the flag in the Ecma 335 CLI specification.
- CLS-compliant removers are named with the prefix.
-
-
-
-
- Used to modify the value of the property.
- CLS-compliant setters are named with the prefix.
-
-
-
- Represents the Common Object File Format (COFF) file characteristics.
-
-
- Indicates that the operating system should aggressively trim the working set for this file. This flag is deprecated and should be zero.
-
-
- Indicates that this file is for a 32-bit machine.
-
-
- Indicates that this file uses a big endian byte order. This flag is deprecated and should be zero.
-
-
- Indicates that this file uses a little endian byte order. This flag is deprecated and should be zero.
-
-
- Indicates that debugging information is removed from the image file.
-
-
- Indicates that the image file is a dynamic-link library (DLL).
-
-
- Indicates that the image file is valid and can be run.
-
-
- Indicates that this executable file can handle memory addresses greater than 2 GB.
-
-
- Indicates that COFF line numbers have been removed from the file. This flag is deprecated and should be zero.
-
-
- Indicates that COFF symbol table entries for local symbols have been removed from the file. This flag is deprecated and should be zero.
-
-
- Indicates that the image should be fully loaded and copied into the swap file if it's located on a network media.
-
-
- Indicates that the image doesn't contain base relocations and must therefore be loaded at its preferred base address.
-
-
- Indicates that the image should be fully loaded and copied into the swap file if it's located on a removable media.
-
-
- Indicates that the image file is a system file, not a user program.
-
-
- Indicates that the file should be run only on a uniprocessor machine.
-
-
- Provides information about a Program Debug Database (PDB) file.
-
-
- The iteration of the PDB. The first iteration is 1. The iteration is incremented each time the PDB content is augmented.
-
-
- The Globally Unique Identifier (GUID) of the associated PDB.
-
-
- The path to the .pdb file that contains debug information for the PE/COFF file.
-
-
- Represents the header of a COFF file.
-
-
- Gets the flags that indicate the attributes of the file.
- The flags that indicate the attributes of the file.
-
-
- Gets the type of the target machine.
- The type of the target machine.
-
-
- Gets the number of sections. This indicates the size of the section table, which immediately follows the headers.
- The number of sections.
-
-
- Gets the number of entries in the symbol table. This data can be used to locate the string table, which immediately follows the symbol table. This value should be zero for a PE image.
-
-
- Gets the file pointer to the COFF symbol table.
- The file pointer to the COFF symbol table, or zero if no COFF symbol table is present. This value should be zero for a PE image.
-
-
- Gets the size of the optional header, which is required for executable files but not for object files. This value should be zero for an object file.
- The size of the optional header.
-
-
- Gets a value that indicates when the file was created.
- The low 32 bits of the number of seconds since 00:00 January 1, 1970, which indicates when the file was created.
-
-
- Represents the runtime flags for a .NET executable image.
-
-
- Indicates that this image is a library that only contains IL code.
-
-
- Indicates that this image only contains IL code.
-
-
- Reserved, shall be 0.
-
-
- Indicates that this image should be run as a 32-bit process on a 64-bit operating system.
-
-
- Indicates that this image can only be loaded into a 32-bit process.
-
-
- Indicates that this image has a strong name signature.
-
-
- Reserved, shall be 0.
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- Initializes a new instance of the class.
-
-
- Adds a CodeView entry.
- The path to the PDB. It should not be empty.
- The unique id of the PDB content.
- The version of Portable PDB format (e.g. 0x0100 for 1.0), or 0 if the PDB is not portable.
-
- is .
-
- contains a NUL character.
-
- is smaller than 0x0100.
-
-
- Adds a CodeView entry.
- The path to the PDB. It should not be empty.
- The unique id of the PDB content.
- The version of Portable PDB format (e.g. 0x0100 for 1.0), or 0 if the PDB is not portable.
- Age (iteration) of the PDB. Shall be 1 for Portable PDBs.
-
- is .
-
- contains a NUL character.
-
- Either is smaller than 0x0100 or is less than 1.
-
-
- Adds an Embedded Portable PDB entry.
- A Portable PDB metadata builder.
- The version of Portable PDB format (e.g. 0x0100 for 1.0).
-
- is .
-
- is smaller than 0x0100.
-
-
- Adds an entry of the specified type.
- The entry type.
- The entry version.
- The entry stamp.
-
-
- Adds an entry of the specified type and serializes its data.
- The entry type.
- The entry version.
- The entry stamp.
- The data to pass to .
- A serializer for serializing data to a .
- The type of the data passed to .
-
-
- Adds PDB checksum entry.
- The hash algorithm name (for example, "SHA256").
- The checksum.
-
- or is .
-
- or is empty.
-
-
- Adds a reproducible entry.
-
-
- Identifies the location, size and format of a block of debug information.
-
-
- Initializes a new instance of the structure.
-
-
-
-
-
-
-
-
-
- Gets the file pointer to the debug data.
- The file pointer to the debug data.
-
-
- Gets the address of the debug data when loaded, relative to the image base.
- The address of the debug data relative to the image base.
-
-
- Gets the size of the debug data (not including the debug directory itself).
- the size of the debug data (excluding the debug directory).
-
-
- Gets a value that indicates if the entry is a entry that points to a Portable PDB.
-
- if the entry is a entry pointing to a Portable PDB; otherwise, .
-
-
- Gets the major version number of the debug data format.
- The major version number of the debug data format.
-
-
- Gets the minor version number of the debug data format.
- The minor version number of the debug data format.
-
-
- Get the time and date that the debug data was created if the PE/COFF file is not deterministic; otherwise, gets a value based on the hash of the content.
- for a non-deterministic PE/COFF file, the time and date that the debug data was created; otherwise, a value based on the hash of the content.
-
-
- Gets the format of the debugging information.
- The format of the debugging information.
-
-
- An enumeration that describes the format of the debugging information of a .
-
-
- Associated PDB file description. For more information, see the specification.
-
-
- The COFF debug information (line numbers, symbol table, and string table). This type of debug information is also pointed to by fields in the file headers.
-
-
-
- The entry points to a blob containing Embedded Portable PDB. The Embedded Portable PDB blob has the following format:
- - blob ::= uncompressed-size data
- - Data spans the remainder of the blob and contains a Deflate-compressed Portable PDB.
- For more information, see the specification.
-
-
-
- The entry stores a crypto hash of the content of the symbol file the PE/COFF file was built with. The hash can be used to validate that a given PDB file was built with the PE/COFF file and not altered in any way. More than one entry can be present if multiple PDBs were produced during the build of the PE/COFF file (for example, private and public symbols). For more information, see the specification.
-
-
-
- The presence of this entry indicates a deterministic PE/COFF file. See the Remarks section for more information.
- The tool that produced the deterministic PE/COFF file guarantees that the entire content of the file is based solely on documented inputs given to the tool (such as source files, resource files, and compiler options) rather than ambient environment variables (such as the current time, the operating system, and the bitness of the process running the tool).
- The value of field TimeDateStamp in COFF File Header of a deterministic PE/COFF file does not indicate the date and time when the file was produced and should not be interpreted that way. Instead, the value of the field is derived from a hash of the file content. The algorithm to calculate this value is an implementation detail of the tool that produced the file.
- The debug directory entry of type must have all fields, except for Type zeroed.
- For more information, see the specification.
-
-
-
- An unknown value that should be ignored by all tools.
-
-
-
-
-
-
-
-
-
- Describes the characteristics of a dynamic link library.
-
-
- The image must run inside an AppContainer.
-
-
- The DLL can be relocated.
-
-
- The image can handle a high entropy 64-bit virtual address space.
-
-
- Do not bind this image.
-
-
- The image understands isolation and doesn't want it.
-
-
- The image does not use SEH. No SE handler may reside in this image.
-
-
- The image is NX compatible.
-
-
- Reserved.
-
-
- Reserved.
-
-
- The image is Terminal Server aware.
-
-
- Reserved.
-
-
- Reserved.
-
-
- The driver uses the WDM model.
-
-
- Specifies the target machine's CPU architecture.
-
-
- Alpha.
-
-
- ALPHA64.
-
-
- Matsushita AM33.
-
-
- AMD64 (K8).
-
-
- ARM little endian.
-
-
- ARM64.
-
-
- ARM Thumb-2 little endian.
-
-
- EFI Byte Code.
-
-
- Intel 386.
-
-
- Intel 64.
-
-
- LOONGARCH32
-
-
- LOONGARCH64
-
-
- M32R little-endian.
-
-
- MIPS.
-
-
- MIPS with FPU.
-
-
- MIPS16 with FPU.
-
-
- IBM PowerPC little endian.
-
-
- PowerPCFP.
-
-
- Hitachi SH3 little endian.
-
-
- Hitachi SH3 DSP.
-
-
- Hitachi SH3 little endian.
-
-
- Hitachi SH4 little endian.
-
-
- Hitachi SH5.
-
-
- Thumb.
-
-
- Infineon.
-
-
- The target CPU is unknown or not specified.
-
-
- MIPS little-endian WCE v2.
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- Represents a PDB Checksum debug directory entry.
-
-
- The name of the crypto hash algorithm used to calculate the checksum.
- A string representing the name of the crypto hash algorithm used to calculate the checksum.
-
-
- The checksum of the PDB content.
- An immutable array of bytes representing the checksum of the PDB content.
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- Builds PE directories.
-
-
- Initializes an instance of the class.
-
-
- The address of the entry point relative to the image base when the PE file is loaded into memory.
- For program images, this is the starting address. For device drivers, this is the address of the initialization function. An entry point is optional for DLLs. When no entry point is present, this field must be zero.
-
-
- The base relocation table image directory entry.
- A directory entry instance.
-
-
- The bound import image directory entry.
- A directory entry instance.
-
-
- The copyright/architecture image directory entry.
- A directory entry instance.
-
-
- The COM descriptortable image directory entry.
- A directory entry instance.
-
-
- The debug table image directory entry.
- A directory entry instance.
-
-
- The delay import table image directory entry.
- A directory entry instance.
-
-
- The exception table image directory entry.
- A directory entry instance.
-
-
- The export table image directory entry.
- A directory entry instance.
-
-
- The global pointer table image directory entry.
- A directory entry instance.
-
-
- The import address table (IAT) image directory entry.
- A directory entry instance.
-
-
- The import table image directory entry.
- A directory entry instance.
-
-
- The load configuration table image directory entry.
- A directory entry instance.
-
-
- The resource table image directory entry.
- A directory entry instance.
-
-
- The thread local storage (TLS) table image directory entry.
- A directory entry instance.
-
-
-
- Gets the address of the entry point relative to the image base when the PE file is loaded into memory.
- The address of the entry point relative to the image base.
-
-
- Gets the address of the beginning-of-code section relative to the image base when the image is loaded into memory.
- The address of the beginning-of-code section relative to the image base.
-
-
- Gets the address of the beginning-of-data section relative to the image base when the image is loaded into memory.
- The address of the beginning-of-data section relative to the image base.
-
-
-
-
- Gets the Certificate Table entry, which points to a table of attribute certificates.
-
-
- Gets the image file checksum.
- The image file checksum.
-
-
-
-
-
-
-
-
-
- Gets the alignment factor (in bytes) that is used to align the raw data of sections in the image file.
- A power of 2 between 512 and 64K, inclusive. The default is 512.
-
-
-
- Gets the preferred address of the first byte of the image when it is loaded into memory.
- The preferred address, which is a multiple of 64K.
-
-
-
-
-
- Gets a value that identifies the format of the image file.
- The format of the image file.
-
-
- Gets the major version number of the image.
- The major version number of the image.
-
-
- Gets the linker major version number.
- The linker major version number.
-
-
- Gets the major version number of the required operating system.
- The major version number of the required operating system.
-
-
- Gets the major version number of the subsystem.
- The major version number of the subsystem.
-
-
- Gets the minor version number of the image.
- The minor version number of the image.
-
-
- Gets the linker minor version number.
- The linker minor version number.
-
-
- Gets the minor version number of the required operating system.
- The minor version number of the required operating system.
-
-
- Gets the minor version number of the subsystem.
- The minor version number of the subsystem.
-
-
- Gets the number of data-directory entries in the remainder of the . Each describes a location and size.
- The number of data-directory entries in the remainder of the .
-
-
-
- Gets the alignment (in bytes) of sections when they are loaded into memory.
- A number greater than or equal to . The default is the page size for the architecture.
-
-
- Gets the size of the code (text) section, or the sum of all code sections if there are multiple sections.
- the size of the code (text) section, or the sum of all code sections if there are multiple sections.
-
-
- Gets the combined size of an MS DOS stub, PE header, and section headers rounded up to a multiple of FileAlignment.
- The combined size of an MS DOS stub, PE header, and section headers rounded up to a multiple of FileAlignment.
-
-
- Gets the size of the local heap space to commit.
- the size of the local heap space to commit.
-
-
- Gets the size of the local heap space to reserve. Only is committed; the rest is made available one page at a time until the reserve size is reached.
- The size of the local heap space to reserve.
-
-
- Gets the size (in bytes) of the image, including all headers, as the image is loaded in memory.
- The size (in bytes) of the image, which is a multiple of .
-
-
- Gets the size of the initialized data section, or the sum of all such sections if there are multiple data sections.
-
-
- Gets the size of the stack to commit.
- The size of the stack to commit.
-
-
- Gets the size of the stack to reserve. Only is committed; the rest is made available one page at a time until the reserve size is reached.
- The size of the stack to reserve.
-
-
- Gets the size of the uninitialized data section (BSS), or the sum of all such sections if there are multiple BSS sections.
- The size of the uninitialized data section (BSS) or the sum of all such sections.
-
-
- Gets the name of the subsystem that is required to run this image.
- the name of the subsystem that is required to run this image.
-
-
-
- Defines the header for a portable executable (PE) file.
-
-
- Initializes a new instance of the class.
- The target machine's CPU architecture.
- The alignment (in bytes) of sections when they are loaded into memory. It must be greater than or equal to . The default is the page size for the architecture.
- The alignment factor (in bytes) that is used to align the raw data of sections in the image file. The value should be a power of 2 between 512 and 64K, inclusive. The default is 512. If the is less than the architecture's page size, then must match .
- The preferred address of the first byte of image when loaded into memory; must be a multiple of 64K.
- The linker major version number.
- The linker minor version number.
- The major version number of the required operating system.
- The minor version number of the required operating system.
- The major version number of the image.
- The minor version number of the image.
- The major version number of the subsystem.
- The minor version number of the subsystem.
- The subsystem required to run the image.
- An object describing the characteristics of the dynamic link library.
- An object describing the characteristics of the image.
- The size of the stack to reserve. Only is committed; the rest is made available one page at a time until the reserve size is reached.
- The size of the stack to commit.
- The size of the local heap space to reserve. Only is committed; the rest is made available one page at a time until the reserve size is reached.
- The size of the local heap space to commit.
-
- is not power of 2 between 512 and 64K.
--or-
-
- not power of 2.
-
--or-
-
- is less than .
-
-
- Creates an executable header.
- A instance representing the executable header.
-
-
- Creates a library header.
- A instance representing the library header.
-
-
- Returns the dynamic linker library characteristics.
- An object that describes the dynamic linker library characteristics.
-
-
- The alignment factor (in bytes) that is used to align the raw data of sections in the image file. The value should be a power of 2 between 512 and 64K, inclusive. The default is 512. If the section alignment is less than the architecture's page size, then file alignment must match the section alignment.
-
-
- The preferred address of the first byte of image when loaded into memory; must be a multiple of 64K.
- A number representing the preferred address of the first byte of image when loaded into memory.
-
-
- Returns the image characteristics.
- An object representing the image characteristics.
-
-
- The target machine's CPU architecture.
- One of the enumeration values representing the different CPU architectures.
-
-
- The major version number of the image.
- A number the size of a representing the major version number of the image.
-
-
- The linker major version number.
- A number the size of a representing the linker major version number.
-
-
- The major version number of the required operating system.
- A number the size of a representing the major version number of the required operating system.
-
-
- The major version number of the subsystem.
- A number the size of a representing the major version number of the subsystem.
-
-
- The minor version number of the image.
- A number the size of a representing the minor version number of the image.
-
-
- The linker minor version number.
- A number the size of a representing the linker minor version number.
-
-
- The minor version number of the required operating system.
- A number the size of a representing the minor version number of the required operating system.
-
-
- The minor version number of the subsystem.
- A number the size of a representing the minor version number of the subsystem.
-
-
- The alignment (in bytes) of sections when they are loaded into memory.
- A number representing the alignment (in bytes) of sections when they are loaded into memory. It must be greater than or equal to the file alignment. The default is the page size for the architecture.
-
-
- The size of the local heap space to commit.
- A number representing the size of the local heap space to commit.
-
-
- The size of the local heap space to reserve. Only is committed; the rest is made available one page at a time until the reserve size is reached.
- A number representing the size of the local heap space to reserve.
-
-
- The size of the stack to commit.
- A number representing the size of the stack to commit.
-
-
- The size of the stack to reserve. Only is committed; the rest is made available one page at a time until the reserve size is reached.
- A number representing the size of the stack to reserve.
-
-
- The subsystem that is required to run this image.
- A instance.
-
-
- Defines a type that reads PE (Portable Executable) and COFF (Common Object File Format) headers from a stream.
-
-
- Instantiates a new instance of the class that reads the PE headers from the current location in the specified stream.
- A stream containing the PE image starting at the stream's current position and ending at the end of the stream.
- The data read from the stream has an invalid format.
- Error reading from the stream.
- The stream does not support seek operations.
-
- is .
-
-
- Instantiates a new instance of the class that reads the PE headers from a stream that represents a PE image of a specified size.
- A stream containing PE image of the given size starting at its current position.
- The size of the PE image.
- The data read from the stream has an invalid format.
- Error reading from the stream.
- The stream does not support seek operations.
-
- is .
-
- is negative or extends past the end of the stream.
-
-
- Instantiates a new instance of the class that reads the PE headers from a stream that represents a PE image of a specified size and indicates whether the PE image has been loaded into memory.
- The stream containing PE image of the given size starting at its current position.
- The size of the PE image.
-
- if the PE image has been loaded into memory by the OS loader; otherwise, .
- The data read from the stream has invalid format.
- Error reading from the stream.
- The stream does not support seek operations.
-
- is .
-
- is negative or extends past the end of the stream.
-
-
- Searches sections of the PE image for the section that contains the specified Relative Virtual Address.
- The relative virtual address to search for.
- The index of the section that contains , or -1 if there the search is unsuccessful.
-
-
- Gets the offset (in bytes) from the start of the image to the given directory data.
- The PE directory entry.
- When the method returns, contains the offset from the start of the image to the given directory data.
-
- if the directory data is found; otherwise.
-
-
- Gets the COFF header of the image.
- The COFF header of the image.
-
-
- Gets the byte offset from the start of the PE image to the start of the COFF header.
- The byte offset from the start of the PE image to the start of the COFF header.
-
-
- Gets the COR header.
- The COR header, or if the image does not have one.
-
-
- Gets the byte offset from the start of the image to the COR header.
- The byte offset from the start of the image to the COR header, or -1 if the image does not have a COR header.
-
-
- Gets a value that indicates whether the image is Coff only.
-
- if the image is Coff only; otherwise, .
-
-
- Gets a value that indicates whether the image represents a Windows console application.
-
- if the image is a Windows console applications; otherwise, .
-
-
- Gets a value that indicates whether the image represents a dynamic link library.
-
- if the image is a DLL; otherwise, .
-
-
- Gets a value that indicates whether the image represents an executable.
-
- if the image is an executable; otherwise, .
-
-
- Gets the size of the CLI metadata.
- the size of the CLI metadata, or 0 if the image does not contain metadata.
-
-
- Gets the offset (in bytes) from the start of the PE image to the start of the CLI metadata.
- The offset (in bytes) from the start of the PE image to the start of the CLI metadata, or -1 if the image does not contain metadata.
-
-
- Gets the image's PE header.
- The image's PE header, or if the image is COFF only.
-
-
- Gets the byte offset of the header from the start of the image.
- The byte offset of the header from the start of the image.
-
-
- Gets the PE section headers.
- An array containing the PE section headers.
-
-
-
-
-
-
- Reads the contents of the entire block into an array.
- An immutable byte array.
-
-
- Reads the contents of a part of the block into an array.
- The starting position in the block.
- The number of bytes to read.
- The specified range is not contained within the block.
- An immutable array of bytes.
-
-
- Creates a for a blob spanning the entire block.
- A reader for a blob spanning the entire block.
-
-
- Creates a for a blob spanning a part of the block.
- The starting position in the block.
- The number of bytes in the portion of the block.
- The specified range is not contained within the block.
- A reader for a blob spanning a portion of the block.
-
-
- Gets the length of the block.
- The length of the block.
-
-
- Gets a pointer to the first byte of the block.
- A pointer to the first byte of the block.
-
-
- Provides a reader for Portable Executable format (PE) files.
-
-
- Creates a Portable Executable reader over a PE image stored in memory.
- A pointer to the start of the PE image.
- The size of the PE image.
-
- is .
-
- is negative.
-
-
- Creates a Portable Executable reader over a PE image stored in memory. A flag indicates whether the image has already been loaded into memory.
- A pointer to the start of the PE image.
- The size of the PE image.
-
- if the PE image has been loaded into memory by the OS loader; otherwise, .
-
- is .
-
- is negative.
-
-
- Creates a Portable Executable reader over a PE image stored in a byte array.
- An immutable array of bytes representing the PE image.
-
- is .
-
-
- Creates a Portable Executable reader over a PE image stored in a stream.
- PE image stream.
-
- is .
-
-
- Creates a Portable Executable reader over a PE image stored in a stream beginning at its current position and ending at the end of the stream.
- A PE image stream.
- Options specifying how sections of the PE image are read from the stream.
-
- is .
-
- has an invalid value.
- Error reading from the stream (only when prefetching data).
-
- is specified, and the PE headers of the image are invalid.
-
-
- Creates a Portable Executable reader over a PE image of the given size beginning at the stream's current position.
- A PE image stream.
- Options specifying how sections of the PE image are read from the stream.
- The PE image size.
-
- is negative or extends past the end of the stream.
- Error reading from the stream (only when prefetching data).
-
- is specified, and the PE headers of the image are invalid.
-
-
- Disposes all memory allocated by the reader.
-
-
- Gets a object containing the entire PE image.
- The entire PE image is not available.
- A memory block that contains the entire PE image.
-
-
- Loads a PE section that contains CLI metadata.
- The PE image doesn't contain metadata ( returns ).
- The PE headers contain invalid data.
- IO error while reading from the underlying stream.
- A memory block that contains the CLI metadata.
-
-
- Loads the PE section that contains the specified relative virtual address into memory and returns a memory block that starts at that address and ends at the end of the containing section.
- The Relative Virtual Address of the data to read.
- The PE headers contain invalid data.
- An IO error occurred while reading from the underlying stream.
- The PE image is not available.
-
- is negative.
- A memory block that starts at and ends at the end of the containing section, or an empty block if doesn't represent a location in any of the PE sections of this PE image.
-
-
- Loads the PE section with the specified name into memory and returns a memory block that spans the section.
- The name of the section.
-
- is .
- The PE image is not available.
- A memory block that spans the section, or an empty block if no section of the given exists in this PE image.
-
-
- Reads the data pointed to by the specified Debug Directory entry and interprets it as CodeView.
- A Debug Directory entry instance.
-
- is not a CodeView entry.
- Bad format of the data.
- IO error while reading from the underlying stream.
- The PE image is not available.
- A code view debug directory data instance.
-
-
- Reads all Debug Directory table entries.
- Bad format of the entry.
- IO error while reading from the underlying stream.
- The PE image is not available.
- An array of Debug Directory table entries.
-
-
- Reads the data pointed to by the specified Debug Directory entry and interprets it as an Embedded Portable PDB blob.
- The Debug Directory entry whose data is to be read.
-
- is not a entry.
- Bad format of the data.
- PE image not available.
- The provider of a metadata reader for reading a Portable PDB image.
-
-
- Reads the data pointed to by the specified Debug Directory entry and interprets it as a PDB Checksum entry.
- The Debug Directory entry whose data is to be read.
-
- is not a PDB Checksum entry.
- Bad format of the data.
- IO error while reading from the underlying stream.
- The PE image is not available.
- The PDB Checksum entry.
-
-
- Opens a Portable PDB associated with this PE image.
- The path to the PE image. The path is used to locate the PDB file located in the directory containing the PE file.
- If specified, called to open a for a given file path. The provider is expected to either return a readable and seekable , or if the target file doesn't exist or should be ignored for some reason. The provider should throw if it fails to open the file due to an unexpected IO error.
- If successful, a new instance of to be used to read the Portable PDB.
- If successful and the PDB is found in a file, the path to the file, or if the PDB is embedded in the PE image itself.
-
- or is .
- The stream returned from doesn't support read and seek operations.
- No matching PDB file was found due to an error: The PE image or the PDB is invalid.
- No matching PDB file was found due to an error: An IO error occurred while reading the PE image or the PDB.
-
- if the PE image has a PDB associated with it and the PDB has been successfully opened; otherwise, .
-
-
- Gets a value that indicates if the PE image contains CLI metadata.
- The PE headers contain invalid data.
- Error reading from the underlying stream.
-
- if the PE image contains CLI metadata; otherwise, .
-
-
- Gets a value that indicates if the reader can access the entire PE image.
-
- if the reader can access the entire PE image; otherwise, .
-
-
- Gets a value that indicates if the PE image has been loaded into memory by the OS loader.
-
- if the PE image has been loaded into memory by the OS loader; otherwise, .
-
-
- Gets the PE headers.
- The headers contain invalid data.
- Error reading from the stream.
- The PE headers for this PE image.
-
-
- Provides options that specify how sections of a PE image are read from a stream.
-
-
- By default, the stream is disposed when the is disposed, and sections of the PE image are read lazily.
-
-
- Indicates that the underlying PE image has been loaded into memory by the OS loader.
-
-
- Keeps the stream open when the is disposed.
-
-
- Reads the entire image into memory right away. closes the stream automatically by the time the constructor returns unless is specified.
-
-
-
- Reads the metadata section into memory right away.
- Reading from other sections of the file is not allowed ( is thrown by the ).
-
- closes the stream automatically by the time the constructor returns unless is specified. The underlying file may be closed and even deleted after is constructed.
-
-
-
- Defines the base class for a PE resource section builder. Derive from to provide serialization logic for native resources.
-
-
- Initializes a new instance of the class.
-
-
- Serializes the specified resource.
- A blob that contains the data to serialize.
- The location to which to serialize .
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- Provides information about the section header of a PE/COFF file.
-
-
- Gets the name of the section.
- The name of the section.
-
-
- Gets the number of line-number entries for the section.
- The number of line-number entries for the section.
-
-
- Gets the number of relocation entries for the section.
- The number of relocation entries for the section. Its value is zero for PE images.
-
-
- Gets the file pointer to the beginning of line-number entries for the section.
- The file pointer to the beginning of line-number entries for the section, or zero if there are no COFF line numbers.
-
-
- Gets the file pointer to the first page of the section within the COFF file.
- The file pointer to the first page of the section within the COFF file.
-
-
- Gets the file pointer to the beginning of relocation entries for the section.
- The file pointer to the beginning of relocation entries for the section. It is set to zero for PE images or if there are no relocations.
-
-
- Gets the flags that describe the characteristics of the section.
- The flags that describe the characteristics of the section.
-
-
- Gets the size of the section (for object files) or the size of the initialized data on disk (for image files).
- The size of the section (for object files) or the size of the initialized data on disk (for image files).
-
-
- Gets the virtual addess of the section.
- The virtual address of the section.
-
-
- Gets the total size of the section when loaded into memory.
- The total size of the section when loaded into memory.
-
-
-
-
-
-
-
-
-
- Describes the subsystem requirement for the image.
-
-
- Extensible Firmware Interface (EFI) application.
-
-
- EFI driver with boot services.
-
-
- EFI ROM image.
-
-
- EFI driver with run-time services.
-
-
- The image doesn't require a subsystem.
-
-
- The image is a native Win9x driver.
-
-
- The image runs in the OS/2 character subsystem.
-
-
- The image runs in the Posix character subsystem.
-
-
- Unknown subsystem.
-
-
- Boot application.
-
-
- The image runs in the Windows CE subsystem.
-
-
- The image runs in the Windows character subsystem.
-
-
- The image runs in the Windows GUI subsystem.
-
-
- Xbox system.
-
-
-
\ No newline at end of file
diff --git a/Assets/FastScriptReload/Plugins/Roslyn/2021+/System.Reflection.Metadata.xml.meta b/Assets/FastScriptReload/Plugins/Roslyn/2021+/System.Reflection.Metadata.xml.meta
deleted file mode 100644
index 50bd06b..0000000
--- a/Assets/FastScriptReload/Plugins/Roslyn/2021+/System.Reflection.Metadata.xml.meta
+++ /dev/null
@@ -1,14 +0,0 @@
-fileFormatVersion: 2
-guid: 2995ab795c7c4854d991cb7b672c14aa
-TextScriptImporter:
- externalObjects: {}
- userData:
- assetBundleName:
- assetBundleVariant:
-AssetOrigin:
- serializedVersion: 1
- productId: 239351
- packageName: Fast Script Reload
- packageVersion: 1.6.1
- assetPath: Assets/FastScriptReload/Plugins/Roslyn/2021+/System.Reflection.Metadata.xml
- uploadId: 710802
diff --git a/Assets/FastScriptReload/Plugins/Roslyn/2021+/System.Runtime.CompilerServices.Unsafe.dll b/Assets/FastScriptReload/Plugins/Roslyn/2021+/System.Runtime.CompilerServices.Unsafe.dll
deleted file mode 100644
index 103462b..0000000
Binary files a/Assets/FastScriptReload/Plugins/Roslyn/2021+/System.Runtime.CompilerServices.Unsafe.dll and /dev/null differ
diff --git a/Assets/FastScriptReload/Plugins/Roslyn/2021+/System.Runtime.CompilerServices.Unsafe.dll.meta b/Assets/FastScriptReload/Plugins/Roslyn/2021+/System.Runtime.CompilerServices.Unsafe.dll.meta
deleted file mode 100644
index f483676..0000000
--- a/Assets/FastScriptReload/Plugins/Roslyn/2021+/System.Runtime.CompilerServices.Unsafe.dll.meta
+++ /dev/null
@@ -1,50 +0,0 @@
-fileFormatVersion: 2
-guid: 8e60dc682ecdf2a4c8d1f481f807496b
-PluginImporter:
- externalObjects: {}
- serializedVersion: 2
- iconMap: {}
- executionOrder: {}
- defineConstraints:
- - UNITY_2021_1_OR_NEWER
- isPreloaded: 0
- isOverridable: 0
- isExplicitlyReferenced: 0
- validateReferences: 1
- platformData:
- - first:
- : Any
- second:
- enabled: 0
- settings:
- Exclude Linux64: 1
- Exclude OSXUniversal: 1
- Exclude Win: 1
- Exclude Win64: 1
- - first:
- Any:
- second:
- enabled: 1
- settings: {}
- - first:
- Editor: Editor
- second:
- enabled: 0
- settings:
- DefaultValueInitialized: true
- - first:
- Windows Store Apps: WindowsStoreApps
- second:
- enabled: 0
- settings:
- CPU: AnyCPU
- userData:
- assetBundleName:
- assetBundleVariant:
-AssetOrigin:
- serializedVersion: 1
- productId: 239351
- packageName: Fast Script Reload
- packageVersion: 1.6.1
- assetPath: Assets/FastScriptReload/Plugins/Roslyn/2021+/System.Runtime.CompilerServices.Unsafe.dll
- uploadId: 710802
diff --git a/Assets/FastScriptReload/Plugins/Roslyn/2021+/System.Runtime.CompilerServices.Unsafe.xml b/Assets/FastScriptReload/Plugins/Roslyn/2021+/System.Runtime.CompilerServices.Unsafe.xml
deleted file mode 100644
index 9d79492..0000000
--- a/Assets/FastScriptReload/Plugins/Roslyn/2021+/System.Runtime.CompilerServices.Unsafe.xml
+++ /dev/null
@@ -1,291 +0,0 @@
-
-
-
- System.Runtime.CompilerServices.Unsafe
-
-
-
- Contains generic, low-level functionality for manipulating pointers.
-
-
- Adds an element offset to the given reference.
- The reference to add the offset to.
- The offset to add.
- The type of reference.
- A new reference that reflects the addition of offset to pointer.
-
-
- Adds an element offset to the given reference.
- The reference to add the offset to.
- The offset to add.
- The type of reference.
- A new reference that reflects the addition of offset to pointer.
-
-
- Adds an element offset to the given reference.
- The reference to add the offset to.
- The offset to add.
- The type of reference.
- A new reference that reflects the addition of offset to pointer.
-
-
- Adds an element offset to the given void pointer.
- The void pointer to add the offset to.
- The offset to add.
- The type of void pointer.
- A new void pointer that reflects the addition of offset to the specified pointer.
-
-
- Adds a byte offset to the given reference.
- The reference to add the offset to.
- The offset to add.
- The type of reference.
- A new reference that reflects the addition of byte offset to pointer.
-
-
- Adds a byte offset to the given reference.
- The reference to add the offset to.
- The offset to add.
- The type of reference.
- A new reference that reflects the addition of byte offset to pointer.
-
-
- Determines whether the specified references point to the same location.
- The first reference to compare.
- The second reference to compare.
- The type of reference.
-
- if and point to the same location; otherwise, .
-
-
- Casts the given object to the specified type.
- The object to cast.
- The type which the object will be cast to.
- The original object, casted to the given type.
-
-
- Reinterprets the given reference as a reference to a value of type .
- The reference to reinterpret.
- The type of reference to reinterpret.
- The desired type of the reference.
- A reference to a value of type .
-
-
- Returns a pointer to the given by-ref parameter.
- The object whose pointer is obtained.
- The type of object.
- A pointer to the given value.
-
-
- Reinterprets the given read-only reference as a reference.
- The read-only reference to reinterpret.
- The type of reference.
- A reference to a value of type .
-
-
- Reinterprets the given location as a reference to a value of type .
- The location of the value to reference.
- The type of the interpreted location.
- A reference to a value of type .
-
-
- Determines the byte offset from origin to target from the given references.
- The reference to origin.
- The reference to target.
- The type of reference.
- Byte offset from origin to target i.e. - .
-
-
- Copies a value of type to the given location.
- The location to copy to.
- A pointer to the value to copy.
- The type of value to copy.
-
-
- Copies a value of type to the given location.
- The location to copy to.
- A reference to the value to copy.
- The type of value to copy.
-
-
- Copies bytes from the source address to the destination address.
- The destination address to copy to.
- The source address to copy from.
- The number of bytes to copy.
-
-
- Copies bytes from the source address to the destination address.
- The destination address to copy to.
- The source address to copy from.
- The number of bytes to copy.
-
-
- Copies bytes from the source address to the destination address without assuming architecture dependent alignment of the addresses.
- The destination address to copy to.
- The source address to copy from.
- The number of bytes to copy.
-
-
- Copies bytes from the source address to the destination address without assuming architecture dependent alignment of the addresses.
- The destination address to copy to.
- The source address to copy from.
- The number of bytes to copy.
-
-
- Initializes a block of memory at the given location with a given initial value.
- The address of the start of the memory block to initialize.
- The value to initialize the block to.
- The number of bytes to initialize.
-
-
- Initializes a block of memory at the given location with a given initial value.
- The address of the start of the memory block to initialize.
- The value to initialize the block to.
- The number of bytes to initialize.
-
-
- Initializes a block of memory at the given location with a given initial value without assuming architecture dependent alignment of the address.
- The address of the start of the memory block to initialize.
- The value to initialize the block to.
- The number of bytes to initialize.
-
-
- Initializes a block of memory at the given location with a given initial value without assuming architecture dependent alignment of the address.
- The address of the start of the memory block to initialize.
- The value to initialize the block to.
- The number of bytes to initialize.
-
-
- Returns a value that indicates whether a specified reference is greater than another specified reference.
- The first value to compare.
- The second value to compare.
- The type of the reference.
-
- if is greater than ; otherwise, .
-
-
- Returns a value that indicates whether a specified reference is less than another specified reference.
- The first value to compare.
- The second value to compare.
- The type of the reference.
-
- if is less than ; otherwise, .
-
-
- Determines if a given reference to a value of type is a null reference.
- The reference to check.
- The type of the reference.
-
- if is a null reference; otherwise, .
-
-
- Returns a reference to a value of type that is a null reference.
- The type of the reference.
- A reference to a value of type that is a null reference.
-
-
- Reads a value of type from the given location.
- The location to read from.
- The type to read.
- An object of type read from the given location.
-
-
- Reads a value of type from the given location without assuming architecture dependent alignment of the addresses.
- The location to read from.
- The type to read.
- An object of type read from the given location.
-
-
- Reads a value of type from the given location without assuming architecture dependent alignment of the addresses.
- The location to read from.
- The type to read.
- An object of type read from the given location.
-
-
- Returns the size of an object of the given type parameter.
- The type of object whose size is retrieved.
- The size of an object of type .
-
-
- Bypasses definite assignment rules for a given value.
- The uninitialized object.
- The type of the uninitialized object.
-
-
- Subtracts an element offset from the given reference.
- The reference to subtract the offset from.
- The offset to subtract.
- The type of reference.
- A new reference that reflects the subtraction of offset from pointer.
-
-
- Subtracts an element offset from the given reference.
- The reference to subtract the offset from.
- The offset to subtract.
- The type of reference.
- A new reference that reflects the subtraction of offset from pointer.
-
-
- Subtracts an element offset from the given reference.
- The reference to subtract the offset from.
- The offset to subtract.
- The type of reference.
- A new reference that reflects the subraction of offset from pointer.
-
-
- Subtracts an element offset from the given void pointer.
- The void pointer to subtract the offset from.
- The offset to subtract.
- The type of the void pointer.
- A new void pointer that reflects the subtraction of offset from the specified pointer.
-
-
- Subtracts a byte offset from the given reference.
- The reference to subtract the offset from.
- The offset to subtract.
- The type of reference.
- A new reference that reflects the subtraction of byte offset from pointer.
-
-
- Subtracts a byte offset from the given reference.
- The reference to subtract the offset from.
- The offset to subtract.
- The type of reference.
- A new reference that reflects the subraction of byte offset from pointer.
-
-
- Returns a to a boxed value.
- The value to unbox.
- The type to be unboxed.
-
- is , and is a non-nullable value type.
-
- is not a boxed value type.
-
--or-
-
- is not a boxed .
-
- cannot be found.
- A to the boxed value .
-
-
- Writes a value of type to the given location.
- The location to write to.
- The value to write.
- The type of value to write.
-
-
- Writes a value of type to the given location without assuming architecture dependent alignment of the addresses.
- The location to write to.
- The value to write.
- The type of value to write.
-
-
- Writes a value of type to the given location without assuming architecture dependent alignment of the addresses.
- The location to write to.
- The value to write.
- The type of value to write.
-
-
-
\ No newline at end of file
diff --git a/Assets/FastScriptReload/Plugins/Roslyn/2021+/System.Runtime.CompilerServices.Unsafe.xml.meta b/Assets/FastScriptReload/Plugins/Roslyn/2021+/System.Runtime.CompilerServices.Unsafe.xml.meta
deleted file mode 100644
index bfc0431..0000000
--- a/Assets/FastScriptReload/Plugins/Roslyn/2021+/System.Runtime.CompilerServices.Unsafe.xml.meta
+++ /dev/null
@@ -1,14 +0,0 @@
-fileFormatVersion: 2
-guid: 37aa3a1626690b44da6b8799b8f26450
-TextScriptImporter:
- externalObjects: {}
- userData:
- assetBundleName:
- assetBundleVariant:
-AssetOrigin:
- serializedVersion: 1
- productId: 239351
- packageName: Fast Script Reload
- packageVersion: 1.6.1
- assetPath: Assets/FastScriptReload/Plugins/Roslyn/2021+/System.Runtime.CompilerServices.Unsafe.xml
- uploadId: 710802
diff --git a/Assets/FastScriptReload/Plugins/Roslyn/2021+/System.Threading.Tasks.Extensions.dll b/Assets/FastScriptReload/Plugins/Roslyn/2021+/System.Threading.Tasks.Extensions.dll
deleted file mode 100644
index a1234ce..0000000
Binary files a/Assets/FastScriptReload/Plugins/Roslyn/2021+/System.Threading.Tasks.Extensions.dll and /dev/null differ
diff --git a/Assets/FastScriptReload/Plugins/Roslyn/2021+/System.Threading.Tasks.Extensions.dll.meta b/Assets/FastScriptReload/Plugins/Roslyn/2021+/System.Threading.Tasks.Extensions.dll.meta
deleted file mode 100644
index 85e57a4..0000000
--- a/Assets/FastScriptReload/Plugins/Roslyn/2021+/System.Threading.Tasks.Extensions.dll.meta
+++ /dev/null
@@ -1,84 +0,0 @@
-fileFormatVersion: 2
-guid: 337544ddb4628f340bd86d16c5d58caa
-PluginImporter:
- externalObjects: {}
- serializedVersion: 2
- iconMap: {}
- executionOrder: {}
- defineConstraints:
- - UNITY_2021_1_OR_NEWER
- isPreloaded: 0
- isOverridable: 0
- isExplicitlyReferenced: 1
- validateReferences: 1
- platformData:
- - first:
- : Any
- second:
- enabled: 0
- settings:
- Exclude Android: 1
- Exclude Editor: 0
- Exclude Linux64: 1
- Exclude OSXUniversal: 1
- Exclude Win: 1
- Exclude Win64: 1
- - first:
- Android: Android
- second:
- enabled: 0
- settings:
- CPU: ARMv7
- - first:
- Any:
- second:
- enabled: 0
- settings: {}
- - first:
- Editor: Editor
- second:
- enabled: 1
- settings:
- CPU: AnyCPU
- DefaultValueInitialized: true
- OS: AnyOS
- - first:
- Standalone: Linux64
- second:
- enabled: 0
- settings:
- CPU: None
- - first:
- Standalone: OSXUniversal
- second:
- enabled: 0
- settings:
- CPU: None
- - first:
- Standalone: Win
- second:
- enabled: 0
- settings:
- CPU: None
- - first:
- Standalone: Win64
- second:
- enabled: 0
- settings:
- CPU: None
- - first:
- Windows Store Apps: WindowsStoreApps
- second:
- enabled: 0
- settings:
- CPU: AnyCPU
- userData:
- assetBundleName:
- assetBundleVariant:
-AssetOrigin:
- serializedVersion: 1
- productId: 239351
- packageName: Fast Script Reload
- packageVersion: 1.6.1
- assetPath: Assets/FastScriptReload/Plugins/Roslyn/2021+/System.Threading.Tasks.Extensions.dll
- uploadId: 710802
diff --git a/Assets/FastScriptReload/Plugins/Roslyn/Microsoft.CSharp.dll b/Assets/FastScriptReload/Plugins/Roslyn/Microsoft.CSharp.dll
deleted file mode 100644
index 22c92fc..0000000
Binary files a/Assets/FastScriptReload/Plugins/Roslyn/Microsoft.CSharp.dll and /dev/null differ
diff --git a/Assets/FastScriptReload/Plugins/Roslyn/Microsoft.CSharp.dll.IMPORTANT.txt.txt b/Assets/FastScriptReload/Plugins/Roslyn/Microsoft.CSharp.dll.IMPORTANT.txt.txt
deleted file mode 100644
index f9c9bdb..0000000
--- a/Assets/FastScriptReload/Plugins/Roslyn/Microsoft.CSharp.dll.IMPORTANT.txt.txt
+++ /dev/null
@@ -1 +0,0 @@
-library is excluded from any compilation by default. It's only purpose is to serve as a reference for dynamic keyword when targetting NET Standard 2.1 - as this is required by ThisRewriters to function properly
\ No newline at end of file
diff --git a/Assets/FastScriptReload/Plugins/Roslyn/Microsoft.CSharp.dll.IMPORTANT.txt.txt.meta b/Assets/FastScriptReload/Plugins/Roslyn/Microsoft.CSharp.dll.IMPORTANT.txt.txt.meta
deleted file mode 100644
index 7fac619..0000000
--- a/Assets/FastScriptReload/Plugins/Roslyn/Microsoft.CSharp.dll.IMPORTANT.txt.txt.meta
+++ /dev/null
@@ -1,14 +0,0 @@
-fileFormatVersion: 2
-guid: 26f2f034c23688d46b7284ad72c08f91
-TextScriptImporter:
- externalObjects: {}
- userData:
- assetBundleName:
- assetBundleVariant:
-AssetOrigin:
- serializedVersion: 1
- productId: 239351
- packageName: Fast Script Reload
- packageVersion: 1.6.1
- assetPath: Assets/FastScriptReload/Plugins/Roslyn/Microsoft.CSharp.dll.IMPORTANT.txt.txt
- uploadId: 710802
diff --git a/Assets/FastScriptReload/Plugins/Roslyn/Microsoft.CSharp.dll.meta b/Assets/FastScriptReload/Plugins/Roslyn/Microsoft.CSharp.dll.meta
deleted file mode 100644
index 0a87e89..0000000
--- a/Assets/FastScriptReload/Plugins/Roslyn/Microsoft.CSharp.dll.meta
+++ /dev/null
@@ -1,84 +0,0 @@
-fileFormatVersion: 2
-guid: 8f60cb703cea2fe4ebc2f2cf1a68714b
-PluginImporter:
- externalObjects: {}
- serializedVersion: 2
- iconMap: {}
- executionOrder: {}
- defineConstraints:
- - UNITY_2019 || UNITY_2020
- isPreloaded: 0
- isOverridable: 0
- isExplicitlyReferenced: 1
- validateReferences: 0
- platformData:
- - first:
- : Any
- second:
- enabled: 0
- settings:
- Exclude Android: 1
- Exclude Editor: 1
- Exclude Linux64: 1
- Exclude OSXUniversal: 1
- Exclude Win: 1
- Exclude Win64: 1
- - first:
- Android: Android
- second:
- enabled: 0
- settings:
- CPU: ARMv7
- - first:
- Any:
- second:
- enabled: 0
- settings: {}
- - first:
- Editor: Editor
- second:
- enabled: 0
- settings:
- CPU: AnyCPU
- DefaultValueInitialized: true
- OS: AnyOS
- - first:
- Standalone: Linux64
- second:
- enabled: 0
- settings:
- CPU: None
- - first:
- Standalone: OSXUniversal
- second:
- enabled: 0
- settings:
- CPU: None
- - first:
- Standalone: Win
- second:
- enabled: 0
- settings:
- CPU: None
- - first:
- Standalone: Win64
- second:
- enabled: 0
- settings:
- CPU: None
- - first:
- Windows Store Apps: WindowsStoreApps
- second:
- enabled: 0
- settings:
- CPU: AnyCPU
- userData:
- assetBundleName:
- assetBundleVariant:
-AssetOrigin:
- serializedVersion: 1
- productId: 239351
- packageName: Fast Script Reload
- packageVersion: 1.6.1
- assetPath: Assets/FastScriptReload/Plugins/Roslyn/Microsoft.CSharp.dll
- uploadId: 710802
diff --git a/Assets/FastScriptReload/Scripts.meta b/Assets/FastScriptReload/Scripts.meta
deleted file mode 100644
index e61eba7..0000000
--- a/Assets/FastScriptReload/Scripts.meta
+++ /dev/null
@@ -1,8 +0,0 @@
-fileFormatVersion: 2
-guid: 3e2456f51a2408f43a5b76ab3daef351
-folderAsset: yes
-DefaultImporter:
- externalObjects: {}
- userData:
- assetBundleName:
- assetBundleVariant:
diff --git a/Assets/FastScriptReload/Scripts/Editor.meta b/Assets/FastScriptReload/Scripts/Editor.meta
deleted file mode 100644
index 969f4be..0000000
--- a/Assets/FastScriptReload/Scripts/Editor.meta
+++ /dev/null
@@ -1,3 +0,0 @@
-fileFormatVersion: 2
-guid: 018258c906e44916b88d291450c30b69
-timeCreated: 1668616782
\ No newline at end of file
diff --git a/Assets/FastScriptReload/Scripts/Editor/AssemblyPostProcess.meta b/Assets/FastScriptReload/Scripts/Editor/AssemblyPostProcess.meta
deleted file mode 100644
index 895a3bd..0000000
--- a/Assets/FastScriptReload/Scripts/Editor/AssemblyPostProcess.meta
+++ /dev/null
@@ -1,3 +0,0 @@
-fileFormatVersion: 2
-guid: 15c1071797bb4a818f85a6f8187f4289
-timeCreated: 1678785269
\ No newline at end of file
diff --git a/Assets/FastScriptReload/Scripts/Editor/AssemblyPostProcess/AddInternalsVisibleToForAllUserAssembliesPostProcess.cs b/Assets/FastScriptReload/Scripts/Editor/AssemblyPostProcess/AddInternalsVisibleToForAllUserAssembliesPostProcess.cs
deleted file mode 100644
index 9496b34..0000000
--- a/Assets/FastScriptReload/Scripts/Editor/AssemblyPostProcess/AddInternalsVisibleToForAllUserAssembliesPostProcess.cs
+++ /dev/null
@@ -1,46 +0,0 @@
-using System.IO;
-using System.Reflection;
-using Mono.Cecil;
-using UnityEditor;
-using UnityEngine;
-
-namespace FastScriptReload.Editor.AssemblyPostProcess
-{
- [InitializeOnLoad]
- public static class AddInternalsVisibleToForAllUserAssembliesPostProcess
- {
- public static readonly DirectoryInfo AdjustedAssemblyRoot;
-
- static AddInternalsVisibleToForAllUserAssembliesPostProcess()
- {
- AdjustedAssemblyRoot = new DirectoryInfo(Path.Combine(Application.dataPath, "..", "Temp", "Fast Script Reload", "AdjustedDlls"));
- }
-
- public static string CreateAssemblyWithInternalsContentsVisibleTo(Assembly changedAssembly, string visibleToAssemblyName)
- {
- if(!AdjustedAssemblyRoot.Exists)
- AdjustedAssemblyRoot.Create();
-
- using (var assembly = AssemblyDefinition.ReadAssembly(changedAssembly.Location, new ReaderParameters { ReadWrite = false }))
- {
- var mainModule = assembly.MainModule;
-
- var attributeCtor = mainModule.ImportReference(
- typeof(System.Runtime.CompilerServices.InternalsVisibleToAttribute).GetConstructor(new[] { typeof(string) })
- );
-
- var attribute = new CustomAttribute(attributeCtor);
- attribute.ConstructorArguments.Add(
- new CustomAttributeArgument(mainModule.TypeSystem.String, visibleToAssemblyName)
- );
-
- assembly.CustomAttributes.Add(attribute);
-
- var newAssemblyPath = new FileInfo(Path.Combine(AdjustedAssemblyRoot.FullName, assembly.Name.Name) + ".dll").FullName;
- assembly.Write(newAssemblyPath);
-
- return newAssemblyPath;
- }
- }
- }
-}
\ No newline at end of file
diff --git a/Assets/FastScriptReload/Scripts/Editor/AssemblyPostProcess/AddInternalsVisibleToForAllUserAssembliesPostProcess.cs.meta b/Assets/FastScriptReload/Scripts/Editor/AssemblyPostProcess/AddInternalsVisibleToForAllUserAssembliesPostProcess.cs.meta
deleted file mode 100644
index 6419854..0000000
--- a/Assets/FastScriptReload/Scripts/Editor/AssemblyPostProcess/AddInternalsVisibleToForAllUserAssembliesPostProcess.cs.meta
+++ /dev/null
@@ -1,10 +0,0 @@
-fileFormatVersion: 2
-guid: b2f64e1d1e2642f9ab712970582c0b45
-timeCreated: 1678785285
-AssetOrigin:
- serializedVersion: 1
- productId: 239351
- packageName: Fast Script Reload
- packageVersion: 1.6.1
- assetPath: Assets/FastScriptReload/Scripts/Editor/AssemblyPostProcess/AddInternalsVisibleToForAllUserAssembliesPostProcess.cs
- uploadId: 710802
diff --git a/Assets/FastScriptReload/Scripts/Editor/Compilation.meta b/Assets/FastScriptReload/Scripts/Editor/Compilation.meta
deleted file mode 100644
index e47810b..0000000
--- a/Assets/FastScriptReload/Scripts/Editor/Compilation.meta
+++ /dev/null
@@ -1,8 +0,0 @@
-fileFormatVersion: 2
-guid: 5d518c1ca9c2d974a886d5856abadb4d
-folderAsset: yes
-DefaultImporter:
- externalObjects: {}
- userData:
- assetBundleName:
- assetBundleVariant:
diff --git a/Assets/FastScriptReload/Scripts/Editor/Compilation/CodeRewriting.meta b/Assets/FastScriptReload/Scripts/Editor/Compilation/CodeRewriting.meta
deleted file mode 100644
index d578aac..0000000
--- a/Assets/FastScriptReload/Scripts/Editor/Compilation/CodeRewriting.meta
+++ /dev/null
@@ -1,3 +0,0 @@
-fileFormatVersion: 2
-guid: bdecd2714d8a463fa3bdae705d942796
-timeCreated: 1672992950
\ No newline at end of file
diff --git a/Assets/FastScriptReload/Scripts/Editor/Compilation/CodeRewriting/BuilderPatternFunctionsRewriter.cs b/Assets/FastScriptReload/Scripts/Editor/Compilation/CodeRewriting/BuilderPatternFunctionsRewriter.cs
deleted file mode 100644
index a65524d..0000000
--- a/Assets/FastScriptReload/Scripts/Editor/Compilation/CodeRewriting/BuilderPatternFunctionsRewriter.cs
+++ /dev/null
@@ -1,36 +0,0 @@
-using System.Linq;
-using ImmersiveVrToolsCommon.Runtime.Logging;
-using Microsoft.CodeAnalysis;
-using Microsoft.CodeAnalysis.CSharp;
-using Microsoft.CodeAnalysis.CSharp.Syntax;
-
-namespace FastScriptReload.Editor.Compilation.CodeRewriting
-{
- class BuilderPatternFunctionsRewriter : FastScriptReloadCodeRewriterBase
- {
- public BuilderPatternFunctionsRewriter(bool writeRewriteReasonAsComment, bool visitIntoStructuredTrivia = false)
- : base(writeRewriteReasonAsComment, visitIntoStructuredTrivia)
- {
- }
-
- public override SyntaxNode VisitMethodDeclaration(MethodDeclarationSyntax node)
- {
- var ancestorName = node.Ancestors().OfType().FirstOrDefault()?.Identifier.ValueText;
- if (string.IsNullOrEmpty(ancestorName)) //TODO: that happens too often for some methods, odd. Why? At very least don't spam user
- {
- LoggerScoped.LogWarning($"Unable to find ancestor for node '{node.ToFullString()}'");
- }
- else
- {
- var ancestorNameWithoutPatchedPostfix = ancestorName.Replace(FastScriptReload.Runtime.AssemblyChangesLoader.ClassnamePatchedPostfix, "");
-
- if (node.ReturnType is IdentifierNameSyntax name && name.Identifier.ValueText == ancestorNameWithoutPatchedPostfix)
- {
- return node.WithReturnType(SyntaxFactory.IdentifierName(ancestorName + " "));
- }
- }
-
- return base.VisitMethodDeclaration(node);
- }
- }
-}
\ No newline at end of file
diff --git a/Assets/FastScriptReload/Scripts/Editor/Compilation/CodeRewriting/BuilderPatternFunctionsRewriter.cs.meta b/Assets/FastScriptReload/Scripts/Editor/Compilation/CodeRewriting/BuilderPatternFunctionsRewriter.cs.meta
deleted file mode 100644
index 2922c1c..0000000
--- a/Assets/FastScriptReload/Scripts/Editor/Compilation/CodeRewriting/BuilderPatternFunctionsRewriter.cs.meta
+++ /dev/null
@@ -1,10 +0,0 @@
-fileFormatVersion: 2
-guid: ad3d5960a86c431cbea11b8962fa361e
-timeCreated: 1678960928
-AssetOrigin:
- serializedVersion: 1
- productId: 239351
- packageName: Fast Script Reload
- packageVersion: 1.6.1
- assetPath: Assets/FastScriptReload/Scripts/Editor/Compilation/CodeRewriting/BuilderPatternFunctionsRewriter.cs
- uploadId: 710802
diff --git a/Assets/FastScriptReload/Scripts/Editor/Compilation/CodeRewriting/ConstructorRewriter.cs b/Assets/FastScriptReload/Scripts/Editor/Compilation/CodeRewriting/ConstructorRewriter.cs
deleted file mode 100644
index 3048539..0000000
--- a/Assets/FastScriptReload/Scripts/Editor/Compilation/CodeRewriting/ConstructorRewriter.cs
+++ /dev/null
@@ -1,84 +0,0 @@
-using System.Linq;
-using FastScriptReload.Runtime;
-using Microsoft.CodeAnalysis;
-using Microsoft.CodeAnalysis.CSharp;
-using Microsoft.CodeAnalysis.CSharp.Syntax;
-
-namespace FastScriptReload.Editor.Compilation.CodeRewriting
-{
- class ConstructorRewriter : FastScriptReloadCodeRewriterBase
- {
- private readonly bool _adjustCtorOnlyForNonNestedTypes;
-
- public ConstructorRewriter(bool adjustCtorOnlyForNonNestedTypes, bool writeRewriteReasonAsComment)
- : base(writeRewriteReasonAsComment)
- {
- _adjustCtorOnlyForNonNestedTypes = adjustCtorOnlyForNonNestedTypes;
- }
-
- public override SyntaxNode VisitConstructorDeclaration(ConstructorDeclarationSyntax node)
- {
- if (_adjustCtorOnlyForNonNestedTypes)
- {
- var typeNestedLevel = node.Ancestors().Count(a => a is TypeDeclarationSyntax);
- if (typeNestedLevel == 1)
- {
- return AdjustCtorOrDestructorNameForTypeAdjustment(node, node.Identifier);
- }
- }
- else
- {
- return AdjustCtorOrDestructorNameForTypeAdjustment(node, node.Identifier);
- }
-
- return base.VisitConstructorDeclaration(node);
- }
-
- public override SyntaxNode VisitDestructorDeclaration(DestructorDeclarationSyntax node)
- {
- if (_adjustCtorOnlyForNonNestedTypes)
- {
- var typeNestedLevel = node.Ancestors().Count(a => a is TypeDeclarationSyntax);
- if (typeNestedLevel == 1)
- {
- return AdjustCtorOrDestructorNameForTypeAdjustment(node, node.Identifier);
- }
- }
- else
- {
- return AdjustCtorOrDestructorNameForTypeAdjustment(node, node.Identifier);
- }
-
- return base.VisitDestructorDeclaration(node);
- }
-
- private SyntaxNode AdjustCtorOrDestructorNameForTypeAdjustment(BaseMethodDeclarationSyntax node, SyntaxToken nodeIdentifier)
- {
- var typeName = (node.Ancestors().First(n => n is TypeDeclarationSyntax) as TypeDeclarationSyntax).Identifier.ToString();
- if (!nodeIdentifier.ToFullString().Contains(typeName))
- {
- //Used Roslyn version bug, some static methods are also interpreted as ctors, eg
- // public static void Method()
- // {
- // Bar(); //treated as Ctor declaration...
- // }
- //
- // private static void Bar()
- // {
- //
- // }
- return node;
- }
-
- if (!typeName.EndsWith(AssemblyChangesLoader.ClassnamePatchedPostfix))
- {
- typeName += AssemblyChangesLoader.ClassnamePatchedPostfix;
- }
-
- return AddRewriteCommentIfNeeded(
- node.ReplaceToken(nodeIdentifier, SyntaxFactory.Identifier(typeName)),
- $"{nameof(ConstructorRewriter)}:{nameof(AdjustCtorOrDestructorNameForTypeAdjustment)}"
- );
- }
- }
-}
\ No newline at end of file
diff --git a/Assets/FastScriptReload/Scripts/Editor/Compilation/CodeRewriting/ConstructorRewriter.cs.meta b/Assets/FastScriptReload/Scripts/Editor/Compilation/CodeRewriting/ConstructorRewriter.cs.meta
deleted file mode 100644
index 3a03834..0000000
--- a/Assets/FastScriptReload/Scripts/Editor/Compilation/CodeRewriting/ConstructorRewriter.cs.meta
+++ /dev/null
@@ -1,10 +0,0 @@
-fileFormatVersion: 2
-guid: 1d2a76467ecd40529f59bc68be8d7289
-timeCreated: 1672992987
-AssetOrigin:
- serializedVersion: 1
- productId: 239351
- packageName: Fast Script Reload
- packageVersion: 1.6.1
- assetPath: Assets/FastScriptReload/Scripts/Editor/Compilation/CodeRewriting/ConstructorRewriter.cs
- uploadId: 710802
diff --git a/Assets/FastScriptReload/Scripts/Editor/Compilation/CodeRewriting/CreateNewFieldInitMethodRewriter.cs b/Assets/FastScriptReload/Scripts/Editor/Compilation/CodeRewriting/CreateNewFieldInitMethodRewriter.cs
deleted file mode 100644
index cc010b0..0000000
--- a/Assets/FastScriptReload/Scripts/Editor/Compilation/CodeRewriting/CreateNewFieldInitMethodRewriter.cs
+++ /dev/null
@@ -1,153 +0,0 @@
-using System;
-using System.Collections.Generic;
-using System.Linq;
-using System.Reflection;
-using ImmersiveVrToolsCommon.Runtime.Logging;
-using Microsoft.CodeAnalysis;
-using Microsoft.CodeAnalysis.CSharp;
-using Microsoft.CodeAnalysis.CSharp.Syntax;
-
-namespace FastScriptReload.Editor.Compilation.CodeRewriting
-{
- class CreateNewFieldInitMethodRewriter: FastScriptReloadCodeRewriterBase {
- private readonly Dictionary> _typeToNewFieldDeclarations;
- private static readonly string NewFieldsToCreateValueFnDictionaryFieldName = "__Patched_NewFieldNameToInitialValueFn";
- private static readonly string NewFieldsToGetTypeFnDictionaryFieldName = "__Patched_NewFieldsToGetTypeFnDictionaryFieldName";
- private static readonly string DictionaryFullNamespaceTypeName = "global::System.Collections.Generic.Dictionary";
-
- public static Dictionary> ResolveNewFieldsToCreateValueFn(Type forType)
- {
- return (Dictionary>) forType.GetField(NewFieldsToCreateValueFnDictionaryFieldName, BindingFlags.NonPublic | BindingFlags.Static).GetValue(null);
- }
-
- public static Dictionary> ResolveNewFieldsToTypeFn(Type forType)
- {
- return (Dictionary>) forType.GetField(NewFieldsToGetTypeFnDictionaryFieldName, BindingFlags.NonPublic | BindingFlags.Static).GetValue(null);
- }
-
- public CreateNewFieldInitMethodRewriter(Dictionary> typeToNewFieldDeclarations, bool writeRewriteReasonAsComment)
- :base(writeRewriteReasonAsComment)
- {
- _typeToNewFieldDeclarations = typeToNewFieldDeclarations;
- }
-
- public override SyntaxNode VisitClassDeclaration(ClassDeclarationSyntax node)
- {
- var fullClassName = RoslynUtils.GetMemberFQDN(node, node.Identifier.ToString());
- if (!_typeToNewFieldDeclarations.TryGetValue(fullClassName, out var newClassFields))
- {
- LoggerScoped.LogWarning($"Unable to find new-fields for type: {fullClassName}, this is not an issue if there are no new fields for that type.");
- }
-
- Func getObjectFnSyntax = fieldDeclarationNode => fieldDeclarationNode.Declaration.Variables[0].Initializer?.Value //value captured from initializer
- ?? SyntaxFactory.DefaultExpression(SyntaxFactory.IdentifierName(fieldDeclarationNode.Declaration.Type.ToString()));
- var withDictionaryFieldNameToInitFieldValue = CreateNewFieldNameToGetObjectFnDictionary(node, newClassFields, getObjectFnSyntax, NewFieldsToCreateValueFnDictionaryFieldName);
-
- //TODO: slightly odd scenario 'When explicit #nullable enable is used, reference types should be rewritten to typeof(type) for initialization and value types should remain typeof(type?)'
- // Func getObjectTypeFnSyntax = fieldDeclarationNode => SyntaxFactory.TypeOfExpression(
- // SyntaxFactory.ParseTypeName(fieldDeclarationNode.Declaration.Type.ToFullString().Replace("?", ""))
- // );
- Func getObjectTypeFnSyntax = fieldDeclarationNode => SyntaxFactory.TypeOfExpression(fieldDeclarationNode.Declaration.Type);
- return CreateNewFieldNameToGetObjectFnDictionary(withDictionaryFieldNameToInitFieldValue, newClassFields, getObjectTypeFnSyntax, NewFieldsToGetTypeFnDictionaryFieldName);
- }
-
- private ClassDeclarationSyntax CreateNewFieldNameToGetObjectFnDictionary(ClassDeclarationSyntax node,
- List newClassFields, Func getObjectFnSyntax, string dictionaryFieldName)
- {
- var dictionaryKeyToInitValueNodes = newClassFields.SelectMany(fieldName =>
- {
- var fieldDeclarationNode = node.ChildNodes().OfType()
- .Single(f => f.Declaration.Variables.First().Identifier.ToString() == fieldName);
-
- return new[]
- {
- (SyntaxNodeOrToken)SyntaxFactory.AssignmentExpression(
- SyntaxKind.SimpleAssignmentExpression,
- SyntaxFactory.ImplicitElementAccess()
- .WithArgumentList(
- SyntaxFactory.BracketedArgumentList(
- SyntaxFactory.SingletonSeparatedList(
- SyntaxFactory.Argument(
- SyntaxFactory.LiteralExpression(
- SyntaxKind.StringLiteralExpression,
- SyntaxFactory.Literal(fieldDeclarationNode.Declaration.Variables.First()
- .Identifier.ToString())))))), //variable name
- SyntaxFactory.ParenthesizedLambdaExpression(getObjectFnSyntax(fieldDeclarationNode))),
- SyntaxFactory.Token(SyntaxKind.CommaToken) //comma, add for all
- };
- }).ToArray();
-
-
- var dictionaryInitializer =
- SyntaxFactory.InitializerExpression(
- SyntaxKind.ObjectInitializerExpression,
- SyntaxFactory.SeparatedList(
- dictionaryKeyToInitValueNodes.ToArray()
- ));
-
- var withDictionaryFieldNameToInitFieldValue = node.AddMembers(
- SyntaxFactory.FieldDeclaration(
- SyntaxFactory.VariableDeclaration(
- SyntaxFactory.GenericName(
- SyntaxFactory.Identifier(DictionaryFullNamespaceTypeName))
- .WithTypeArgumentList(
- SyntaxFactory.TypeArgumentList(
- SyntaxFactory.SeparatedList(
- new SyntaxNodeOrToken[]
- {
- SyntaxFactory.PredefinedType(
- SyntaxFactory.Token(SyntaxKind.StringKeyword)),
- SyntaxFactory.Token(SyntaxKind.CommaToken),
- SyntaxFactory.GenericName(
- SyntaxFactory.Identifier("global::System.Func"))
- .WithTypeArgumentList(
- SyntaxFactory.TypeArgumentList(
- SyntaxFactory.SingletonSeparatedList(
- SyntaxFactory.PredefinedType(
- SyntaxFactory.Token(SyntaxKind.ObjectKeyword)))))
- }))))
- .WithVariables(
- SyntaxFactory.SingletonSeparatedList(
- SyntaxFactory.VariableDeclarator(
- SyntaxFactory.Identifier(dictionaryFieldName))
- .WithInitializer(
- SyntaxFactory.EqualsValueClause(
- SyntaxFactory.ObjectCreationExpression(
- SyntaxFactory.GenericName(
- SyntaxFactory.Identifier(DictionaryFullNamespaceTypeName))
- .WithTypeArgumentList(
- SyntaxFactory.TypeArgumentList(
- SyntaxFactory.SeparatedList(
- new SyntaxNodeOrToken[]
- {
- SyntaxFactory.PredefinedType(
- SyntaxFactory.Token(SyntaxKind.StringKeyword)),
- SyntaxFactory.Token(SyntaxKind.CommaToken),
- SyntaxFactory.QualifiedName(
- SyntaxFactory.IdentifierName("global::System"),
- SyntaxFactory.GenericName(
- SyntaxFactory.Identifier("Func"))
- .WithTypeArgumentList(
- SyntaxFactory.TypeArgumentList(
- SyntaxFactory
- .SingletonSeparatedList<
- TypeSyntax>(
- SyntaxFactory
- .PredefinedType(
- SyntaxFactory.Token(
- SyntaxKind
- .ObjectKeyword))))))
- }))))
- .WithInitializer(dictionaryInitializer))))))
- .WithModifiers(
- SyntaxFactory.TokenList(
- SyntaxFactory.Token(SyntaxKind.PrivateKeyword),
- SyntaxFactory.Token(SyntaxKind.StaticKeyword)))
- .NormalizeWhitespace()
- .WithLeadingTrivia(SyntaxFactory.TriviaList(SyntaxFactory.ElasticCarriageReturnLineFeed))
- .WithTrailingTrivia(SyntaxFactory.TriviaList(SyntaxFactory.ElasticCarriageReturnLineFeed, SyntaxFactory.ElasticCarriageReturnLineFeed))
- );
- return AddRewriteCommentIfNeeded(withDictionaryFieldNameToInitFieldValue, $"{nameof(CreateNewFieldInitMethodRewriter)}", true);
- }
- }
-}
\ No newline at end of file
diff --git a/Assets/FastScriptReload/Scripts/Editor/Compilation/CodeRewriting/CreateNewFieldInitMethodRewriter.cs.meta b/Assets/FastScriptReload/Scripts/Editor/Compilation/CodeRewriting/CreateNewFieldInitMethodRewriter.cs.meta
deleted file mode 100644
index 1bda7b4..0000000
--- a/Assets/FastScriptReload/Scripts/Editor/Compilation/CodeRewriting/CreateNewFieldInitMethodRewriter.cs.meta
+++ /dev/null
@@ -1,10 +0,0 @@
-fileFormatVersion: 2
-guid: 6bbeaafe1bf54bda9b46e237bec3ccc0
-timeCreated: 1674215064
-AssetOrigin:
- serializedVersion: 1
- productId: 239351
- packageName: Fast Script Reload
- packageVersion: 1.6.1
- assetPath: Assets/FastScriptReload/Scripts/Editor/Compilation/CodeRewriting/CreateNewFieldInitMethodRewriter.cs
- uploadId: 710802
diff --git a/Assets/FastScriptReload/Scripts/Editor/Compilation/CodeRewriting/ExtensionMethodsCallingOtherExtensionMethodsInSameFileRewriter.cs b/Assets/FastScriptReload/Scripts/Editor/Compilation/CodeRewriting/ExtensionMethodsCallingOtherExtensionMethodsInSameFileRewriter.cs
deleted file mode 100644
index 21b7d2b..0000000
--- a/Assets/FastScriptReload/Scripts/Editor/Compilation/CodeRewriting/ExtensionMethodsCallingOtherExtensionMethodsInSameFileRewriter.cs
+++ /dev/null
@@ -1,74 +0,0 @@
-using System.Collections.Generic;
-using System.Linq;
-using Microsoft.CodeAnalysis;
-using Microsoft.CodeAnalysis.CSharp;
-using Microsoft.CodeAnalysis.CSharp.Syntax;
-
-namespace FastScriptReload.Editor.Compilation.CodeRewriting
-{
- // When calling other extension methods from same file compilation would fail with 'The call is ambiguous between the following methods or properties'
- class ExtensionMethodsCallingOtherExtensionMethodsInSameFileRewriter : FastScriptReloadCodeRewriterBase
- {
- private Dictionary> _typeNameToDeclaredMethodNameToThisArgName = new Dictionary>();
-
- public ExtensionMethodsCallingOtherExtensionMethodsInSameFileRewriter(bool writeRewriteReasonAsComment)
- : base(writeRewriteReasonAsComment)
- {
-
- }
-
- public override SyntaxNode VisitClassDeclaration(ClassDeclarationSyntax node)
- {
- var classDeclaredMethodNameToThisArgName = new Dictionary();
- _typeNameToDeclaredMethodNameToThisArgName[node.Identifier.Text] = classDeclaredMethodNameToThisArgName;
-
- foreach (var methodDeclaration in node.Members
- .Where(n => n.Kind() == SyntaxKind.MethodDeclaration)
- .Select(n => (MethodDeclarationSyntax)n))
- {
- var parameters = methodDeclaration.ParameterList.Parameters;
- if (parameters.Count > 0 && parameters[0].Modifiers.Any(SyntaxKind.ThisKeyword))
- {
- var thisArgumentName = parameters[0].Identifier.Text;
- classDeclaredMethodNameToThisArgName.TryAdd(methodDeclaration.Identifier.Text, thisArgumentName);
- }
- }
-
- return base.VisitClassDeclaration(node);
- }
-
- public override SyntaxNode VisitInvocationExpression(InvocationExpressionSyntax node)
- {
- // Check if the invocation is an instance method with a member access (e.g., selfName.CallingOtherTest())
- if (node.Expression is MemberAccessExpressionSyntax memberAccess)
- {
- var methodName = memberAccess.Name.Identifier.Text;
- var instanceArgName = memberAccess.Expression;
- var className = node.Ancestors().OfType().First().Identifier.Text;
- if (_typeNameToDeclaredMethodNameToThisArgName.TryGetValue(className, out var declaredMethodNameToThisArgName)
- && declaredMethodNameToThisArgName.TryGetValue(methodName, out var definedInstanceArgName))
- {
- if (instanceArgName.ToString() == definedInstanceArgName)
- {
- // Rewrite the invocation to a static method call
- var newInvocation = SyntaxFactory.InvocationExpression(SyntaxFactory.IdentifierName(methodName))
- .WithArgumentList(
- SyntaxFactory.ArgumentList(
- SyntaxFactory.SeparatedList(
- node.ArgumentList.Arguments.Insert(0, SyntaxFactory.Argument(instanceArgName)) // Add instance as first argument
- )
- )
- ).NormalizeWhitespace();
-
- return AddRewriteCommentIfNeeded(
- newInvocation,
- $"{nameof(ExtensionMethodsCallingOtherExtensionMethodsInSameFileRewriter)}:Replaced extension method call with static call"
- );
- }
- }
- }
-
- return base.VisitInvocationExpression(node);
- }
- }
-}
\ No newline at end of file
diff --git a/Assets/FastScriptReload/Scripts/Editor/Compilation/CodeRewriting/ExtensionMethodsCallingOtherExtensionMethodsInSameFileRewriter.cs.meta b/Assets/FastScriptReload/Scripts/Editor/Compilation/CodeRewriting/ExtensionMethodsCallingOtherExtensionMethodsInSameFileRewriter.cs.meta
deleted file mode 100644
index 7b2efaa..0000000
--- a/Assets/FastScriptReload/Scripts/Editor/Compilation/CodeRewriting/ExtensionMethodsCallingOtherExtensionMethodsInSameFileRewriter.cs.meta
+++ /dev/null
@@ -1,10 +0,0 @@
-fileFormatVersion: 2
-guid: 9f739c197f9040efabf7f64461882d7b
-timeCreated: 1727194643
-AssetOrigin:
- serializedVersion: 1
- productId: 239351
- packageName: Fast Script Reload
- packageVersion: 1.6.1
- assetPath: Assets/FastScriptReload/Scripts/Editor/Compilation/CodeRewriting/ExtensionMethodsCallingOtherExtensionMethodsInSameFileRewriter.cs
- uploadId: 710802
diff --git a/Assets/FastScriptReload/Scripts/Editor/Compilation/CodeRewriting/FastScriptReloadCodeRewriterBase.cs b/Assets/FastScriptReload/Scripts/Editor/Compilation/CodeRewriting/FastScriptReloadCodeRewriterBase.cs
deleted file mode 100644
index afa01a7..0000000
--- a/Assets/FastScriptReload/Scripts/Editor/Compilation/CodeRewriting/FastScriptReloadCodeRewriterBase.cs
+++ /dev/null
@@ -1,64 +0,0 @@
-using Microsoft.CodeAnalysis;
-using Microsoft.CodeAnalysis.CSharp;
-
-namespace FastScriptReload.Editor.Compilation.CodeRewriting
-{
- public abstract class FastScriptReloadCodeRewriterBase : CSharpSyntaxRewriter
- {
- protected readonly bool _writeRewriteReasonAsComment;
-
- protected FastScriptReloadCodeRewriterBase(bool writeRewriteReasonAsComment, bool visitIntoStructuredTrivia = false) : base(visitIntoStructuredTrivia)
- {
- _writeRewriteReasonAsComment = writeRewriteReasonAsComment;
- }
-
- protected SyntaxToken AddRewriteCommentIfNeeded(SyntaxToken syntaxToken, string commentText, bool append = false)
- {
- return AddRewriteCommentIfNeeded(syntaxToken, commentText, _writeRewriteReasonAsComment, append);
- }
-
- public static SyntaxToken AddRewriteCommentIfNeeded(SyntaxToken syntaxToken, string commentText, bool writeRewriteReasonAsComment, bool append)
- {
- if (writeRewriteReasonAsComment)
- {
- if (append)
- {
- return syntaxToken.WithLeadingTrivia(
- syntaxToken.LeadingTrivia.Add(SyntaxFactory.Comment($"/*FSR:{commentText}*/")));
- }
- else
- {
- return syntaxToken.WithTrailingTrivia(
- syntaxToken.TrailingTrivia.Add(SyntaxFactory.Comment($"/*FSR:{commentText}*/")));
- }
- }
-
- return syntaxToken;
- }
-
- protected T AddRewriteCommentIfNeeded(T syntaxNode, string commentText, bool append = false)
- where T : SyntaxNode
- {
- return AddRewriteCommentIfNeeded(syntaxNode, commentText, _writeRewriteReasonAsComment, append);
- }
-
- public static T AddRewriteCommentIfNeeded(T syntaxNode, string commentText, bool writeRewriteReasonAsComment, bool append) where T : SyntaxNode
- {
- if (writeRewriteReasonAsComment)
- {
- if (append)
- {
- return syntaxNode.WithLeadingTrivia(syntaxNode.GetLeadingTrivia()
- .Add(SyntaxFactory.Comment($"/*FSR:{commentText}*/")));
- }
- else
- {
- return syntaxNode.WithTrailingTrivia(syntaxNode.GetTrailingTrivia()
- .Add(SyntaxFactory.Comment($"/*FSR:{commentText}*/")));
- }
- }
-
- return syntaxNode;
- }
- }
-}
\ No newline at end of file
diff --git a/Assets/FastScriptReload/Scripts/Editor/Compilation/CodeRewriting/FastScriptReloadCodeRewriterBase.cs.meta b/Assets/FastScriptReload/Scripts/Editor/Compilation/CodeRewriting/FastScriptReloadCodeRewriterBase.cs.meta
deleted file mode 100644
index 6288f64..0000000
--- a/Assets/FastScriptReload/Scripts/Editor/Compilation/CodeRewriting/FastScriptReloadCodeRewriterBase.cs.meta
+++ /dev/null
@@ -1,10 +0,0 @@
-fileFormatVersion: 2
-guid: bcc848f0140d41cdbf1003b0f594694e
-timeCreated: 1677233811
-AssetOrigin:
- serializedVersion: 1
- productId: 239351
- packageName: Fast Script Reload
- packageVersion: 1.6.1
- assetPath: Assets/FastScriptReload/Scripts/Editor/Compilation/CodeRewriting/FastScriptReloadCodeRewriterBase.cs
- uploadId: 710802
diff --git a/Assets/FastScriptReload/Scripts/Editor/Compilation/CodeRewriting/FieldsWalker.cs b/Assets/FastScriptReload/Scripts/Editor/Compilation/CodeRewriting/FieldsWalker.cs
deleted file mode 100644
index 282ca79..0000000
--- a/Assets/FastScriptReload/Scripts/Editor/Compilation/CodeRewriting/FieldsWalker.cs
+++ /dev/null
@@ -1,43 +0,0 @@
-using System.Collections.Generic;
-using System.Linq;
-using Microsoft.CodeAnalysis.CSharp;
-using Microsoft.CodeAnalysis.CSharp.Syntax;
-
-namespace FastScriptReload.Editor.Compilation.CodeRewriting
-{
- class FieldsWalker : CSharpSyntaxWalker {
- private readonly Dictionary> _typeNameToFieldDeclarations = new Dictionary>();
-
- public override void VisitClassDeclaration(ClassDeclarationSyntax node)
- {
- var className = node.Identifier;
- var fullClassName = RoslynUtils.GetMemberFQDN(node, className.ToString());
- if(!_typeNameToFieldDeclarations.ContainsKey(fullClassName)) {
- _typeNameToFieldDeclarations[fullClassName] = new List();
- }
-
- base.VisitClassDeclaration(node);
- }
-
- public override void VisitFieldDeclaration(FieldDeclarationSyntax node)
- {
- var fieldName = node.Declaration.Variables.First().Identifier.ToString();
- var fullClassName = RoslynUtils.GetMemberFQDNWithoutMemberName(node);
- if(!_typeNameToFieldDeclarations.ContainsKey(fullClassName)) {
- _typeNameToFieldDeclarations[fullClassName] = new List();
- }
-
- _typeNameToFieldDeclarations[fullClassName].Add(new NewFieldDeclaration(fieldName, node.Declaration.Type.ToString(), node));
-
- base.VisitFieldDeclaration(node);
- }
-
- public Dictionary> GetTypeToFieldDeclarations() {
- return _typeNameToFieldDeclarations;
- }
-
- public List GetTypeNames() {
- return _typeNameToFieldDeclarations.Select(kv => kv.Key).ToList();
- }
- }
-}
\ No newline at end of file
diff --git a/Assets/FastScriptReload/Scripts/Editor/Compilation/CodeRewriting/FieldsWalker.cs.meta b/Assets/FastScriptReload/Scripts/Editor/Compilation/CodeRewriting/FieldsWalker.cs.meta
deleted file mode 100644
index 51dd9dc..0000000
--- a/Assets/FastScriptReload/Scripts/Editor/Compilation/CodeRewriting/FieldsWalker.cs.meta
+++ /dev/null
@@ -1,10 +0,0 @@
-fileFormatVersion: 2
-guid: e4a18d5133af410bab07d9c1a973fe7a
-timeCreated: 1672993042
-AssetOrigin:
- serializedVersion: 1
- productId: 239351
- packageName: Fast Script Reload
- packageVersion: 1.6.1
- assetPath: Assets/FastScriptReload/Scripts/Editor/Compilation/CodeRewriting/FieldsWalker.cs
- uploadId: 710802
diff --git a/Assets/FastScriptReload/Scripts/Editor/Compilation/CodeRewriting/HotReloadCompliantRewriter.cs b/Assets/FastScriptReload/Scripts/Editor/Compilation/CodeRewriting/HotReloadCompliantRewriter.cs
deleted file mode 100644
index df628a3..0000000
--- a/Assets/FastScriptReload/Scripts/Editor/Compilation/CodeRewriting/HotReloadCompliantRewriter.cs
+++ /dev/null
@@ -1,71 +0,0 @@
-using System.Collections.Generic;
-using FastScriptReload.Runtime;
-using Microsoft.CodeAnalysis;
-using Microsoft.CodeAnalysis.CSharp;
-using Microsoft.CodeAnalysis.CSharp.Syntax;
-
-namespace FastScriptReload.Editor.Compilation.CodeRewriting
-{
- class HotReloadCompliantRewriter : FastScriptReloadCodeRewriterBase
- {
- public List StrippedUsingDirectives = new List();
- public List OriginalIdentifiersRenamedToContainPatchedPostfix = new List();
-
- public HotReloadCompliantRewriter(bool writeRewriteReasonAsComment, bool visitIntoStructuredTrivia = false)
- : base(writeRewriteReasonAsComment, visitIntoStructuredTrivia)
- {
- }
-
- public override SyntaxNode VisitClassDeclaration(ClassDeclarationSyntax node)
- {
- return AddPatchedPostfixToTopLevelDeclarations(node, node.Identifier);
- //if subclasses need to be adjusted, it's done via recursion.
- // foreach (var childNode in node.ChildNodes().OfType())
- // {
- // var changed = Visit(childNode);
- // node = node.ReplaceNode(childNode, changed);
- // }
- }
-
- public override SyntaxNode VisitStructDeclaration(StructDeclarationSyntax node)
- {
- return AddPatchedPostfixToTopLevelDeclarations(node, node.Identifier);
- }
-
- public override SyntaxNode VisitEnumDeclaration(EnumDeclarationSyntax node)
- {
- return AddPatchedPostfixToTopLevelDeclarations(node, node.Identifier);
- }
-
- public override SyntaxNode VisitDelegateDeclaration(DelegateDeclarationSyntax node)
- {
- return AddPatchedPostfixToTopLevelDeclarations(node, node.Identifier);
- }
-
- public override SyntaxNode VisitInterfaceDeclaration(InterfaceDeclarationSyntax node)
- {
- return AddPatchedPostfixToTopLevelDeclarations(node, node.Identifier);
- }
-
- public override SyntaxNode VisitUsingDirective(UsingDirectiveSyntax node)
- {
- if (node.Parent is CompilationUnitSyntax)
- {
- StrippedUsingDirectives.Add(node.ToFullString());
- return null;
- }
-
- return base.VisitUsingDirective(node);
- }
-
- private SyntaxNode AddPatchedPostfixToTopLevelDeclarations(CSharpSyntaxNode node, SyntaxToken identifier)
- {
- OriginalIdentifiersRenamedToContainPatchedPostfix.Add(identifier.ValueText);
-
- var newIdentifier = SyntaxFactory.Identifier(identifier + AssemblyChangesLoader.ClassnamePatchedPostfix);
- newIdentifier = AddRewriteCommentIfNeeded(newIdentifier, $"{nameof(HotReloadCompliantRewriter)}:{nameof(AddPatchedPostfixToTopLevelDeclarations)}");
- node = node.ReplaceToken(identifier, newIdentifier);
- return node;
- }
- }
-}
\ No newline at end of file
diff --git a/Assets/FastScriptReload/Scripts/Editor/Compilation/CodeRewriting/HotReloadCompliantRewriter.cs.meta b/Assets/FastScriptReload/Scripts/Editor/Compilation/CodeRewriting/HotReloadCompliantRewriter.cs.meta
deleted file mode 100644
index 20c4aff..0000000
--- a/Assets/FastScriptReload/Scripts/Editor/Compilation/CodeRewriting/HotReloadCompliantRewriter.cs.meta
+++ /dev/null
@@ -1,10 +0,0 @@
-fileFormatVersion: 2
-guid: f75e3e02acfa4397a558a923f7fa4f8e
-timeCreated: 1672993042
-AssetOrigin:
- serializedVersion: 1
- productId: 239351
- packageName: Fast Script Reload
- packageVersion: 1.6.1
- assetPath: Assets/FastScriptReload/Scripts/Editor/Compilation/CodeRewriting/HotReloadCompliantRewriter.cs
- uploadId: 710802
diff --git a/Assets/FastScriptReload/Scripts/Editor/Compilation/CodeRewriting/ManualUserDefinedScriptOverridesRewriter.cs b/Assets/FastScriptReload/Scripts/Editor/Compilation/CodeRewriting/ManualUserDefinedScriptOverridesRewriter.cs
deleted file mode 100644
index a08ef94..0000000
--- a/Assets/FastScriptReload/Scripts/Editor/Compilation/CodeRewriting/ManualUserDefinedScriptOverridesRewriter.cs
+++ /dev/null
@@ -1,127 +0,0 @@
-using System;
-using System.Linq;
-using Microsoft.CodeAnalysis;
-using Microsoft.CodeAnalysis.CSharp.Syntax;
-
-namespace FastScriptReload.Editor.Compilation.CodeRewriting
-{
- public class ManualUserDefinedScriptOverridesRewriter : FastScriptReloadCodeRewriterBase
- {
- private readonly SyntaxNode _userDefinedOverridesRoot;
-
- public ManualUserDefinedScriptOverridesRewriter(SyntaxNode userDefinedOverridesRoot, bool writeRewriteReasonAsComment, bool visitIntoStructuredTrivia = false)
- : base(writeRewriteReasonAsComment, visitIntoStructuredTrivia)
- {
- _userDefinedOverridesRoot = userDefinedOverridesRoot;
- }
-
- //TODO: refactor to use OverrideDeclarationWithMatchingUserDefinedIfExists
- public override SyntaxNode VisitConversionOperatorDeclaration(ConversionOperatorDeclarationSyntax node)
- {
- var methodFQDN = RoslynUtils.GetMemberFQDN(node, "operator");
- var matchingInOverride = _userDefinedOverridesRoot.DescendantNodes()
- //implicit conversion operators do not have name, just parameter list
- .OfType()
- .FirstOrDefault(m => m.ParameterList.ToString() == node.ParameterList.ToString() //parameter lists is type / order / names, all good for targetting if there's a proper match
- && methodFQDN == RoslynUtils.GetMemberFQDN(m, "operator") //make sure same FQDN, even though there's no name there could be more implicit operators in file
- );
-
- if (matchingInOverride != null)
- {
- return AddRewriteCommentIfNeeded(matchingInOverride.WithTriviaFrom(node), $"User defined custom conversion override", true);
- }
- else {
- return base.VisitConversionOperatorDeclaration(node);
- }
- }
-
- //TODO: refactor to use OverrideDeclarationWithMatchingUserDefinedIfExists
- public override SyntaxNode VisitMethodDeclaration(MethodDeclarationSyntax node)
- {
- var methodName = node.Identifier.ValueText;
- var methodFQDN = RoslynUtils.GetMemberFQDN(node, node.Identifier.ToString());
- var matchingInOverride = _userDefinedOverridesRoot.DescendantNodes()
- .OfType()
- .FirstOrDefault(m => m.Identifier.ValueText == methodName
- && m.ParameterList.Parameters.Count == node.ParameterList.Parameters.Count
- && m.ParameterList.ToString() == node.ParameterList.ToString() //parameter lists is type / order / names, all good for targetting if there's a proper match
- && m.TypeParameterList?.ToString() == node.TypeParameterList?.ToString() //typed paratemets are for generics, also check
- && methodFQDN == RoslynUtils.GetMemberFQDN(m, m.Identifier.ToString()) //last check for mathod FQDN (potentially slower than others)
- );
-
- if (matchingInOverride != null)
- {
- return AddRewriteCommentIfNeeded(matchingInOverride.WithTriviaFrom(node), $"User defined custom method override", true);
- }
- else {
- return base.VisitMethodDeclaration(node);
- }
- }
-
-
- public override SyntaxNode VisitConstructorDeclaration(ConstructorDeclarationSyntax node)
- {
- return OverrideDeclarationWithMatchingUserDefinedIfExists(
- node,
- (d) => d.Identifier.ValueText,
- (d) => HasSameParametersPredicate(node.ParameterList)(d.ParameterList),
- (d) => base.VisitConstructorDeclaration(d)
- );
- }
-
- public override SyntaxNode VisitDestructorDeclaration(DestructorDeclarationSyntax node)
- {
- return OverrideDeclarationWithMatchingUserDefinedIfExists(
- node,
- (d) => d.Identifier.ValueText,
- (d) => HasSameParametersPredicate(node.ParameterList)(d.ParameterList),
- (d) => base.VisitDestructorDeclaration(d)
- );
- }
-
- public override SyntaxNode VisitPropertyDeclaration(PropertyDeclarationSyntax node)
- {
- return OverrideDeclarationWithMatchingUserDefinedIfExists(
- node,
- (d) => d.Identifier.ValueText,
- (d) => true,
- (d) => base.VisitPropertyDeclaration(d)
- );
- }
-
- private SyntaxNode OverrideDeclarationWithMatchingUserDefinedIfExists(T node, Func getName,
- Func customFindMatchInOverridePredicate, Func visitDefault)
- where T: MemberDeclarationSyntax
- {
- var name = getName(node);
- var fqdn = RoslynUtils.GetMemberFQDN(node, name);
- var matchingInOverride = _userDefinedOverridesRoot.DescendantNodes()
- .OfType()
- .FirstOrDefault(d =>
- {
- var declarationName = getName(d);
- return declarationName == name
- && customFindMatchInOverridePredicate(d)
- && fqdn == RoslynUtils.GetMemberFQDN(d, declarationName); //last check for mathod FQDN (potentially slower than others)
- }
-
- );
-
- if (matchingInOverride != null)
- {
- return AddRewriteCommentIfNeeded(matchingInOverride.WithTriviaFrom(node),
- $"User defined custom {typeof(T)} override", true);
- }
- else
- {
- return visitDefault(node);
- }
- }
-
- private Func HasSameParametersPredicate(ParameterListSyntax parameters)
- {
- return (resolvedParams) => resolvedParams.Parameters.Count == parameters.Parameters.Count
- && resolvedParams.ToString() == parameters.ToString();
- }
- }
-}
\ No newline at end of file
diff --git a/Assets/FastScriptReload/Scripts/Editor/Compilation/CodeRewriting/ManualUserDefinedScriptOverridesRewriter.cs.meta b/Assets/FastScriptReload/Scripts/Editor/Compilation/CodeRewriting/ManualUserDefinedScriptOverridesRewriter.cs.meta
deleted file mode 100644
index 79d0611..0000000
--- a/Assets/FastScriptReload/Scripts/Editor/Compilation/CodeRewriting/ManualUserDefinedScriptOverridesRewriter.cs.meta
+++ /dev/null
@@ -1,10 +0,0 @@
-fileFormatVersion: 2
-guid: 7d61f64c891c45b68a7db1ea67854127
-timeCreated: 1678101034
-AssetOrigin:
- serializedVersion: 1
- productId: 239351
- packageName: Fast Script Reload
- packageVersion: 1.6.1
- assetPath: Assets/FastScriptReload/Scripts/Editor/Compilation/CodeRewriting/ManualUserDefinedScriptOverridesRewriter.cs
- uploadId: 710802
diff --git a/Assets/FastScriptReload/Scripts/Editor/Compilation/CodeRewriting/NewFieldDeclaration.cs b/Assets/FastScriptReload/Scripts/Editor/Compilation/CodeRewriting/NewFieldDeclaration.cs
deleted file mode 100644
index b97ecad..0000000
--- a/Assets/FastScriptReload/Scripts/Editor/Compilation/CodeRewriting/NewFieldDeclaration.cs
+++ /dev/null
@@ -1,18 +0,0 @@
-using Microsoft.CodeAnalysis.CSharp.Syntax;
-
-namespace FastScriptReload.Editor.Compilation.CodeRewriting
-{
- public class NewFieldDeclaration
- {
- public string FieldName { get; }
- public string TypeName { get; }
- public FieldDeclarationSyntax FieldDeclarationSyntax { get; } //TODO: PERF: will that block whole tree from being garbage collected
-
- public NewFieldDeclaration(string fieldName, string typeName, FieldDeclarationSyntax fieldDeclarationSyntax)
- {
- FieldName = fieldName;
- TypeName = typeName;
- FieldDeclarationSyntax = fieldDeclarationSyntax;
- }
- }
-}
\ No newline at end of file
diff --git a/Assets/FastScriptReload/Scripts/Editor/Compilation/CodeRewriting/NewFieldDeclaration.cs.meta b/Assets/FastScriptReload/Scripts/Editor/Compilation/CodeRewriting/NewFieldDeclaration.cs.meta
deleted file mode 100644
index 82e7fe9..0000000
--- a/Assets/FastScriptReload/Scripts/Editor/Compilation/CodeRewriting/NewFieldDeclaration.cs.meta
+++ /dev/null
@@ -1,10 +0,0 @@
-fileFormatVersion: 2
-guid: ad6e49db99ff4065b14a3fc416af560b
-timeCreated: 1673019285
-AssetOrigin:
- serializedVersion: 1
- productId: 239351
- packageName: Fast Script Reload
- packageVersion: 1.6.1
- assetPath: Assets/FastScriptReload/Scripts/Editor/Compilation/CodeRewriting/NewFieldDeclaration.cs
- uploadId: 710802
diff --git a/Assets/FastScriptReload/Scripts/Editor/Compilation/CodeRewriting/NewFieldsRewriter.cs b/Assets/FastScriptReload/Scripts/Editor/Compilation/CodeRewriting/NewFieldsRewriter.cs
deleted file mode 100644
index 0a7a319..0000000
--- a/Assets/FastScriptReload/Scripts/Editor/Compilation/CodeRewriting/NewFieldsRewriter.cs
+++ /dev/null
@@ -1,144 +0,0 @@
-using System;
-using System.Collections.Generic;
-using System.Linq;
-using System.Reflection;
-using FastScriptReload.Runtime;
-using FastScriptReload.Scripts.Runtime;
-using ImmersiveVrToolsCommon.Runtime.Logging;
-using Microsoft.CodeAnalysis;
-using Microsoft.CodeAnalysis.CSharp;
-using Microsoft.CodeAnalysis.CSharp.Syntax;
-
-namespace FastScriptReload.Editor.Compilation.CodeRewriting
-{
- class NewFieldsRewriter : FastScriptReloadCodeRewriterBase
- {
- private readonly Dictionary> _typeToNewFieldDeclarations;
-
- public NewFieldsRewriter(Dictionary> typeToNewFieldDeclarations, bool writeRewriteReasonAsComment)
- :base(writeRewriteReasonAsComment)
- {
- _typeToNewFieldDeclarations = typeToNewFieldDeclarations;
- }
-
- public static List GetReplaceableMembers(Type type)
- { //TODO: later other might need to be included? props?
- return type.GetFields(BindingFlags.Instance | BindingFlags.Static | BindingFlags.Public | BindingFlags.NonPublic).Cast().ToList();
- }
-
-
- public override SyntaxNode VisitInvocationExpression(InvocationExpressionSyntax node)
- {
- if (node.Expression.ToString() == "nameof")
- {
- var classNode = node.Ancestors().OfType().FirstOrDefault();
- if (classNode != null)
- {
- var fullClassName = RoslynUtils.GetMemberFQDN(classNode, classNode.Identifier.ToString());
- if (!string.IsNullOrEmpty(fullClassName))
- {
- var nameofExpressionParts = node.ArgumentList.Arguments.First().ToFullString().Split('.'); //nameof could have multiple . like NewFieldCustomClass.FieldInThatClass
- var fieldName = nameofExpressionParts.First(); // should take first part only to determine if new field eg. 'NewFieldCustomClass'
- if (_typeToNewFieldDeclarations.TryGetValue(fullClassName, out var allNewFieldNamesForClass))
- {
- if (allNewFieldNamesForClass.Contains(fieldName))
- {
- return AddRewriteCommentIfNeeded(
- SyntaxFactory.LiteralExpression(SyntaxKind.StringLiteralExpression, SyntaxFactory.Literal(nameofExpressionParts.Last())), // should take last part only to for actual string eg. 'FieldInThatClass'
- $"{nameof(NewFieldsRewriter)}:{nameof(VisitInvocationExpression)}");
- }
-
- }
- }
- }
- }
-
- return base.VisitInvocationExpression(node);
- }
-
- public override SyntaxNode VisitIdentifierName(IdentifierNameSyntax node)
- {
- var classNode = node.Ancestors().OfType().FirstOrDefault();
- if (classNode != null)
- {
- var fullClassName = RoslynUtils.GetMemberFQDN(classNode, classNode.Identifier.ToString());
- if (!string.IsNullOrEmpty(fullClassName))
- {
- var fieldName = node.Identifier.ToString();
- if (_typeToNewFieldDeclarations.TryGetValue(fullClassName, out var allNewFieldNamesForClass))
- {
- if (allNewFieldNamesForClass.Contains(fieldName))
- {
- if(node.Parent is MemberAccessExpressionSyntax memberAccessExpressionSyntax)
- {
- //for member access expressions only rewrite if used with .this, eg this.NewField, that prevents rewriting of static class fields with same name
- if (!memberAccessExpressionSyntax.ToString().StartsWith("this."))
- {
- return base.VisitIdentifierName(node);
- }
- }
-
- var isNameOfExpression = node.Ancestors().OfType().Any(e => e.Expression.ToString() == "nameof");
- if (!isNameOfExpression) //nameof expression will be rewritten via VisitInvocationExpression
- {
- return
- AddRewriteCommentIfNeeded(
- SyntaxFactory.MemberAccessExpression(
- SyntaxKind.SimpleMemberAccessExpression,
- SyntaxFactory.InvocationExpression(
- SyntaxFactory.MemberAccessExpression(
- SyntaxKind.SimpleMemberAccessExpression,
- SyntaxFactory.IdentifierName(typeof(TemporaryNewFieldValues).FullName),
- SyntaxFactory.GenericName(
- SyntaxFactory.Identifier(nameof(TemporaryNewFieldValues.ResolvePatchedObject)))
- .WithTypeArgumentList(
- SyntaxFactory.TypeArgumentList(
- SyntaxFactory.SingletonSeparatedList(
- SyntaxFactory.IdentifierName(fullClassName + AssemblyChangesLoader.ClassnamePatchedPostfix))))))
- .WithArgumentList(
- SyntaxFactory.ArgumentList(
- SyntaxFactory.SingletonSeparatedList(
- SyntaxFactory.Argument(
- SyntaxFactory.ThisExpression())))),
- SyntaxFactory.IdentifierName(fieldName))
- .WithTriviaFrom(node),
- $"{nameof(NewFieldsRewriter)}:{nameof(VisitIdentifierName)}"
- );
- }
- }
- }
- else
- {
- LoggerScoped.LogWarning($"Unable to find type: {fullClassName}");
- }
- }
- }
-
- return base.VisitIdentifierName(node);
- }
-
- public override SyntaxNode VisitFieldDeclaration(FieldDeclarationSyntax node)
- {
- var fieldName = node.Declaration.Variables.First().Identifier.ToString();
- var fullClassName = RoslynUtils.GetMemberFQDNWithoutMemberName(node);
-
- if (_typeToNewFieldDeclarations.TryGetValue(fullClassName, out var newFields))
- {
- if (newFields.Contains(fieldName))
- {
- var existingLeading = node.GetLeadingTrivia();
- var existingTrailing = node.GetTrailingTrivia();
-
- return AddRewriteCommentIfNeeded(
- node
- .WithLeadingTrivia(existingLeading.Add(SyntaxFactory.Comment("/* ")))
- .WithTrailingTrivia(existingTrailing.Insert(0, SyntaxFactory.Comment(" */ //Auto-excluded to prevent exceptions - see docs"))),
- $"{nameof(NewFieldsRewriter)}:{nameof(VisitFieldDeclaration)}"
- );
- }
- }
-
- return base.VisitFieldDeclaration(node);
- }
- }
-}
\ No newline at end of file
diff --git a/Assets/FastScriptReload/Scripts/Editor/Compilation/CodeRewriting/NewFieldsRewriter.cs.meta b/Assets/FastScriptReload/Scripts/Editor/Compilation/CodeRewriting/NewFieldsRewriter.cs.meta
deleted file mode 100644
index 30a4f03..0000000
--- a/Assets/FastScriptReload/Scripts/Editor/Compilation/CodeRewriting/NewFieldsRewriter.cs.meta
+++ /dev/null
@@ -1,10 +0,0 @@
-fileFormatVersion: 2
-guid: 0e9e687bdfc0444395deab1e7c68ed3f
-timeCreated: 1672993042
-AssetOrigin:
- serializedVersion: 1
- productId: 239351
- packageName: Fast Script Reload
- packageVersion: 1.6.1
- assetPath: Assets/FastScriptReload/Scripts/Editor/Compilation/CodeRewriting/NewFieldsRewriter.cs
- uploadId: 710802
diff --git a/Assets/FastScriptReload/Scripts/Editor/Compilation/CodeRewriting/Partials.meta b/Assets/FastScriptReload/Scripts/Editor/Compilation/CodeRewriting/Partials.meta
deleted file mode 100644
index 87b3fb4..0000000
--- a/Assets/FastScriptReload/Scripts/Editor/Compilation/CodeRewriting/Partials.meta
+++ /dev/null
@@ -1,3 +0,0 @@
-fileFormatVersion: 2
-guid: 919d4ff85d4d4156bddf5c48bcc99da1
-timeCreated: 1719699288
\ No newline at end of file
diff --git a/Assets/FastScriptReload/Scripts/Editor/Compilation/CodeRewriting/Partials/PartialClassFinder.cs b/Assets/FastScriptReload/Scripts/Editor/Compilation/CodeRewriting/Partials/PartialClassFinder.cs
deleted file mode 100644
index ec56282..0000000
--- a/Assets/FastScriptReload/Scripts/Editor/Compilation/CodeRewriting/Partials/PartialClassFinder.cs
+++ /dev/null
@@ -1,87 +0,0 @@
-using System;
-using System.Collections.Generic;
-using System.IO;
-using System.Linq;
-using UnityEngine;
-
-public static class PartialClassFinder
-{
- //TODO: optimize lookup, currently this loads all files in directory and checks if they have 'partial' string in them. For directories with many files this will not be sufficient
- public static IEnumerable FindPartialClassFilesInDirectory(string filePath, int maxDepth = int.MaxValue)
- {
- if (string.IsNullOrEmpty(filePath) || !File.Exists(filePath))
- return Enumerable.Empty();
-
- string directory = Path.GetDirectoryName(filePath);
- string fileContent = File.ReadAllText(filePath);
-
- string partialClassName = ExtractPartialClassName(fileContent);
- if (string.IsNullOrEmpty(partialClassName))
- {
- Debug.LogWarning($"No partial class/struct found in file: {filePath}");
- return Enumerable.Empty();
- }
-
- return FindPartialClassFilesRecursively(directory, partialClassName, maxDepth, currentDepth: 0);
- }
-
- private static IEnumerable FindPartialClassFilesRecursively(string directory, string partialClassName, int maxDepth, int currentDepth)
- {
- var files = new List();
-
- try
- {
- // Search in current directory
- files.AddRange(Directory.GetFiles(directory, "*.cs")
- .Where(file => IsPartialClassFile(file, partialClassName)));
-
- // If we haven't reached max depth, search in subdirectories
- if (currentDepth < maxDepth)
- {
- foreach (var subDir in Directory.GetDirectories(directory))
- {
- files.AddRange(FindPartialClassFilesRecursively(subDir, partialClassName, maxDepth, currentDepth + 1));
- }
- }
- }
- catch (UnauthorizedAccessException ex)
- {
- Debug.LogWarning($"Access denied to directory: {directory}. Error: {ex.Message}");
- }
- catch (Exception ex)
- {
- Debug.LogError($"Error searching directory: {directory}. Error: {ex.Message}");
- }
-
- return files;
- }
-
- private static bool IsPartialClassFile(string filePath, string className)
- {
- try
- {
- string content = File.ReadAllText(filePath);
- return content.Contains($"partial class {className}")
- || content.Contains($"partial struct {className}");
- }
- catch (Exception ex)
- {
- Debug.LogError($"Error reading file: {filePath}. Error: {ex.Message}");
- return false;
- }
- }
-
- private static string ExtractPartialClassName(string fileContent)
- {
- // This is a simple implementation and might need to be more robust
- // depending on your specific needs
- var partialClassDeclaration = fileContent.Split(new[] { "partial class", "partial struct" }, StringSplitOptions.RemoveEmptyEntries)
- .Skip(1)
- .FirstOrDefault();
-
- if (partialClassDeclaration == null)
- return string.Empty;
-
- return partialClassDeclaration.TrimStart().Split(new[] { ' ', '{', ':' }, StringSplitOptions.RemoveEmptyEntries).FirstOrDefault().Trim();
- }
-}
diff --git a/Assets/FastScriptReload/Scripts/Editor/Compilation/CodeRewriting/Partials/PartialClassFinder.cs.meta b/Assets/FastScriptReload/Scripts/Editor/Compilation/CodeRewriting/Partials/PartialClassFinder.cs.meta
deleted file mode 100644
index b2d7926..0000000
--- a/Assets/FastScriptReload/Scripts/Editor/Compilation/CodeRewriting/Partials/PartialClassFinder.cs.meta
+++ /dev/null
@@ -1,10 +0,0 @@
-fileFormatVersion: 2
-guid: 6f182f9db524441e80f367f8f99d8a5f
-timeCreated: 1719778688
-AssetOrigin:
- serializedVersion: 1
- productId: 239351
- packageName: Fast Script Reload
- packageVersion: 1.6.1
- assetPath: Assets/FastScriptReload/Scripts/Editor/Compilation/CodeRewriting/Partials/PartialClassFinder.cs
- uploadId: 710802
diff --git a/Assets/FastScriptReload/Scripts/Editor/Compilation/CodeRewriting/Partials/PartialTreeProcessor.cs b/Assets/FastScriptReload/Scripts/Editor/Compilation/CodeRewriting/Partials/PartialTreeProcessor.cs
deleted file mode 100644
index 021864f..0000000
--- a/Assets/FastScriptReload/Scripts/Editor/Compilation/CodeRewriting/Partials/PartialTreeProcessor.cs
+++ /dev/null
@@ -1,92 +0,0 @@
-using System.Collections.Generic;
-using System.IO;
-using System.Linq;
-using Microsoft.CodeAnalysis;
-using Microsoft.CodeAnalysis.CSharp;
-using Microsoft.CodeAnalysis.CSharp.Syntax;
-
-namespace FastScriptReload.Editor.Compilation.CodeRewriting
-{
- internal static class PartialTreeProcessor
- {
- ///
- /// Processes a syntax tree containing partial type definitions, merging it with other partial definitions found in the same directory.
- ///
- /// The original syntax tree to process.
- /// A collection of defined preprocessor symbols.
- /// A new SyntaxTree with merged partial types and added InternalsVisibleTo attribute.
- ///
- /// This method performs the following steps:
- /// 1. Checks if the tree contains partial types.
- /// 2. If it does, processes the current tree and other partial files in the same directory.
- /// 3. Combines all partial type declarations.
- /// 4. Creates a new compilation unit with merged types and using directives.
- /// 5. Adds the InternalsVisibleTo attribute to the resulting tree.
- ///
- internal static SyntaxTree ProcessPartialTree(SyntaxTree tree, IEnumerable definedPreprocessorSymbols)
- {
- if (!HasPartialTypes(tree))
- {
- return tree;
- }
-
- var combinedTypes = new Dictionary>();
- var combinedUsingDirectives = new HashSet();
- var combinedTypesDefined = new HashSet();
-
- ProcessTree(tree, combinedTypes, combinedUsingDirectives, combinedTypesDefined);
-
- const int fileSearchMaxDepth = 5;
- var otherPartialFiles = PartialClassFinder.FindPartialClassFilesInDirectory(tree.FilePath, fileSearchMaxDepth)
- .Where(file => file != tree.FilePath);
-
- foreach (var file in otherPartialFiles)
- {
- var partialTree = CSharpSyntaxTree.ParseText(File.ReadAllText(file), path: file);
- ProcessTree(partialTree, combinedTypes, combinedUsingDirectives, combinedTypesDefined);
- }
-
- var combinedTypeDeclarations = combinedTypes
- .Select(kvp => PartialTypeCombiner.CombinePartialType(kvp.Value))
- .ToList();
-
- var newRoot = SyntaxFactory.CompilationUnit()
- .WithUsings(SyntaxFactory.List(combinedUsingDirectives))
- .WithMembers(SyntaxFactory.List(combinedTypeDeclarations))
- .WithAdditionalAnnotations(new SyntaxAnnotation("PreprocessorSymbols", string.Join(",", definedPreprocessorSymbols)));
-
- return CSharpSyntaxTree.Create(newRoot, null, tree.FilePath)
- .AddInternalsVisibleToAttribute();
- }
-
- private static bool HasPartialTypes(SyntaxTree tree)
- {
- var root = tree.GetCompilationUnitRoot();
- return root.DescendantNodes().OfType().Any(type => type.Modifiers.Any(SyntaxKind.PartialKeyword));
- }
-
- private static void ProcessTree(
- SyntaxTree tree,
- Dictionary> combinedTypes,
- HashSet combinedUsingDirectives,
- HashSet combinedTypesDefined)
- {
- var root = tree.GetCompilationUnitRoot();
-
- combinedUsingDirectives.UnionWith(root.Usings);
-
- foreach (var typeDecl in root.DescendantNodes().OfType())
- {
- var fullName = NamespaceHelper.GetFullyQualifiedName(typeDecl);
- combinedTypesDefined.Add(fullName);
-
- if (!combinedTypes.TryGetValue(fullName, out var declarations))
- {
- declarations = new List();
- combinedTypes[fullName] = declarations;
- }
- declarations.Add(typeDecl);
- }
- }
- }
-}
diff --git a/Assets/FastScriptReload/Scripts/Editor/Compilation/CodeRewriting/Partials/PartialTreeProcessor.cs.meta b/Assets/FastScriptReload/Scripts/Editor/Compilation/CodeRewriting/Partials/PartialTreeProcessor.cs.meta
deleted file mode 100644
index 507d71e..0000000
--- a/Assets/FastScriptReload/Scripts/Editor/Compilation/CodeRewriting/Partials/PartialTreeProcessor.cs.meta
+++ /dev/null
@@ -1,10 +0,0 @@
-fileFormatVersion: 2
-guid: 4aafad9b85b44ebe902ba3cee7bda205
-timeCreated: 1719954990
-AssetOrigin:
- serializedVersion: 1
- productId: 239351
- packageName: Fast Script Reload
- packageVersion: 1.6.1
- assetPath: Assets/FastScriptReload/Scripts/Editor/Compilation/CodeRewriting/Partials/PartialTreeProcessor.cs
- uploadId: 710802
diff --git a/Assets/FastScriptReload/Scripts/Editor/Compilation/CodeRewriting/Partials/PartialTypeCombiner.cs b/Assets/FastScriptReload/Scripts/Editor/Compilation/CodeRewriting/Partials/PartialTypeCombiner.cs
deleted file mode 100644
index 634d909..0000000
--- a/Assets/FastScriptReload/Scripts/Editor/Compilation/CodeRewriting/Partials/PartialTypeCombiner.cs
+++ /dev/null
@@ -1,45 +0,0 @@
-using System.Collections.Generic;
-using System.Linq;
-using Microsoft.CodeAnalysis;
-using Microsoft.CodeAnalysis.CSharp;
-using Microsoft.CodeAnalysis.CSharp.Syntax;
-
-namespace FastScriptReload.Editor.Compilation.CodeRewriting
-{
- internal static class PartialTypeCombiner
- {
- internal static TypeDeclarationSyntax CombinePartialType(List declarations)
- {
- if (declarations.Count == 1)
- return declarations[0];
-
- var firstDeclaration = declarations[0];
- var combinedMembers = declarations.SelectMany(d => d.Members).ToList();
-
- var combinedModifiers = declarations
- .SelectMany(d => d.Modifiers)
- .Where(m => !m.IsKind(SyntaxKind.PartialKeyword))
- .GroupBy(m => m.ValueText)
- .Select(g => g.First().WithTrailingTrivia(SyntaxFactory.Space))
- .ToList();
-
- if (!combinedModifiers.Any(m => m.IsKind(SyntaxKind.PartialKeyword)))
- combinedModifiers.Add(SyntaxFactory.Token(SyntaxKind.PartialKeyword).WithTrailingTrivia(SyntaxFactory.Space));
-
- var combinedBaseList = declarations
- .Where(d => d.BaseList != null)
- .SelectMany(d => d.BaseList.Types)
- .GroupBy(t => t.ToString())
- .Select(g => g.First())
- .ToList();
-
- return firstDeclaration
- .WithMembers(SyntaxFactory.List(combinedMembers))
- .WithModifiers(SyntaxFactory.TokenList(combinedModifiers))
- .WithKeyword(firstDeclaration.Keyword.WithLeadingTrivia(SyntaxFactory.Space))
- .WithBaseList(combinedBaseList.Any()
- ? SyntaxFactory.BaseList(SyntaxFactory.SeparatedList(combinedBaseList))
- : null);
- }
- }
-}
diff --git a/Assets/FastScriptReload/Scripts/Editor/Compilation/CodeRewriting/Partials/PartialTypeCombiner.cs.meta b/Assets/FastScriptReload/Scripts/Editor/Compilation/CodeRewriting/Partials/PartialTypeCombiner.cs.meta
deleted file mode 100644
index eb0d9d3..0000000
--- a/Assets/FastScriptReload/Scripts/Editor/Compilation/CodeRewriting/Partials/PartialTypeCombiner.cs.meta
+++ /dev/null
@@ -1,10 +0,0 @@
-fileFormatVersion: 2
-guid: cc8170320f3a463590d434f7e0570ea0
-timeCreated: 1719955225
-AssetOrigin:
- serializedVersion: 1
- productId: 239351
- packageName: Fast Script Reload
- packageVersion: 1.6.1
- assetPath: Assets/FastScriptReload/Scripts/Editor/Compilation/CodeRewriting/Partials/PartialTypeCombiner.cs
- uploadId: 710802
diff --git a/Assets/FastScriptReload/Scripts/Editor/Compilation/CodeRewriting/Partials/SyntaxTreeHelpers.cs b/Assets/FastScriptReload/Scripts/Editor/Compilation/CodeRewriting/Partials/SyntaxTreeHelpers.cs
deleted file mode 100644
index 586d79a..0000000
--- a/Assets/FastScriptReload/Scripts/Editor/Compilation/CodeRewriting/Partials/SyntaxTreeHelpers.cs
+++ /dev/null
@@ -1,52 +0,0 @@
-using System.Collections.Generic;
-using Microsoft.CodeAnalysis;
-using Microsoft.CodeAnalysis.CSharp;
-using Microsoft.CodeAnalysis.CSharp.Syntax;
-
-namespace FastScriptReload.Editor.Compilation.CodeRewriting
-{
- internal static class NamespaceHelper
- {
- internal static string GetFullyQualifiedName(TypeDeclarationSyntax typeDeclaration)
- {
- var namespaces = new List();
- var currentNode = typeDeclaration.Parent;
- while (currentNode != null)
- {
- if (currentNode is NamespaceDeclarationSyntax namespaceDeclaration)
- {
- namespaces.Add(namespaceDeclaration.Name.ToString());
- }
- currentNode = currentNode.Parent;
- }
- namespaces.Reverse();
- var namespaceName = string.Join(".", namespaces);
- return string.IsNullOrEmpty(namespaceName)
- ? typeDeclaration.Identifier.Text
- : $"{namespaceName}.{typeDeclaration.Identifier.Text}";
- }
- }
-
- internal static class SyntaxTreeExtensions
- {
- internal static SyntaxTree AddInternalsVisibleToAttribute(this SyntaxTree tree)
- {
- var root = tree.GetCompilationUnitRoot();
-
- var attributeArgument = SyntaxFactory.AttributeArgument(
- SyntaxFactory.LiteralExpression(SyntaxKind.StringLiteralExpression, SyntaxFactory.Literal("Assembly-CSharp"))
- );
- var attribute = SyntaxFactory.Attribute(
- SyntaxFactory.ParseName("System.Runtime.CompilerServices.InternalsVisibleTo"),
- SyntaxFactory.AttributeArgumentList(SyntaxFactory.SeparatedList(new[] { attributeArgument }))
- );
-
- var attributeList = SyntaxFactory.AttributeList(SyntaxFactory.SingletonSeparatedList(attribute))
- .WithTarget(SyntaxFactory.AttributeTargetSpecifier(SyntaxFactory.Token(SyntaxKind.AssemblyKeyword)));
-
- var newRoot = root.AddAttributeLists(attributeList);
-
- return tree.WithRootAndOptions(newRoot, tree.Options);
- }
- }
-}
diff --git a/Assets/FastScriptReload/Scripts/Editor/Compilation/CodeRewriting/Partials/SyntaxTreeHelpers.cs.meta b/Assets/FastScriptReload/Scripts/Editor/Compilation/CodeRewriting/Partials/SyntaxTreeHelpers.cs.meta
deleted file mode 100644
index 84215af..0000000
--- a/Assets/FastScriptReload/Scripts/Editor/Compilation/CodeRewriting/Partials/SyntaxTreeHelpers.cs.meta
+++ /dev/null
@@ -1,10 +0,0 @@
-fileFormatVersion: 2
-guid: 1c2f0e22f1a24fcda6d0c0516b428420
-timeCreated: 1719954970
-AssetOrigin:
- serializedVersion: 1
- productId: 239351
- packageName: Fast Script Reload
- packageVersion: 1.6.1
- assetPath: Assets/FastScriptReload/Scripts/Editor/Compilation/CodeRewriting/Partials/SyntaxTreeHelpers.cs
- uploadId: 710802
diff --git a/Assets/FastScriptReload/Scripts/Editor/Compilation/CodeRewriting/Partials/SyntaxTreeMergePartialsExtensions.cs b/Assets/FastScriptReload/Scripts/Editor/Compilation/CodeRewriting/Partials/SyntaxTreeMergePartialsExtensions.cs
deleted file mode 100644
index 4782654..0000000
--- a/Assets/FastScriptReload/Scripts/Editor/Compilation/CodeRewriting/Partials/SyntaxTreeMergePartialsExtensions.cs
+++ /dev/null
@@ -1,18 +0,0 @@
-using System.Collections.Generic;
-using System.Linq;
-using Microsoft.CodeAnalysis;
-
-namespace FastScriptReload.Editor.Compilation.CodeRewriting
-{
- public static class SyntaxTreeMergePartialsExtensions
- {
- public static IEnumerable MergePartials(
- this IEnumerable trees,
- IEnumerable definedPreprocessorSymbols)
- {
- return trees
- .Select(tree => PartialTreeProcessor.ProcessPartialTree(tree, definedPreprocessorSymbols))
- .ToList();
- }
- }
-}
diff --git a/Assets/FastScriptReload/Scripts/Editor/Compilation/CodeRewriting/Partials/SyntaxTreeMergePartialsExtensions.cs.meta b/Assets/FastScriptReload/Scripts/Editor/Compilation/CodeRewriting/Partials/SyntaxTreeMergePartialsExtensions.cs.meta
deleted file mode 100644
index 16f5b2f..0000000
--- a/Assets/FastScriptReload/Scripts/Editor/Compilation/CodeRewriting/Partials/SyntaxTreeMergePartialsExtensions.cs.meta
+++ /dev/null
@@ -1,10 +0,0 @@
-fileFormatVersion: 2
-guid: 550c942c025f4fd5a1062891f3623c60
-timeCreated: 1719174342
-AssetOrigin:
- serializedVersion: 1
- productId: 239351
- packageName: Fast Script Reload
- packageVersion: 1.6.1
- assetPath: Assets/FastScriptReload/Scripts/Editor/Compilation/CodeRewriting/Partials/SyntaxTreeMergePartialsExtensions.cs
- uploadId: 710802
diff --git a/Assets/FastScriptReload/Scripts/Editor/Compilation/CodeRewriting/RecordRewriter.cs b/Assets/FastScriptReload/Scripts/Editor/Compilation/CodeRewriting/RecordRewriter.cs
deleted file mode 100644
index 0c51827..0000000
--- a/Assets/FastScriptReload/Scripts/Editor/Compilation/CodeRewriting/RecordRewriter.cs
+++ /dev/null
@@ -1,36 +0,0 @@
-using FastScriptReload.Runtime;
-using Microsoft.CodeAnalysis;
-using Microsoft.CodeAnalysis.CSharp;
-using Microsoft.CodeAnalysis.CSharp.Syntax;
-
-namespace FastScriptReload.Editor.Compilation.CodeRewriting
-{
- class RecordeRewriter : FastScriptReloadCodeRewriterBase
- {
- public RecordeRewriter(bool writeRewriteReasonAsComment)
- : base(writeRewriteReasonAsComment)
- {
-
- }
-
- public override SyntaxNode VisitRecordDeclaration(RecordDeclarationSyntax node)
- {
- return AdjustRecordName(node, node.Identifier);
- }
-
- private SyntaxNode AdjustRecordName(RecordDeclarationSyntax node, SyntaxToken nodeIdentifier)
- {
- var typeName = nodeIdentifier.ToString(); //Not ToFullString() as it may include spaces and break.
-
- if (!typeName.EndsWith(AssemblyChangesLoader.ClassnamePatchedPostfix))
- {
- typeName += AssemblyChangesLoader.ClassnamePatchedPostfix;
- }
-
- return AddRewriteCommentIfNeeded(
- node.ReplaceToken(nodeIdentifier, SyntaxFactory.Identifier(typeName)),
- $"{nameof(RecordeRewriter)}:{nameof(AdjustRecordName)}"
- );
- }
- }
-}
\ No newline at end of file
diff --git a/Assets/FastScriptReload/Scripts/Editor/Compilation/CodeRewriting/RecordRewriter.cs.meta b/Assets/FastScriptReload/Scripts/Editor/Compilation/CodeRewriting/RecordRewriter.cs.meta
deleted file mode 100644
index c0ae074..0000000
--- a/Assets/FastScriptReload/Scripts/Editor/Compilation/CodeRewriting/RecordRewriter.cs.meta
+++ /dev/null
@@ -1,10 +0,0 @@
-fileFormatVersion: 2
-guid: bb801c55172044ed9294ef722937f12f
-timeCreated: 1705523787
-AssetOrigin:
- serializedVersion: 1
- productId: 239351
- packageName: Fast Script Reload
- packageVersion: 1.6.1
- assetPath: Assets/FastScriptReload/Scripts/Editor/Compilation/CodeRewriting/RecordRewriter.cs
- uploadId: 710802
diff --git a/Assets/FastScriptReload/Scripts/Editor/Compilation/CodeRewriting/RedundantTypeNameQualifierRewriter.cs b/Assets/FastScriptReload/Scripts/Editor/Compilation/CodeRewriting/RedundantTypeNameQualifierRewriter.cs
deleted file mode 100644
index c43ec05..0000000
--- a/Assets/FastScriptReload/Scripts/Editor/Compilation/CodeRewriting/RedundantTypeNameQualifierRewriter.cs
+++ /dev/null
@@ -1,41 +0,0 @@
-using System.Linq;
-using Microsoft.CodeAnalysis;
-using Microsoft.CodeAnalysis.CSharp;
-using Microsoft.CodeAnalysis.CSharp.Syntax;
-
-namespace FastScriptReload.Editor.Compilation.CodeRewriting
-{
- //ideally we'd use Simplifier but FSR doesn't have access to semantic model on which simplifier works
-
- //Removes redundant type name qualifiers, eg: RootClass.NestedEnum.Value -> NestedEnum.Value, root class component is rewritten to have
- //__Patched_ postfix and if original remains it'll cause type mismatch
- class RedundantTypeNameQualifierRewriter : FastScriptReloadCodeRewriterBase
- {
- public RedundantTypeNameQualifierRewriter(bool writeRewriteReasonAsComment, bool visitIntoStructuredTrivia = false)
- : base(writeRewriteReasonAsComment, visitIntoStructuredTrivia)
- {
- }
-
- public override SyntaxNode VisitMemberAccessExpression(MemberAccessExpressionSyntax node)
- {
- if(node.Parent is MemberAccessExpressionSyntax)
- return base.VisitMemberAccessExpression(node); //only target outermost member access for full rewrite
-
- var firstNode = node.DescendantNodes().OfType().FirstOrDefault();
- if(firstNode is IdentifierNameSyntax idNode && node.DescendantNodes().Count() > 1)
- {
- //enclosing type name same as first id node
- if((idNode.Ancestors().First(n => n is TypeDeclarationSyntax) as TypeDeclarationSyntax)?.Identifier.ToString() == idNode.Identifier.ToString())
- {
- return AddRewriteCommentIfNeeded(
- SyntaxFactory.ParseExpression(node.ToString().Replace($"{firstNode.Identifier.ToString()}.", string.Empty)),
- $"{nameof(RedundantTypeNameQualifierRewriter)}"
- );
- }
- }
-
-
- return base.VisitMemberAccessExpression(node);
- }
- }
-}
\ No newline at end of file
diff --git a/Assets/FastScriptReload/Scripts/Editor/Compilation/CodeRewriting/RedundantTypeNameQualifierRewriter.cs.meta b/Assets/FastScriptReload/Scripts/Editor/Compilation/CodeRewriting/RedundantTypeNameQualifierRewriter.cs.meta
deleted file mode 100644
index d0e23be..0000000
--- a/Assets/FastScriptReload/Scripts/Editor/Compilation/CodeRewriting/RedundantTypeNameQualifierRewriter.cs.meta
+++ /dev/null
@@ -1,10 +0,0 @@
-fileFormatVersion: 2
-guid: 80a540048e524157a41df1241bd5c168
-timeCreated: 1679325667
-AssetOrigin:
- serializedVersion: 1
- productId: 239351
- packageName: Fast Script Reload
- packageVersion: 1.6.1
- assetPath: Assets/FastScriptReload/Scripts/Editor/Compilation/CodeRewriting/RedundantTypeNameQualifierRewriter.cs
- uploadId: 710802
diff --git a/Assets/FastScriptReload/Scripts/Editor/Compilation/CodeRewriting/RoslynUtils.cs b/Assets/FastScriptReload/Scripts/Editor/Compilation/CodeRewriting/RoslynUtils.cs
deleted file mode 100644
index 154a3e1..0000000
--- a/Assets/FastScriptReload/Scripts/Editor/Compilation/CodeRewriting/RoslynUtils.cs
+++ /dev/null
@@ -1,29 +0,0 @@
-using System;
-using System.Linq;
-using Microsoft.CodeAnalysis.CSharp.Syntax;
-
-namespace FastScriptReload.Editor.Compilation.CodeRewriting
-{
- public class RoslynUtils
- {
- public static string GetMemberFQDN(MemberDeclarationSyntax memberNode, string memberName) //TODO: try get rid of member name (needs to cast to whatever member it could be to get identifier)
- {
- var outer = GetMemberFQDNWithoutMemberName(memberNode);
- return !string.IsNullOrEmpty(outer)
- ? $"{outer}.{memberName}"
- : memberName;
- }
-
- public static string GetMemberFQDNWithoutMemberName(MemberDeclarationSyntax memberNode) //TODO: move out to helper class
- {
- var fullTypeContibutingAncestorNames = memberNode.Ancestors().OfType().Select(da =>
- {
- if (da is TypeDeclarationSyntax t) return t.Identifier.ToString();
- else if (da is NamespaceDeclarationSyntax n) return n.Name.ToString();
- else throw new Exception("Unable to resolve full field name");
- }).Reverse().ToList();
-
- return string.Join(".", fullTypeContibutingAncestorNames);
- }
- }
-}
\ No newline at end of file
diff --git a/Assets/FastScriptReload/Scripts/Editor/Compilation/CodeRewriting/RoslynUtils.cs.meta b/Assets/FastScriptReload/Scripts/Editor/Compilation/CodeRewriting/RoslynUtils.cs.meta
deleted file mode 100644
index b502de7..0000000
--- a/Assets/FastScriptReload/Scripts/Editor/Compilation/CodeRewriting/RoslynUtils.cs.meta
+++ /dev/null
@@ -1,10 +0,0 @@
-fileFormatVersion: 2
-guid: 29bd7fad38034046a8dd4c7eea68907c
-timeCreated: 1673017013
-AssetOrigin:
- serializedVersion: 1
- productId: 239351
- packageName: Fast Script Reload
- packageVersion: 1.6.1
- assetPath: Assets/FastScriptReload/Scripts/Editor/Compilation/CodeRewriting/RoslynUtils.cs
- uploadId: 710802
diff --git a/Assets/FastScriptReload/Scripts/Editor/Compilation/CodeRewriting/ThisAssignmentRewriter.cs b/Assets/FastScriptReload/Scripts/Editor/Compilation/CodeRewriting/ThisAssignmentRewriter.cs
deleted file mode 100644
index fd55ff2..0000000
--- a/Assets/FastScriptReload/Scripts/Editor/Compilation/CodeRewriting/ThisAssignmentRewriter.cs
+++ /dev/null
@@ -1,21 +0,0 @@
-using Microsoft.CodeAnalysis;
-using Microsoft.CodeAnalysis.CSharp.Syntax;
-
-namespace FastScriptReload.Editor.Compilation.CodeRewriting
-{
- class ThisAssignmentRewriter: ThisRewriterBase {
- public ThisAssignmentRewriter(bool writeRewriteReasonAsComment, bool visitIntoStructuredTrivia = false)
- : base(writeRewriteReasonAsComment, visitIntoStructuredTrivia)
- {
- }
-
- public override SyntaxNode VisitThisExpression(ThisExpressionSyntax node)
- {
- if (node.Parent is AssignmentExpressionSyntax) {
- return CreateCastedThisExpression(node);
- }
-
- return base.VisitThisExpression(node);
- }
- }
-}
\ No newline at end of file
diff --git a/Assets/FastScriptReload/Scripts/Editor/Compilation/CodeRewriting/ThisAssignmentRewriter.cs.meta b/Assets/FastScriptReload/Scripts/Editor/Compilation/CodeRewriting/ThisAssignmentRewriter.cs.meta
deleted file mode 100644
index 18f8b07..0000000
--- a/Assets/FastScriptReload/Scripts/Editor/Compilation/CodeRewriting/ThisAssignmentRewriter.cs.meta
+++ /dev/null
@@ -1,10 +0,0 @@
-fileFormatVersion: 2
-guid: c5a960528b2b44edbf644e0ac0950d35
-timeCreated: 1672993042
-AssetOrigin:
- serializedVersion: 1
- productId: 239351
- packageName: Fast Script Reload
- packageVersion: 1.6.1
- assetPath: Assets/FastScriptReload/Scripts/Editor/Compilation/CodeRewriting/ThisAssignmentRewriter.cs
- uploadId: 710802
diff --git a/Assets/FastScriptReload/Scripts/Editor/Compilation/CodeRewriting/ThisCallRewriter.cs b/Assets/FastScriptReload/Scripts/Editor/Compilation/CodeRewriting/ThisCallRewriter.cs
deleted file mode 100644
index 59dd926..0000000
--- a/Assets/FastScriptReload/Scripts/Editor/Compilation/CodeRewriting/ThisCallRewriter.cs
+++ /dev/null
@@ -1,22 +0,0 @@
-using Microsoft.CodeAnalysis;
-using Microsoft.CodeAnalysis.CSharp.Syntax;
-
-namespace FastScriptReload.Editor.Compilation.CodeRewriting
-{
- class ThisCallRewriter : ThisRewriterBase
- {
- public ThisCallRewriter(bool writeRewriteReasonAsComment, bool visitIntoStructuredTrivia = false)
- : base(writeRewriteReasonAsComment, visitIntoStructuredTrivia)
- {
- }
-
- public override SyntaxNode VisitThisExpression(ThisExpressionSyntax node)
- {
- if (node.Parent is ArgumentSyntax)
- {
- return CreateCastedThisExpression(node);
- }
- return base.VisitThisExpression(node);
- }
- }
-}
\ No newline at end of file
diff --git a/Assets/FastScriptReload/Scripts/Editor/Compilation/CodeRewriting/ThisCallRewriter.cs.meta b/Assets/FastScriptReload/Scripts/Editor/Compilation/CodeRewriting/ThisCallRewriter.cs.meta
deleted file mode 100644
index 74a91ae..0000000
--- a/Assets/FastScriptReload/Scripts/Editor/Compilation/CodeRewriting/ThisCallRewriter.cs.meta
+++ /dev/null
@@ -1,10 +0,0 @@
-fileFormatVersion: 2
-guid: f7e7aad39cec445db504fe5a117beae5
-timeCreated: 1672993042
-AssetOrigin:
- serializedVersion: 1
- productId: 239351
- packageName: Fast Script Reload
- packageVersion: 1.6.1
- assetPath: Assets/FastScriptReload/Scripts/Editor/Compilation/CodeRewriting/ThisCallRewriter.cs
- uploadId: 710802
diff --git a/Assets/FastScriptReload/Scripts/Editor/Compilation/CodeRewriting/ThisRewriterBase.cs b/Assets/FastScriptReload/Scripts/Editor/Compilation/CodeRewriting/ThisRewriterBase.cs
deleted file mode 100644
index 994cd40..0000000
--- a/Assets/FastScriptReload/Scripts/Editor/Compilation/CodeRewriting/ThisRewriterBase.cs
+++ /dev/null
@@ -1,51 +0,0 @@
-using System.Linq;
-using ImmersiveVrToolsCommon.Runtime.Logging;
-using Microsoft.CodeAnalysis;
-using Microsoft.CodeAnalysis.CSharp;
-using Microsoft.CodeAnalysis.CSharp.Syntax;
-
-namespace FastScriptReload.Editor.Compilation.CodeRewriting
-{
- abstract class ThisRewriterBase : FastScriptReloadCodeRewriterBase
- {
- protected ThisRewriterBase(bool writeRewriteReasonAsComment, bool visitIntoStructuredTrivia = false)
- : base(writeRewriteReasonAsComment, visitIntoStructuredTrivia)
- {
- }
-
- protected SyntaxNode CreateCastedThisExpression(ThisExpressionSyntax node)
- {
- var ancestors = node.Ancestors().Where(n => n is TypeDeclarationSyntax).Cast().ToList();
- if (ancestors.Count() > 1)
- {
- LoggerScoped.LogWarning($"ThisRewriter: for class: '{ancestors.First().Identifier}' - 'this' call/assignment in nested class / struct. Dynamic cast will be used but this could cause issues in some cases:" +
- $"\r\n\r\n1) - If called method has multiple overrides, using dynamic will cause compiler issue as it'll no longer be able to pick correct one" +
- $"\r\n\r\n If you see any issues with that message, please look at 'Limitation' section in documentation as this outlines how to deal with it.");
-
- //TODO: casting to dynamic seems to be best option (and one that doesn't fail for nested classes), what's the performance overhead?
- return SyntaxFactory.CastExpression(
- SyntaxFactory.ParseTypeName("dynamic"),
- node
- );
- }
-
- var firstAncestor = ancestors.FirstOrDefault();
- if (firstAncestor == null)
- {
- LoggerScoped.LogWarning($"Unable to find first ancestor for node: {node.ToFullString()}, this rewrite will not be applied");
- return node;
- }
-
- var methodInType = firstAncestor.Identifier.ToString();
- var resultNode = SyntaxFactory.CastExpression(
- SyntaxFactory.ParseTypeName(methodInType),
- SyntaxFactory.CastExpression(
- SyntaxFactory.ParseTypeName(typeof(object).FullName),
- node
- )
- );
-
- return AddRewriteCommentIfNeeded(resultNode, $"{nameof(ThisRewriterBase)}:{nameof(CreateCastedThisExpression)}");
- }
- }
-}
\ No newline at end of file
diff --git a/Assets/FastScriptReload/Scripts/Editor/Compilation/CodeRewriting/ThisRewriterBase.cs.meta b/Assets/FastScriptReload/Scripts/Editor/Compilation/CodeRewriting/ThisRewriterBase.cs.meta
deleted file mode 100644
index 4ea1ece..0000000
--- a/Assets/FastScriptReload/Scripts/Editor/Compilation/CodeRewriting/ThisRewriterBase.cs.meta
+++ /dev/null
@@ -1,10 +0,0 @@
-fileFormatVersion: 2
-guid: 0fd0b779590247168b3873c939c42d71
-timeCreated: 1672993042
-AssetOrigin:
- serializedVersion: 1
- productId: 239351
- packageName: Fast Script Reload
- packageVersion: 1.6.1
- assetPath: Assets/FastScriptReload/Scripts/Editor/Compilation/CodeRewriting/ThisRewriterBase.cs
- uploadId: 710802
diff --git a/Assets/FastScriptReload/Scripts/Editor/Compilation/DotnetExeCompilator.cs b/Assets/FastScriptReload/Scripts/Editor/Compilation/DotnetExeCompilator.cs
deleted file mode 100644
index 17105d9..0000000
--- a/Assets/FastScriptReload/Scripts/Editor/Compilation/DotnetExeCompilator.cs
+++ /dev/null
@@ -1,349 +0,0 @@
-using System;
-using System.Collections.Generic;
-using System.ComponentModel;
-using System.Diagnostics;
-using System.IO;
-using System.Linq;
-using System.Reflection;
-using System.Runtime.CompilerServices;
-using System.Text;
-using System.Threading;
-using FastScriptReload.Editor.AssemblyPostProcess;
-using HarmonyLib;
-using ImmersiveVRTools.Editor.Common.Cache;
-using ImmersiveVRTools.Editor.Common.Utilities;
-using ImmersiveVRTools.Runtime.Common;
-using ImmersiveVrToolsCommon.Runtime.Logging;
-using UnityEditor;
-
-namespace FastScriptReload.Editor.Compilation
-{
- [InitializeOnLoad]
- public class DotnetExeDynamicCompilation: DynamicCompilationBase
- {
- private static string _dotnetExePath;
- private static string _cscDll;
- private static string _tempFolder;
-
- private static string ApplicationContentsPath = EditorApplication.applicationContentsPath;
- private static readonly List _createdFilesToCleanUp = new List();
- private static readonly Dictionary _typeNameAssemblyCache = new Dictionary(16);
-
- static DotnetExeDynamicCompilation()
- {
-#if UNITY_EDITOR_WIN
- const string dotnetExecutablePath = "dotnet.exe";
-#else
- const string dotnetExecutablePath = "dotnet"; //mac and linux, no extension
-#endif
-
- _dotnetExePath = FindFileOrThrow(dotnetExecutablePath);
- _cscDll = FindFileOrThrow("csc.dll"); //even on mac/linux need to find dll and use, not no extension one
- _tempFolder = Path.GetTempPath();
-
- EditorApplication.playModeStateChanged += obj =>
- {
- if (obj == PlayModeStateChange.ExitingPlayMode && _createdFilesToCleanUp.Any())
- {
- LoggerScoped.LogDebug($"Removing temporary files: [{string.Join(",", _createdFilesToCleanUp)}]");
-
- foreach (var fileToCleanup in _createdFilesToCleanUp)
- {
- new FileInfo(fileToCleanup).IsReadOnly = false;
- File.Delete(fileToCleanup);
- }
- _createdFilesToCleanUp.Clear();
- }
- };
- }
-
- private static string FindFileOrThrow(string fileName)
- {
- return SessionStateCache.GetOrCreateString($"FSR:FilePath_{fileName}", () =>
- {
- var foundFile = Directory
- .GetFiles(ApplicationContentsPath, fileName, SearchOption.AllDirectories)
- .FirstOrDefault();
- if (foundFile == null)
- {
- throw new Exception($"Unable to find '{fileName}', make sure Editor version supports it. You can also add preprocessor directive 'FastScriptReload_CompileViaMCS' which will use Mono compiler instead");
- }
-
- return foundFile;
- });
- }
-
- public static CompileResult Compile(List filePathsWithSourceCode, UnityMainThreadDispatcher unityMainThreadDispatcher)
- {
- var sourceCodeCombinedFilePath = string.Empty;
- try
- {
- var asmName = Guid.NewGuid().ToString().Replace("-", "");
- var rspFile = _tempFolder + $"{asmName}.rsp";
- var assemblyAttributeFilePath = _tempFolder + $"{asmName}.DynamicallyCreatedAssemblyAttribute.cs";
- sourceCodeCombinedFilePath = _tempFolder + $"{asmName}.SourceCodeCombined.cs";
- var outLibraryPath = $"{_tempFolder}{asmName}.dll";
-
- var createSourceCodeCombinedResult = CreateSourceCodeCombinedContents(filePathsWithSourceCode, ActiveScriptCompilationDefines.ToList());
- CreateFileAndTrackAsCleanup(sourceCodeCombinedFilePath, createSourceCodeCombinedResult.SourceCode, _createdFilesToCleanUp);
-#if UNITY_EDITOR
- unityMainThreadDispatcher.Enqueue(() =>
- {
- if ((bool)FastScriptReloadPreference.IsAutoOpenGeneratedSourceFileOnChangeEnabled.GetEditorPersistedValueOrDefault())
- {
- UnityEditorInternal.InternalEditorUtility.OpenFileAtLineExternal(sourceCodeCombinedFilePath, 0);
- }
- });
-#endif
-
- var originalAssemblyPathToAsmWithInternalsVisibleToCompiled = PerfMeasure.Elapsed(
- () => CreateAssemblyCopiesWithInternalsVisibleTo(createSourceCodeCombinedResult, asmName),
- out var createInternalVisibleToAsmElapsedMilliseconds);
-
- var shouldAddUnsafeFlag = createSourceCodeCombinedResult.SourceCode.Contains("unsafe"); //TODO: not ideal as 'unsafe' can be part of comment, not code. But compiling with that flag in more cases shouldn't cause issues
- var rspFileContent = GenerateCompilerArgsRspFileContents(outLibraryPath, sourceCodeCombinedFilePath, assemblyAttributeFilePath,
- originalAssemblyPathToAsmWithInternalsVisibleToCompiled, shouldAddUnsafeFlag);
- CreateFileAndTrackAsCleanup(rspFile, rspFileContent, _createdFilesToCleanUp);
- CreateFileAndTrackAsCleanup(assemblyAttributeFilePath, DynamicallyCreatedAssemblyAttributeSourceCode, _createdFilesToCleanUp);
-
- var exitCode = ExecuteDotnetExeCompilation(_dotnetExePath, _cscDll, rspFile, outLibraryPath, out var outputMessages);
-
- var compiledAssembly = Assembly.LoadFrom(outLibraryPath);
- return new CompileResult(outLibraryPath, outputMessages, exitCode, compiledAssembly, createSourceCodeCombinedResult.SourceCode,
- sourceCodeCombinedFilePath, createInternalVisibleToAsmElapsedMilliseconds);
- }
- catch (SourceCodeHasErrorsException e)
- {
- // FastScriptReloadManager has a special case for reporting SourceCodeHasErrorsException.
- // Just pass it through.
- throw e;
- }
- catch (Exception e)
- {
- LoggerScoped.LogError($"Compilation error: temporary files were not removed so they can be inspected: "
- + string.Join(", ", _createdFilesToCleanUp
- .Select(f => $"{f}")));
- if (LogHowToFixMessageOnCompilationError)
- {
- LoggerScoped.LogWarning($@"HOW TO FIX - INSTRUCTIONS:
-
-1) Open file that caused issue by looking at error log starting with: 'FSR: Compilation error: temporary files were not removed so they can be inspected: '. And click on file path to open.
-2) Look up other error in the console, which will be like 'Error When updating files:' - this one contains exact line that failed to compile (in XXX_SourceCodeGenerated.cs file). Those are same compilation errors as you see in Unity/IDE when developing.
-3) Read compiler error message as it'll help understand the issue
-
-Error could be caused by a normal compilation issue that you created in source file (eg typo), in that case please fix and it'll recompile.
-
-It's possible compilation fails due to existing limitation, in that case:
-
-You can quickly specify custom script rewrite override for part of code that's failing.
-
-Please use project panel to:
-1) Right-click on the original file that has compilation issue
-2) Click Fast Script Reload -> Add / Open User Script Rewrite Override
-3) Read top comment in opened file and it'll explain how to create overrides
-
-I'm continuously working on mitigating limitations.
-
-If you could please get in touch with me via 'support@immersivevrtools.com' and include error you see in the console as well as created files (from paths in previous error). This way I can get it fixed for you.
-
-You can also:
-1) Look at 'limitation' section in the docs - which will explain bit more around limitations and workarounds
-2) Move some of the code that you want to work on to different file - compilation happens on whole file, if you have multiple types there it could increase the chance of issues
-3) Have a look at compilation error, it shows error line (in the '*.SourceCodeCombined.cs' file, it's going to be something that compiler does not accept, likely easy to spot. To workaround you can change that part of code in original file. It's specific patterns that'll break it.
-
-*If you want to prevent that message from reappearing please go to Window -> Fast Script Reload -> Start Screen -> Logging -> tick off 'Log how to fix message on compilation error'*");
-
- }
-
- throw new HotReloadCompilationException(e.Message, e, sourceCodeCombinedFilePath);
- }
- }
-
- private static Dictionary CreateAssemblyCopiesWithInternalsVisibleTo(CreateSourceCodeCombinedContentsResult createSourceCodeCombinedResult, string asmName)
- {
- var originalAssemblyPathToAsmWithInternalsVisibleToCompiled = new Dictionary();
- try
- {
- var assembliesForTypesInCombinedFile = createSourceCodeCombinedResult.TypeNamesDefinitions
- .Select(GetAssemblyByTypeName)
- .Where(t => t != null)
- .Distinct();
-
- foreach (var assemblyForTypesInCombinedFile in assembliesForTypesInCombinedFile)
- {
- var createdAssemblyWithInternalsVisibleToNewlyCompiled = AddInternalsVisibleToForAllUserAssembliesPostProcess.CreateAssemblyWithInternalsContentsVisibleTo(
- assemblyForTypesInCombinedFile, asmName
- );
- originalAssemblyPathToAsmWithInternalsVisibleToCompiled.Add(assemblyForTypesInCombinedFile.Location, createdAssemblyWithInternalsVisibleToNewlyCompiled);
- }
- }
- catch (Exception e)
- {
- LoggerScoped.LogWarning($"Unable to create assembly with '{nameof(InternalsVisibleToAttribute)}' for dynamically recompiled code. {e}");
- }
-
- return originalAssemblyPathToAsmWithInternalsVisibleToCompiled;
- }
-
- private static void CreateFileAndTrackAsCleanup(string filePath, string contents, List createdFilesToCleanUp)
- {
- File.WriteAllText(filePath, contents);
- new FileInfo(filePath).IsReadOnly = true;
- createdFilesToCleanUp.Add(filePath);
- }
-
- private static Assembly GetAssemblyByTypeName(string typeName)
- {
- // This cache is barely worth it on my machine - it's ~1ms without, ~0ms with.
- // However, the number of assemblies to search is technically unbounded
- // - so this might be more important for somebody else.
- if (_typeNameAssemblyCache.TryGetValue(typeName, out var assembly)) return assembly;
-
- // FSR (via Harmony) originally did this search by enumerating assembly.GetTypes().
- // I can't see anything in the documentation suggesting the assembly.GetType(typeName) version misses any cases.
- // It's much faster.
- assembly = AppDomain.CurrentDomain.GetAssemblies().SingleOrDefault(asm => asm.GetType(typeName, false) != null);
-
- if (assembly != null) _typeNameAssemblyCache.Add(typeName, assembly);
- return assembly;
- }
-
- private static string GenerateCompilerArgsRspFileContents(string outLibraryPath, string sourceCodeCombinedFilePath, string assemblyAttributeFilePath,
- Dictionary originalAssemblyPathToAsmWithInternalsVisibleToCompiled, bool addUnsafeFlag)
- {
- var rspContents = new StringBuilder();
- rspContents.AppendLine("-target:library");
- rspContents.AppendLine($"-out:\"{outLibraryPath}\"");
- // rspContents.AppendLine($"-refout:\"{tempFolder}{asmName}.ref.dll\""); //reference assembly for linking, not needed
- foreach (var symbol in ActiveScriptCompilationDefines)
- {
- rspContents.AppendLine($"-define:{symbol}");
- }
-
- foreach (var referenceToAdd in ResolveReferencesToAdd(new List()))
- {
- if (originalAssemblyPathToAsmWithInternalsVisibleToCompiled.TryGetValue(referenceToAdd, out var asmWithInternalsVisibleTo))
- {
- //Changed assembly have InternalsVisibleTo added to it to avoid any issues where types are defined internal
- rspContents.AppendLine($"-r:\"{asmWithInternalsVisibleTo}\"");
- }
- else
- {
- rspContents.AppendLine($"-r:\"{referenceToAdd}\"");
- }
- }
-
- rspContents.AppendLine($"\"{sourceCodeCombinedFilePath}\"");
- rspContents.AppendLine($"\"{assemblyAttributeFilePath}\"");
-
- rspContents.AppendLine($"-langversion:latest");
-
- rspContents.AppendLine("/deterministic");
- rspContents.AppendLine("/optimize-");
- rspContents.AppendLine("/debug:portable");
- rspContents.AppendLine("/nologo");
- rspContents.AppendLine("/RuntimeMetadataVersion:v4.0.30319");
-
- if (addUnsafeFlag)
- {
- rspContents.AppendLine("/unsafe");
- }
-
- rspContents.AppendLine("/nowarn:0169");
- rspContents.AppendLine("/nowarn:0649");
- rspContents.AppendLine("/nowarn:1701");
- rspContents.AppendLine("/nowarn:1702");
- rspContents.AppendLine("/utf8output");
- rspContents.AppendLine("/preferreduilang:en-US");
-
- var rspContentsString = rspContents.ToString();
- return rspContentsString;
- }
-
- private static int ExecuteDotnetExeCompilation(string dotnetExePath, string cscDll, string rspFile,
- string outLibraryPath, out List outputMessages)
- {
- var process = new Process();
- process.StartInfo.FileName = dotnetExePath;
- process.StartInfo.Arguments = $"exec \"{cscDll}\" /nostdlib /noconfig /shared \"@{rspFile}\"";
-
- var outMessages = new List();
-
- var stderr_completed = new ManualResetEvent(false);
- var stdout_completed = new ManualResetEvent(false);
-
- process.StartInfo.CreateNoWindow = true;
- process.StartInfo.UseShellExecute = false;
- process.StartInfo.WindowStyle = ProcessWindowStyle.Hidden;
- process.StartInfo.RedirectStandardOutput = true;
- process.StartInfo.RedirectStandardError = true;
- process.ErrorDataReceived += (sender, args) =>
- {
- if (args.Data != null)
- outMessages.Add(args.Data);
- else
- stderr_completed.Set();
- };
- process.OutputDataReceived += (sender, args) =>
- {
- if (args.Data != null)
- {
- outMessages.Add(args.Data);
- return;
- }
-
- stdout_completed.Set();
- };
- process.StartInfo.StandardOutputEncoding = process.StartInfo.StandardErrorEncoding = Encoding.UTF8;
-
- try
- {
- process.Start();
- }
- catch (Exception ex)
- {
- if (ex is Win32Exception win32Exception)
- throw new SystemException(string.Format("Error running {0}: {1}", process.StartInfo.FileName,
- typeof(Win32Exception)
- .GetMethod("GetErrorMessage", BindingFlags.Static | BindingFlags.NonPublic)?
- .Invoke(null, new object[] { win32Exception.NativeErrorCode }) ??
- $", NativeErrorCode: {win32Exception.NativeErrorCode}"));
- throw;
- }
-
- int exitCode = -1;
- try
- {
- process.BeginOutputReadLine();
- process.BeginErrorReadLine();
- process.WaitForExit();
-
- exitCode = process.ExitCode;
- }
- finally
- {
- stderr_completed.WaitOne(TimeSpan.FromSeconds(30.0));
- stdout_completed.WaitOne(TimeSpan.FromSeconds(30.0));
- process.Close();
- }
-
- if (!File.Exists(outLibraryPath))
- throw new Exception("Compiler failed to produce the assembly. Output: '" +
- string.Join(Environment.NewLine + Environment.NewLine, outMessages) + "'");
-
- outputMessages = new List();
- outputMessages.AddRange(outMessages);
- return exitCode;
- }
- }
-
- public class HotReloadCompilationException : Exception
- {
- public string SourceCodeCombinedFileCreated { get; }
-
- public HotReloadCompilationException(string message, Exception innerException, string sourceCodeCombinedFileCreated) : base(message, innerException)
- {
- SourceCodeCombinedFileCreated = sourceCodeCombinedFileCreated;
- }
- }
-}
\ No newline at end of file
diff --git a/Assets/FastScriptReload/Scripts/Editor/Compilation/DotnetExeCompilator.cs.meta b/Assets/FastScriptReload/Scripts/Editor/Compilation/DotnetExeCompilator.cs.meta
deleted file mode 100644
index db5d6c7..0000000
--- a/Assets/FastScriptReload/Scripts/Editor/Compilation/DotnetExeCompilator.cs.meta
+++ /dev/null
@@ -1,10 +0,0 @@
-fileFormatVersion: 2
-guid: 334fb2fc5cff4e98bf0f1ced9058cfc2
-timeCreated: 1669637513
-AssetOrigin:
- serializedVersion: 1
- productId: 239351
- packageName: Fast Script Reload
- packageVersion: 1.6.1
- assetPath: Assets/FastScriptReload/Scripts/Editor/Compilation/DotnetExeCompilator.cs
- uploadId: 710802
diff --git a/Assets/FastScriptReload/Scripts/Editor/Compilation/DynamicAssemblyCompiler.cs b/Assets/FastScriptReload/Scripts/Editor/Compilation/DynamicAssemblyCompiler.cs
deleted file mode 100644
index cfdf57c..0000000
--- a/Assets/FastScriptReload/Scripts/Editor/Compilation/DynamicAssemblyCompiler.cs
+++ /dev/null
@@ -1,64 +0,0 @@
-using System.Collections.Generic;
-using System.Diagnostics;
-using System.IO;
-using System.Linq;
-using System.Reflection;
-using FastScriptReload.Runtime;
-using ImmersiveVRTools.Runtime.Common;
-using ImmersiveVrToolsCommon.Runtime.Logging;
-using Debug = UnityEngine.Debug;
-
-namespace FastScriptReload.Editor.Compilation
-{
- public class DynamicAssemblyCompiler
- {
- public static CompileResult Compile(List filePathsWithSourceCode, UnityMainThreadDispatcher unityMainThreadDispatcher)
- {
- var sw = new Stopwatch();
- sw.Start();
-
-#if FastScriptReload_CompileViaMCS
- var result = McsExeDynamicCompilation.Compile(filePathsWithSourceCode);
-#else
- var compileResult = DotnetExeDynamicCompilation.Compile(filePathsWithSourceCode, unityMainThreadDispatcher);
-#endif
-
- LoggerScoped.Log($"Files: {string.Join(",", filePathsWithSourceCode.Select(fn => new FileInfo(fn).Name))} changed " +
-#if UNITY_2021_1_OR_NEWER
- $"(click here to debug [in bottom details pane])" +
-#else
- "(to debug go to Fast Script Reload -> Start Screen -> Debugging -> Auto-open generated source file for debugging)" +
-#endif
- $" - compilation (took {sw.ElapsedMilliseconds}ms)"
-#if ImmersiveVrTools_DebugEnabled
- + $" (of which creating internal visible to assemblies {compileResult.CreatingAssemblyWithInternalsVisibleToTook})ms"
-#endif
-);
-
- return compileResult;
- }
- }
-
- public class CompileResult
- {
- public Assembly CompiledAssembly { get; }
- public string CompiledAssemblyPath { get; }
- public List MessagesFromCompilerProcess { get; }
- public bool IsError => string.IsNullOrEmpty(CompiledAssemblyPath);
- public int NativeCompilerReturnValue { get; }
- public string SourceCodeCombined { get; }
- public string SourceCodeCombinedFileLocation { get; }
- public float CreatingAssemblyWithInternalsVisibleToTook { get; }
-
- public CompileResult(string compiledAssemblyPath, List messagesFromCompilerProcess, int nativeCompilerReturnValue, Assembly compiledAssembly, string sourceCodeCombined, string sourceCodeCombinedFileLocation, float creatingAssemblyWithInternalsVisibleToTook)
- {
- CompiledAssemblyPath = compiledAssemblyPath;
- MessagesFromCompilerProcess = messagesFromCompilerProcess;
- NativeCompilerReturnValue = nativeCompilerReturnValue;
- CompiledAssembly = compiledAssembly;
- SourceCodeCombined = sourceCodeCombined;
- SourceCodeCombinedFileLocation = sourceCodeCombinedFileLocation;
- CreatingAssemblyWithInternalsVisibleToTook = creatingAssemblyWithInternalsVisibleToTook;
- }
- }
-}
\ No newline at end of file
diff --git a/Assets/FastScriptReload/Scripts/Editor/Compilation/DynamicAssemblyCompiler.cs.meta b/Assets/FastScriptReload/Scripts/Editor/Compilation/DynamicAssemblyCompiler.cs.meta
deleted file mode 100644
index f5abcd3..0000000
--- a/Assets/FastScriptReload/Scripts/Editor/Compilation/DynamicAssemblyCompiler.cs.meta
+++ /dev/null
@@ -1,10 +0,0 @@
-fileFormatVersion: 2
-guid: 616fd2855e784e728009a00bc1f09255
-timeCreated: 1669110323
-AssetOrigin:
- serializedVersion: 1
- productId: 239351
- packageName: Fast Script Reload
- packageVersion: 1.6.1
- assetPath: Assets/FastScriptReload/Scripts/Editor/Compilation/DynamicAssemblyCompiler.cs
- uploadId: 710802
diff --git a/Assets/FastScriptReload/Scripts/Editor/Compilation/DynamicCompilationBase.cs b/Assets/FastScriptReload/Scripts/Editor/Compilation/DynamicCompilationBase.cs
deleted file mode 100644
index 3511491..0000000
--- a/Assets/FastScriptReload/Scripts/Editor/Compilation/DynamicCompilationBase.cs
+++ /dev/null
@@ -1,387 +0,0 @@
-using System;
-using System.Collections.Generic;
-using System.IO;
-using System.Linq;
-using System.Reflection;
-using System.Text;
-using FastScriptReload.Editor.Compilation.CodeRewriting;
-using FastScriptReload.Editor.Compilation.ScriptGenerationOverrides;
-using FastScriptReload.Runtime;
-using FastScriptReload.Scripts.Runtime;
-using ImmersiveVRTools.Editor.Common.Cache;
-using ImmersiveVRTools.Runtime.Common.Utilities;
-using ImmersiveVrToolsCommon.Runtime.Logging;
-using Microsoft.CodeAnalysis;
-using Microsoft.CodeAnalysis.CSharp;
-using Microsoft.CodeAnalysis.CSharp.Syntax;
-using UnityEditor;
-using UnityEngine;
-using UnityEngine.Rendering;
-
-namespace FastScriptReload.Editor.Compilation
-{
- [InitializeOnLoad]
- public class DynamicCompilationBase
- {
- public static bool DebugWriteRewriteReasonAsComment;
- public static bool LogHowToFixMessageOnCompilationError;
- public static bool EnableExperimentalThisCallLimitationFix;
- public static List ReferencesExcludedFromHotReload = new List();
-
- public const string DebuggingInformationComment =
- @"// DEBUGGING READ-ME: DO NOT EDIT THIS AUTO-GENERATED FILE AS IT'LL BE DELETED " +
-#if !UNITY_2021_1_OR_NEWER
-"WARN: on Unity versions prior to 2021, opening files in that manner can cause static values to be reinitialized"
-#else
- ""
-#endif
- +
- @"//
-// To debug simply add a breakpoint in this file.
-//
-// With every code change - new file is generated, currently you'll need to re-set breakpoints after each change.
-// You can also:
-// - step into the function that was changed (and that will get you to correct source file)
-// - add a function breakpoint in your IDE (this way you won't have to re-add it every time)
-//
-// Tool can automatically open dynamically-compiled code file every time to make setting breakpoints easier.
-// You can adjust that behaviour via 'Window -> FastScriptReload -> Start Screen -> Debugging -> Do not auto-open generated cs file'.
-//
-// You can always open generated file when needed by clicking link in console, eg.
-// 'FSR: Files: FunctionLibrary.cs changed (click here to debug [in bottom details pane]) - compilation (took 240ms)'
-
-
-";
-
- public static readonly string[] ActiveScriptCompilationDefines;
- protected static readonly string DynamicallyCreatedAssemblyAttributeSourceCode = $"[assembly: {typeof(DynamicallyCreatedAssemblyAttribute).FullName}()]";
- private static readonly string AssemblyCsharpFullPath;
-
- static DynamicCompilationBase()
- {
- //needs to be set from main thread
- ActiveScriptCompilationDefines = EditorUserBuildSettings.activeScriptCompilationDefines;
- AssemblyCsharpFullPath = SessionStateCache.GetOrCreateString(
- $"FSR:AssemblyCsharpFullPath",
- () => AssetDatabase.FindAssets("Microsoft.CSharp")
- .Select(g => new System.IO.FileInfo(UnityEngine.Application.dataPath + "/../" + AssetDatabase.GUIDToAssetPath(g)))
- .First(fi => fi.Name.ToLower() == "Microsoft.CSharp.dll".ToLower()).FullName
- );
-
- }
-
- protected static CreateSourceCodeCombinedContentsResult CreateSourceCodeCombinedContents(List sourceCodeFiles, List definedPreprocessorSymbols)
- {
- var combinedUsingStatements = new List();
- var typesDefined = new List();
-
- var trees = sourceCodeFiles
- .Select(sourceCodeFile =>
- {
- var fileCode = File.ReadAllText(sourceCodeFile);
- var tree = CSharpSyntaxTree.ParseText(fileCode, new CSharpParseOptions(preprocessorSymbols: definedPreprocessorSymbols));
- return tree.WithFilePath(sourceCodeFile);
- })
- .ToList();
-
- if (FastScriptReloadManager.Instance.IsPartialClassSupportEnabled)
- {
- trees = trees.MergePartials(definedPreprocessorSymbols).ToList();
- }
-
- // It's important to check whether the compiler was able to correctly interpret the original code.
- // When the compiler encounters errors, it actually continues and still produces a tree.
- // This tree even still roundtrips to the original source code.
- // However, because the code didn't parse correctly, the tree's structure may be wrong.
- // If we don't detect this here, FSR continues on obliviously, applying transformations to the broken tree.
- // This sometimes leads to correctly generated code, because the parts of the tree that FSR cared to look at happened to be correct.
- // However, this should not be relied upon.
- // Transformations applied to broken trees lead to weird bugs, e.g. things at wrong nesting levels.
- // The safest thing is to bail on the whole process.
- //
- // Note that this can happen with valid user code!!!
- // This can trigger if FSR's compiler version is behind the one needed for language features in the code.
- // The user may think their code is correct, but the compiler may disagree.
- // In this scenario, it's particularly important to let the user know that something went wrong.
- // Otherwise, they may expect valid output, and get nearly valid output from a broken tree.
- // Trust me, these bugs are quite confusing when first encountered!
- var errorDiagnostics = trees.SelectMany(tree => tree.GetDiagnostics()).Where(d => d.Severity == DiagnosticSeverity.Error);
- if (errorDiagnostics.Any()) throw new SourceCodeHasErrorsException(errorDiagnostics);
-
- var sourceCodeWithAdjustments = trees.Select(tree =>
- {
- //skip if tree.FilePath null or empty
- if (string.IsNullOrEmpty(tree.FilePath))
- {
- LoggerScoped.LogError($"Skipping file as it has no path: {tree.FilePath}");
- return tree.GetRoot().ToFullString();
- }
-
- var root = tree.GetRoot();
-
- //WARN: needs to walk before root class name changes, otherwise it'll resolve wrong name
- var fieldsWalker = new FieldsWalker();
- fieldsWalker.Visit(root);
- typesDefined.AddRange(fieldsWalker.GetTypeNames());
-
- var typeToNewFieldDeclarations = new Dictionary>();
- if (FastScriptReloadManager.Instance.AssemblyChangesLoaderEditorOptionsNeededInBuild.EnableExperimentalAddedFieldsSupport)
- {
- var typeToFieldDeclarations = fieldsWalker.GetTypeToFieldDeclarations();
- typeToNewFieldDeclarations = typeToFieldDeclarations.ToDictionary(
- t => t.Key,
- t =>
- {
- if (!ProjectTypeCache.AllTypesInNonDynamicGeneratedAssemblies.TryGetValue(t.Key, out var existingType))
- {
- LoggerScoped.LogDebug($"Unable to find type: {t.Key} in loaded assemblies. If that's the class you've added field to then it may not be properly working. It's possible the class was not yet loaded / used and you can ignore that warning. If it's causing any issues please contact support");
- return new List();
- }
-
- var existingTypeMembersToReplace = NewFieldsRewriter.GetReplaceableMembers(existingType).Select(m => m.Name).ToList();
-
- var newFields = t.Value.Where(fD => !existingTypeMembersToReplace.Contains(fD.FieldName)).ToList();
-
- //TODO: ideally that registration would happen outside of this class
- //TODO: to work for LSR it needs to be handled in runtime
- TemporaryNewFieldValues.RegisterNewFields(
- existingType,
- newFields.ToDictionary(
- fD => fD.FieldName,
- fD => new TemporaryNewFieldValues.GetNewFieldInitialValue((Type forNewlyGeneratedType) =>
- {
- //TODO: PERF: could cache those - they run to init every new value (for every instance when accessed)
- return CreateNewFieldInitMethodRewriter.ResolveNewFieldsToCreateValueFn(forNewlyGeneratedType)[fD.FieldName]();
- })
- ),
- newFields.ToDictionary(
- fD => fD.FieldName,
- fD => new TemporaryNewFieldValues.GetNewFieldType((Type forNewlyGeneratedType) =>
- {
- //TODO: PERF: could cache those - they run to init every new value (for every instance when accessed)
- return (Type)CreateNewFieldInitMethodRewriter.ResolveNewFieldsToTypeFn(forNewlyGeneratedType)[fD.FieldName]();
- })
- )
- );
-
- return newFields.Select(fD => fD.FieldName).ToList();
- }
- );
-
-#if LiveScriptReload_Enabled
- if (typeToNewFieldDeclarations.Any(kv => kv.Value.Any()))
- {
- LoggerScoped.LogWarning($"{nameof(FastScriptReloadManager.Instance.AssemblyChangesLoaderEditorOptionsNeededInBuild.EnableExperimentalAddedFieldsSupport)} is enabled. This is not supported in running build. Quite likely it'll crash remote client.");
- }
-#endif
- }
-
- //WARN: application order is important, eg ctors need to happen before class names as otherwise ctors will not be recognised as ctors
- if (FastScriptReloadManager.Instance.EnableExperimentalThisCallLimitationFix)
- {
- root = new ThisCallRewriter(DebugWriteRewriteReasonAsComment).Visit(root);
- root = new ThisAssignmentRewriter(DebugWriteRewriteReasonAsComment).Visit(root);
- }
-
- if (FastScriptReloadManager.Instance.AssemblyChangesLoaderEditorOptionsNeededInBuild.EnableExperimentalAddedFieldsSupport)
- {
- root = new NewFieldsRewriter(typeToNewFieldDeclarations, DebugWriteRewriteReasonAsComment).Visit(root);
- root = new CreateNewFieldInitMethodRewriter(typeToNewFieldDeclarations, DebugWriteRewriteReasonAsComment).Visit(root);
- }
-
- root = new RedundantTypeNameQualifierRewriter(DebugWriteRewriteReasonAsComment).Visit(root);
-
- root = new ConstructorRewriter(adjustCtorOnlyForNonNestedTypes: true, DebugWriteRewriteReasonAsComment).Visit(root);
-
- var hotReloadCompliantRewriter = new HotReloadCompliantRewriter(DebugWriteRewriteReasonAsComment);
- root = hotReloadCompliantRewriter.Visit(root);
- combinedUsingStatements.AddRange(hotReloadCompliantRewriter.StrippedUsingDirectives);
-
- root = new BuilderPatternFunctionsRewriter(DebugWriteRewriteReasonAsComment).Visit(root);
- root = new RecordeRewriter(DebugWriteRewriteReasonAsComment).Visit(root);
- root = new ExtensionMethodsCallingOtherExtensionMethodsInSameFileRewriter(DebugWriteRewriteReasonAsComment).Visit(root);
-
- //processed as last step to simply rewrite all changes made before
- if (TryResolveUserDefinedOverridesRoot(tree.FilePath, definedPreprocessorSymbols, out var userDefinedOverridesRoot))
- {
- root = ProcessUserDefinedOverridesReplacements(tree.FilePath, root, userDefinedOverridesRoot);
- root = AddUserDefinedOverridenTypes(userDefinedOverridesRoot, root);
- }
-
- return root.ToFullString();
- }).ToList();
-
- var sourceCodeCombinedSb = new StringBuilder();
- sourceCodeCombinedSb.Append(DebuggingInformationComment);
-
- foreach (var usingStatement in combinedUsingStatements.Distinct())
- {
- sourceCodeCombinedSb.Append(usingStatement);
- }
-
- foreach (var sourceCodeWithAdjustment in sourceCodeWithAdjustments)
- {
- sourceCodeCombinedSb.AppendLine(sourceCodeWithAdjustment);
- }
-
- LoggerScoped.LogDebug("Source Code Created:\r\n\r\n" + sourceCodeCombinedSb);
- return new CreateSourceCodeCombinedContentsResult(sourceCodeCombinedSb.ToString(), typesDefined);
- }
-
- private static SyntaxNode AddUserDefinedOverridenTypes(SyntaxNode userDefinedOverridesRoot, SyntaxNode root)
- {
- try
- {
- var userDefinedOverrideTypes = userDefinedOverridesRoot.DescendantNodes().OfType()
- .ToDictionary(n => RoslynUtils.GetMemberFQDN(n, n.Identifier.ToString()));
- var allDefinedTypesInRecompiledFile = root.DescendantNodes().OfType()
- .ToDictionary(n => RoslynUtils.GetMemberFQDN(n, n.Identifier.ToString())); //what about nested types?
-
- var userDefinedOverrideTypesWithoutMatchnigInRecompiledFile = userDefinedOverrideTypes.Select(overridenType =>
- {
- if (!allDefinedTypesInRecompiledFile.ContainsKey(overridenType.Key))
- {
- return overridenType;
- }
-
- return default(KeyValuePair);
- })
- .Where(kv => kv.Key != default(string))
- .ToList();
-
- //types should be added either to root namespace or root of document
- var rootNamespace = root.DescendantNodes().OfType().FirstOrDefault();
- foreach (var overridenTypeToAdd in userDefinedOverrideTypesWithoutMatchnigInRecompiledFile)
- {
- var newMember = FastScriptReloadCodeRewriterBase.AddRewriteCommentIfNeeded(overridenTypeToAdd.Value,
- "New type defined in override file",
- true, //always write reason so it's not easy to miss in generated file
- true);
- if (rootNamespace != null)
- {
- rootNamespace =
- root.DescendantNodes().OfType()
- .FirstOrDefault(); //need to search again to make sure it didn't change
- var newRootNamespace = rootNamespace.AddMembers(newMember);
- root = root.ReplaceNode(rootNamespace, newRootNamespace);
- }
- else
- {
- root = ((CompilationUnitSyntax)root).AddMembers(newMember);
- }
- }
- }
- catch (Exception e)
- {
- Debug.LogError($"Unable to add user defined override types. {e}");
- }
-
- return root;
- }
-
- private static bool TryResolveUserDefinedOverridesRoot(string sourceCodeFile, List definedPreprocessorSymbols, out SyntaxNode userDefinedOverridesRoot)
- {
- if (ScriptGenerationOverridesManager.TryGetScriptOverride(new FileInfo(sourceCodeFile), out var userDefinedOverridesFile))
- {
- try
- {
- userDefinedOverridesRoot = CSharpSyntaxTree.ParseText(File.ReadAllText(userDefinedOverridesFile.FullName), new CSharpParseOptions(preprocessorSymbols: definedPreprocessorSymbols)).GetRoot();
- return true;
- }
- catch (Exception ex)
- {
- Debug.LogError($"Unable to resolve user defined overrides for file: '{userDefinedOverridesFile.FullName}' - please make sure it's compilable. Error: '{ex}'");
- }
- }
-
- userDefinedOverridesRoot = null;
- return false;
- }
-
- private static SyntaxNode ProcessUserDefinedOverridesReplacements(string sourceCodeFile, SyntaxNode root, SyntaxNode userDefinedOverridesRoot)
- {
- if (ScriptGenerationOverridesManager.TryGetScriptOverride(new FileInfo(sourceCodeFile), out var userDefinedOverridesFile))
- {
- try
- {
- var userDefinedScriptOverridesRewriter = new ManualUserDefinedScriptOverridesRewriter(userDefinedOverridesRoot,
- true); //always write rewrite reason so it's not easy to miss
- root = userDefinedScriptOverridesRewriter.Visit(root);
- }
- catch (Exception ex)
- {
- Debug.LogError($"Unable to resolve user defined overrides for file: '{userDefinedOverridesFile.FullName}' - please make sure it's compilable. Error: '{ex}'");
- }
- }
-
- return root;
- }
-
- protected static List ResolveReferencesToAdd(List excludeAssyNames)
- {
- var referencesToAdd = new List();
- foreach (var assembly in AppDomain.CurrentDomain
- .GetAssemblies() //TODO: PERF: just need to load once and cache? or get assembly based on changed file only?
- .Where(a => excludeAssyNames.All(assyName => !a.FullName.StartsWith(assyName))
- && CustomAttributeExtensions.GetCustomAttribute((Assembly)a) == null))
- {
- try
- {
- if (string.IsNullOrEmpty(assembly.Location))
- {
- LoggerScoped.LogDebug($"FastScriptReload: Assembly location is null, usually dynamic assembly, harmless.");
- continue;
- }
-
- referencesToAdd.Add(assembly.Location);
- }
- catch (Exception)
- {
- LoggerScoped.LogDebug($"Unable to add a reference to assembly as unable to get location or null: {assembly.FullName} when hot-reloading, this is likely dynamic assembly and won't cause issues");
- }
- }
-
- referencesToAdd = referencesToAdd.Where(r => !ReferencesExcludedFromHotReload.Any(rTe => r.EndsWith(rTe))).ToList();
-
- if (EnableExperimentalThisCallLimitationFix || FastScriptReloadManager.Instance.AssemblyChangesLoaderEditorOptionsNeededInBuild.EnableExperimentalAddedFieldsSupport)
- {
- IncludeMicrosoftCsharpReferenceToSupportDynamicKeyword(referencesToAdd);
- }
-
- return referencesToAdd;
- }
-
- private static void IncludeMicrosoftCsharpReferenceToSupportDynamicKeyword(List referencesToAdd)
- {
- //TODO: check .net4.5 backend not breaking?
- //ThisRewriters will cast to dynamic - if using .NET Standard 2.1 - reference is required
- referencesToAdd.Add(AssemblyCsharpFullPath);
- // referencesToAdd.Add(@"C:\Program Files\Unity\Hub\Editor\2021.3.12f1\Editor\Data\UnityReferenceAssemblies\unity-4.8-api\Microsoft.CSharp.dll");
- }
- }
-
- public class CreateSourceCodeCombinedContentsResult
- {
- public string SourceCode { get; }
- public List TypeNamesDefinitions { get; }
-
- public CreateSourceCodeCombinedContentsResult(string sourceCode, List typeNamesDefinitions)
- {
- SourceCode = sourceCode;
- TypeNamesDefinitions = typeNamesDefinitions;
- }
- }
-
- public class SourceCodeHasErrorsException : Exception
- {
- public SourceCodeHasErrorsException(IEnumerable errorDiagnostics) : base(MakeMessage(errorDiagnostics))
- {
- }
-
- private static string MakeMessage(IEnumerable errorDiagnostics)
- => "Failed to compile the original source code. The compiler found the following errors:"
- + Environment.NewLine
- + Environment.NewLine
- + string.Join(Environment.NewLine, errorDiagnostics.Select(d => d.ToString()));
- }
-}
\ No newline at end of file
diff --git a/Assets/FastScriptReload/Scripts/Editor/Compilation/DynamicCompilationBase.cs.meta b/Assets/FastScriptReload/Scripts/Editor/Compilation/DynamicCompilationBase.cs.meta
deleted file mode 100644
index 348fa36..0000000
--- a/Assets/FastScriptReload/Scripts/Editor/Compilation/DynamicCompilationBase.cs.meta
+++ /dev/null
@@ -1,10 +0,0 @@
-fileFormatVersion: 2
-guid: 4301ea2066a04de58f95c515e910ae3e
-timeCreated: 1669637741
-AssetOrigin:
- serializedVersion: 1
- productId: 239351
- packageName: Fast Script Reload
- packageVersion: 1.6.1
- assetPath: Assets/FastScriptReload/Scripts/Editor/Compilation/DynamicCompilationBase.cs
- uploadId: 710802
diff --git a/Assets/FastScriptReload/Scripts/Editor/Compilation/McsExeDynamicCompilation.cs b/Assets/FastScriptReload/Scripts/Editor/Compilation/McsExeDynamicCompilation.cs
deleted file mode 100644
index 1bd0c70..0000000
--- a/Assets/FastScriptReload/Scripts/Editor/Compilation/McsExeDynamicCompilation.cs
+++ /dev/null
@@ -1,64 +0,0 @@
-using System.Collections.Generic;
-using System.IO;
-using System.Linq;
-using UnityEngine;
-
-#if FastScriptReload_CompileViaMCS
-public class McsExeDynamicCompilation : DynamicCompilationBase
-{
- private const int ReferenceLenghtCountWarningThreshold = 32767 - 2000; //windows can accept up to 32767 chars as args, then it starts thorowing exceptions. MCS.exe is adding references via command /r:
-
- private static CompileResult Compile(List filePathsWithSourceCode)
- {
- var fileSourceCode = filePathsWithSourceCode.Select(File.ReadAllText);
-
- var providerOptions = new Dictionary();
- var provider = new Microsoft.CSharp.CSharpCodeProvider(providerOptions);
- var param = new System.CodeDom.Compiler.CompilerParameters();
-
- var excludeAssyNames = new List
- {
- "mscorlib"
- };
- var referencesToAdd = ResolveReferencesToAdd(excludeAssyNames);
-
- var referencePathCharLenght = referencesToAdd.Sum(r => r.Length);
- if (referencePathCharLenght > ReferenceLenghtCountWarningThreshold)
- {
- LoggerScoped.LogWarning(
- "Windows can accept up to 32767 chars as args, then it starts throwing exceptions. Dynamic compilation will use MCS.exe and will add references via command /r:, " +
- $"currently your assembly have {referencesToAdd.Count} references which full paths amount to: {referencePathCharLenght} chars." +
- $"\r\nIf you see this warning likely compilation will fail, you can:" +
- $"\r\n1) Move your project to be more top-level, as references take full paths, eg 'c:\\my-source\\stuff\\unity\\my-project\\' - this then gets repeated for many references, moving it close to top level will help" +
- $"\r\n2) Remove some of the assemblies if you don't need them" +
- "\r\n Please let me know via support email if that's causing you issues, there may be a fix if it's affecting many users, sorry about that!");
-
- //TODO: the process is started from Microsoft.CSharp.CSharpCodeGenerator.FromFileBatch, potentially all it'd be possible to patch that class to maybe copy all
- //assemblies to some top-level location and change parameters to run from this folder, with a working directory set, this would drastically reduce char count used by full refs
- //also mcs.exe allows to compile with -pkg:package1[,packageN], which somewhat bundles multiple references, maybe all unity engine refs could go in there, or all refs in general
- }
-
- param.ReferencedAssemblies.AddRange(referencesToAdd.ToArray());
- param.GenerateExecutable = false;
- param.GenerateInMemory = false;
- providerOptions.Add(PatchMcsArgsGeneration.PreprocessorDirectivesProviderOptionsKey,
- string.Join(";", ActiveScriptCompilationDefines));
-
- var sourceCodeCombined = CreateSourceCodeCombinedContents(fileSourceCode);
- var result = provider.CompileAssemblyFromSource(param, sourceCodeCombined, DynamicallyCreatedAssemblyAttributeSourceCode);
- var errors = new List();
- foreach (var error in result.Errors)
- {
- errors.Add(error.ToString());
- }
- return new CompileResult(
- result.CompiledAssembly.FullName,
- errors,
- result.NativeCompilerReturnValue,
- result.CompiledAssembly,
- sourceCodeCombined,
- string.Empty
- );
- }
-}
-#endif
\ No newline at end of file
diff --git a/Assets/FastScriptReload/Scripts/Editor/Compilation/McsExeDynamicCompilation.cs.meta b/Assets/FastScriptReload/Scripts/Editor/Compilation/McsExeDynamicCompilation.cs.meta
deleted file mode 100644
index 0f2ffce..0000000
--- a/Assets/FastScriptReload/Scripts/Editor/Compilation/McsExeDynamicCompilation.cs.meta
+++ /dev/null
@@ -1,10 +0,0 @@
-fileFormatVersion: 2
-guid: 5a359917ce85466389622feaf196d024
-timeCreated: 1669637866
-AssetOrigin:
- serializedVersion: 1
- productId: 239351
- packageName: Fast Script Reload
- packageVersion: 1.6.1
- assetPath: Assets/FastScriptReload/Scripts/Editor/Compilation/McsExeDynamicCompilation.cs
- uploadId: 710802
diff --git a/Assets/FastScriptReload/Scripts/Editor/Compilation/PatchMcsArgsGeneration.cs b/Assets/FastScriptReload/Scripts/Editor/Compilation/PatchMcsArgsGeneration.cs
deleted file mode 100644
index 8a371b4..0000000
--- a/Assets/FastScriptReload/Scripts/Editor/Compilation/PatchMcsArgsGeneration.cs
+++ /dev/null
@@ -1,110 +0,0 @@
-#if FastScriptReload_CompileViaMCS
-using System;
-using System.CodeDom.Compiler;
-using System.Collections.Generic;
-using System.Text;
-using FastScriptReload.Runtime;
-using HarmonyLib;
-using UnityEditor;
-
-[InitializeOnLoad]
-[PreventHotReload]
-public class PatchMcsArgsGeneration
-{
- public const string PreprocessorDirectivesProviderOptionsKey = "PreprocessorDirectives";
-
- static PatchMcsArgsGeneration()
- {
- var harmony = new Harmony(nameof(PatchMcsArgsGeneration));
-
- var original = AccessTools.Method("Microsoft.CSharp.CSharpCodeGenerator:BuildArgs");
- var postfix = AccessTools.Method(typeof(PatchMcsArgsGeneration), nameof(BuildArgsPostfix));
-
- harmony.Patch(original, postfix: new HarmonyMethod(postfix));
- }
-
- //Copied from Microsoft.CSharp.CSharpCodeGenerator.BuildArgs
- private static void BuildArgsPostfix(
- CompilerParameters options,
- string[] fileNames,
- IDictionary providerOptions,
- ref string __result)
- {
- StringBuilder stringBuilder = new StringBuilder();
- if (options.GenerateExecutable)
- stringBuilder.Append("/target:exe ");
- else
- stringBuilder.Append("/target:library ");
- string privateBinPath = AppDomain.CurrentDomain.SetupInformation.PrivateBinPath;
- if (privateBinPath != null && privateBinPath.Length > 0)
- stringBuilder.AppendFormat("/lib:\"{0}\" ", (object) privateBinPath);
- if (options.Win32Resource != null)
- stringBuilder.AppendFormat("/win32res:\"{0}\" ", (object) options.Win32Resource);
- if (options.IncludeDebugInformation)
- stringBuilder.Append("/debug+ /optimize- ");
- else
- stringBuilder.Append("/debug- /optimize+ ");
- if (options.TreatWarningsAsErrors)
- stringBuilder.Append("/warnaserror ");
- if (options.WarningLevel >= 0)
- stringBuilder.AppendFormat("/warn:{0} ", (object) options.WarningLevel);
- if (options.OutputAssembly == null || options.OutputAssembly.Length == 0)
- {
- string extension = options.GenerateExecutable ? "exe" : "dll"; //TODO:readd
- // options.OutputAssembly = CSharpCodeGenerator.GetTempFileNameWithExtension(options.TempFiles, extension, !options.GenerateInMemory);
- }
- stringBuilder.AppendFormat("/out:\"{0}\" ", (object) options.OutputAssembly);
- foreach (string referencedAssembly in options.ReferencedAssemblies)
- {
- if (referencedAssembly != null && referencedAssembly.Length != 0)
- stringBuilder.AppendFormat("/r:\"{0}\" ", (object) referencedAssembly);
- }
- if (options.CompilerOptions != null)
- {
- stringBuilder.Append(options.CompilerOptions);
- stringBuilder.Append(" ");
- }
- foreach (string embeddedResource in options.EmbeddedResources)
- stringBuilder.AppendFormat("/resource:\"{0}\" ", (object) embeddedResource);
- foreach (string linkedResource in options.LinkedResources)
- stringBuilder.AppendFormat("/linkresource:\"{0}\" ", (object) linkedResource);
-
- //WARN: that's how it's in source, quite odd, doesn't do much if compiler version specified?
- // if (providerOptions != null && providerOptions.Count > 0)
- // {
- // string str;
- // if (!providerOptions.TryGetValue("CompilerVersion", out str))
- // str = "3.5";
- // if (str.Length >= 1 && str[0] == 'v')
- // str = str.Substring(1);
- // if (str != "2.0")
- // {
- // }
- // else
- // stringBuilder.Append("/langversion:ISO-2 ");
- // }
-
- stringBuilder.Append("/langversion:experimental ");
-
- CustomPatchAdditionAddPreprocessorDirectives(providerOptions, stringBuilder);
-
- stringBuilder.Append("/noconfig ");
- stringBuilder.Append(" -- ");
- foreach (string fileName in fileNames)
- stringBuilder.AppendFormat("\"{0}\" ", (object) fileName);
-
- __result = stringBuilder.ToString();
- }
-
- private static void CustomPatchAdditionAddPreprocessorDirectives(IDictionary providerOptions, StringBuilder stringBuilder)
- {
- if (providerOptions != null && providerOptions.Count > 0)
- {
- if (providerOptions.TryGetValue(PreprocessorDirectivesProviderOptionsKey, out var preprocessorDirectives))
- {
- stringBuilder.Append($"/d:\"{preprocessorDirectives}\" ");
- }
- }
- }
-}
-#endif
\ No newline at end of file
diff --git a/Assets/FastScriptReload/Scripts/Editor/Compilation/PatchMcsArgsGeneration.cs.meta b/Assets/FastScriptReload/Scripts/Editor/Compilation/PatchMcsArgsGeneration.cs.meta
deleted file mode 100644
index 3abf63a..0000000
--- a/Assets/FastScriptReload/Scripts/Editor/Compilation/PatchMcsArgsGeneration.cs.meta
+++ /dev/null
@@ -1,10 +0,0 @@
-fileFormatVersion: 2
-guid: 26428224dc3f4d069690c15cbfb3a070
-timeCreated: 1669209480
-AssetOrigin:
- serializedVersion: 1
- productId: 239351
- packageName: Fast Script Reload
- packageVersion: 1.6.1
- assetPath: Assets/FastScriptReload/Scripts/Editor/Compilation/PatchMcsArgsGeneration.cs
- uploadId: 710802
diff --git a/Assets/FastScriptReload/Scripts/Editor/Compilation/ScriptGenerationOverrides.meta b/Assets/FastScriptReload/Scripts/Editor/Compilation/ScriptGenerationOverrides.meta
deleted file mode 100644
index 825b5d7..0000000
--- a/Assets/FastScriptReload/Scripts/Editor/Compilation/ScriptGenerationOverrides.meta
+++ /dev/null
@@ -1,3 +0,0 @@
-fileFormatVersion: 2
-guid: a9e1198b8d42486bae230272101c0951
-timeCreated: 1678099546
\ No newline at end of file
diff --git a/Assets/FastScriptReload/Scripts/Editor/Compilation/ScriptGenerationOverrides/ScriptGenerationOverridesManager.cs b/Assets/FastScriptReload/Scripts/Editor/Compilation/ScriptGenerationOverrides/ScriptGenerationOverridesManager.cs
deleted file mode 100644
index cf38f63..0000000
--- a/Assets/FastScriptReload/Scripts/Editor/Compilation/ScriptGenerationOverrides/ScriptGenerationOverridesManager.cs
+++ /dev/null
@@ -1,207 +0,0 @@
-using System;
-using System.Collections.Generic;
-using System.IO;
-using System.Linq;
-using FastScriptReload.Runtime;
-using Microsoft.CodeAnalysis;
-using Microsoft.CodeAnalysis.CSharp;
-using Microsoft.CodeAnalysis.CSharp.Syntax;
-using UnityEditor;
-using UnityEditorInternal;
-using UnityEngine;
-
-namespace FastScriptReload.Editor.Compilation.ScriptGenerationOverrides
-{
- [InitializeOnLoad]
- public static class ScriptGenerationOverridesManager
- {
- private static float LoadOverridesFolderFilesEveryNSeconds = 5;
-
- private static readonly string TemplateInterfaceDeclaration = @"
-
-//New interface declaration, this is very useful in cases where code depends on some internal interfaces that re-compiled code can no longer access. Simply define them here and code will compile.
-//You can add any type in that manner
-public interface ITestNewInterface {
- bool Test { get; set; }
-}";
-
- private static readonly string TemplateTopComment = @"// You can use this file to specify custom code overrides. Those will be applied to resulting code.
-// This approach is very useful if your code is failing to compile due to one of the existing limitations.
-//
-// While I work on reducing limitations you can simply specify override with proper code to make sure you can continue working.
-//
-// 1) Simply define code with same structure as your original class, make sure to include any namespace.
-// 2) Rename classes and types to have '' postfix.
-//
-// eg. 'MyClassName' needs to be changed to MyClassName otherwise it won't be properly connected.
-//
-// 3) Add any methods that you want to override, using same method signature. Whole method body will be replaced and no code adjustments will be run on it.
-// 4) You can add any additional types - this is quite useful when you hit limitation with internal interfaces - where compiler can not access them due to protection modifiers.
-// You can simply redefine those here, while not ideal it'll allow you to continue using Hot-Reload without modifying your code.
-//
-// Tool will now attempt to create a template file for you with first found class and first method as override, please adjust as necessary.
-// It'll also create an example redefined interface.
-// If you can't see anything please refer to the above and create overrides file manually.
-//
-// You can also refer to documentation section 'User defined script rewrite overrides'
-";
-
- public static DirectoryInfo UserDefinedScriptRewriteOverridesFolder { get; }
- private static double _lastTimeOverridesFolderFilesRead;
-
- public static List UserDefinedScriptOverrides { get; } = new List();
-
- static ScriptGenerationOverridesManager()
- {
- //TODO: allow to customize later from code, eg for user that'd like to include in source control
- UserDefinedScriptRewriteOverridesFolder = new DirectoryInfo(Application.persistentDataPath + @"\FastScriptReload\ScriptOverrides");
- UpdateUserDefinedScriptOverridesFileCache();
- EditorApplication.update += Update;
- }
-
- private static void Update()
- {
- var timeSinceStartup = EditorApplication.timeSinceStartup;
- if (_lastTimeOverridesFolderFilesRead + LoadOverridesFolderFilesEveryNSeconds < timeSinceStartup)
- {
- _lastTimeOverridesFolderFilesRead = timeSinceStartup;
-
- UpdateUserDefinedScriptOverridesFileCache();
- }
- }
-
- private static void UpdateUserDefinedScriptOverridesFileCache()
- {
- UserDefinedScriptOverrides.Clear();
- if (UserDefinedScriptRewriteOverridesFolder.Exists)
- {
- UserDefinedScriptOverrides.AddRange(UserDefinedScriptRewriteOverridesFolder.GetFiles().Select(f => new UserDefinedScriptOverride(f)));
- }
- }
-
- public static void AddScriptOverride(MonoScript script)
- {
- AddScriptOverride(new FileInfo(Path.Combine(Path.Combine(Application.dataPath + "//..", AssetDatabase.GetAssetPath(script)))));
- }
-
- public static void AddScriptOverride(FileInfo originalFile)
- {
- EnsureOverrideFolderExists();
-
- var overridenFile = new FileInfo(Path.Combine(UserDefinedScriptRewriteOverridesFolder.FullName, originalFile.Name));
- if (!overridenFile.Exists)
- {
- var templateString = string.Empty;
- try
- {
- var fileCode = File.ReadAllText(originalFile.FullName);
- var tree = CSharpSyntaxTree.ParseText(fileCode, new CSharpParseOptions(preprocessorSymbols: DynamicCompilationBase.ActiveScriptCompilationDefines));
- var root = tree.GetRoot();
-
- var firstType = root.DescendantNodes().OfType().FirstOrDefault();
- if (firstType != null)
- {
- var members = new SyntaxList();
- var firstMethod = firstType.DescendantNodes().OfType().FirstOrDefault(m => m.Body != null);
- if (firstMethod != null)
- {
- var block = SyntaxFactory.Block();
- block = block.AddStatements(SyntaxFactory.EmptyStatement().WithLeadingTrivia(
- SyntaxFactory.Comment(@"/* Any code will be replaced with original method of same signature in same type*/"))
- );
- firstMethod = firstMethod
- .WithBody(block)
- .WithTriviaFrom(firstMethod);
- members = members.Add(firstMethod);
- }
-
- root = root.ReplaceNode(firstType, firstType
- .ReplaceToken(
- firstType.Identifier,
- SyntaxFactory.Identifier(firstType.Identifier.ValueText + AssemblyChangesLoader.ClassnamePatchedPostfix)
- )
- .WithMembers(members)).NormalizeWhitespace();
-
- var interfaceDeclaration = CSharpSyntaxTree.ParseText(TemplateInterfaceDeclaration);
-
- root = ((CompilationUnitSyntax)root).AddMembers(
- interfaceDeclaration.GetRoot().DescendantNodes().OfType().First()
- );
- }
-
- templateString = root.ToFullString();
- }
- catch (Exception e)
- {
- Debug.LogError($"Unable to generate user defined script override template from your file, please refer to note at the start of the file. {e}");
- }
-
- if (!overridenFile.Exists)
- {
- File.WriteAllText(overridenFile.FullName,
- TemplateTopComment.Replace("", AssemblyChangesLoader.ClassnamePatchedPostfix) + templateString
- );
- UpdateUserDefinedScriptOverridesFileCache();
- }
- }
-
- InternalEditorUtility.OpenFileAtLineExternal(overridenFile.FullName, 0);
- }
-
- public static bool TryRemoveScriptOverride(MonoScript originalScript)
- {
- EnsureOverrideFolderExists();
-
- var overridenFile = new FileInfo(Path.Combine(UserDefinedScriptRewriteOverridesFolder.FullName, originalScript.name + ".cs"));
- if (overridenFile.Exists)
- {
- return TryRemoveScriptOverride(overridenFile);
- }
-
- return false;
- }
-
- private static bool TryRemoveScriptOverride(FileInfo overridenFile)
- {
- try
- {
- overridenFile.Delete();
- UpdateUserDefinedScriptOverridesFileCache();
- }
- catch (Exception)
- {
- Debug.Log($"Unable to remove: '{overridenFile.Name}' - make sure it's not locked / open in editor");
- throw;
- }
-
- return true;
- }
-
- public static bool TryRemoveScriptOverride(UserDefinedScriptOverride scriptOverride)
- {
- return TryRemoveScriptOverride(scriptOverride.File);
- }
-
- public static bool TryGetScriptOverride(FileInfo changedFile, out FileInfo overridesFile)
- {
- overridesFile = UserDefinedScriptOverrides.FirstOrDefault(f => f.File.Name == changedFile.Name && f.File.Exists)?.File;
- return overridesFile?.Exists ?? false;
- }
-
- private static void EnsureOverrideFolderExists()
- {
- if (!UserDefinedScriptRewriteOverridesFolder.Exists)
- UserDefinedScriptRewriteOverridesFolder.Create();
- }
- }
-
- public class UserDefinedScriptOverride
- {
- public FileInfo File { get; }
-
- public UserDefinedScriptOverride(FileInfo file)
- {
- File = file;
- }
- }
-}
\ No newline at end of file
diff --git a/Assets/FastScriptReload/Scripts/Editor/Compilation/ScriptGenerationOverrides/ScriptGenerationOverridesManager.cs.meta b/Assets/FastScriptReload/Scripts/Editor/Compilation/ScriptGenerationOverrides/ScriptGenerationOverridesManager.cs.meta
deleted file mode 100644
index 4928891..0000000
--- a/Assets/FastScriptReload/Scripts/Editor/Compilation/ScriptGenerationOverrides/ScriptGenerationOverridesManager.cs.meta
+++ /dev/null
@@ -1,10 +0,0 @@
-fileFormatVersion: 2
-guid: f699ee76d75a40b290cad5dd79619842
-timeCreated: 1678099566
-AssetOrigin:
- serializedVersion: 1
- productId: 239351
- packageName: Fast Script Reload
- packageVersion: 1.6.1
- assetPath: Assets/FastScriptReload/Scripts/Editor/Compilation/ScriptGenerationOverrides/ScriptGenerationOverridesManager.cs
- uploadId: 710802
diff --git a/Assets/FastScriptReload/Scripts/Editor/CustomFileWatcher.cs b/Assets/FastScriptReload/Scripts/Editor/CustomFileWatcher.cs
deleted file mode 100644
index 7b454e7..0000000
--- a/Assets/FastScriptReload/Scripts/Editor/CustomFileWatcher.cs
+++ /dev/null
@@ -1,223 +0,0 @@
-using UnityEngine;
-using UnityEditor;
-using System.Collections.Generic;
-using System.IO;
-using System.Security.Cryptography;
-using System.Text;
-using FastScriptReload.Editor;
-using System;
-using System.Threading;
-
-[InitializeOnLoad]
-public class CustomFileWatcher : EditorWindow
-{
- public class HashEntry
- {
- private Dictionary _hashes = new Dictionary();
- // Some metadata for the update function to use
- // WARN: Note this data isn't exactly synced up or anything. It just reads it in when the filewatcher is initialized.
- private string _searchPattern;
- private bool _includeSubdirectories;
-
- public Dictionary Hashes => _hashes;
- public string SearchPattern => _searchPattern;
- public bool IncludeSubdirectories => _includeSubdirectories;
-
- public HashEntry(Dictionary hashes, string searchPattern, bool includeSubdirectories)
- {
- _hashes = hashes;
- _searchPattern = searchPattern;
- _includeSubdirectories = includeSubdirectories;
- }
- }
-
- private static Dictionary FileHashes;
- private static object StateLock = new object();
-
- private static object ListLock; // Shared lock object
- private static Thread LivewatcherThread;
-
- public static bool InitSignaled = false;
- private static readonly int WatcherThreadRunEveryNSeconds = 500; //TODO: expose in settings
-
- static CustomFileWatcher()
- {
- FileHashes = new Dictionary();
- ListLock = new object();
- LivewatcherThread = null;
- }
-
- private static void UpdateFileWatcher()
- {
- if (FileHashes.Count > 0)
- {
- foreach (var kvp in FileHashes)
- {
- CheckForChanges(kvp.Key, kvp.Value.SearchPattern, kvp.Value.IncludeSubdirectories);
- }
- }
- else
- {
- Debug.LogError("File watcher has not been initialized yet. Please initialize first.");
- }
- }
-
- public static void TryEnableLivewatching()
- {
- if (LivewatcherThread != null)
- {
- Debug.LogWarning("Livewatcher is already running.");
- return;
- }
-
- // Run on a separate thread every 1 second
- LivewatcherThread = new Thread(() =>
- {
- var timer = new Timer((state) =>
- {
- // Go at it if we've initialized
- if (FileHashes.Count > 0)
- UpdateFileWatcher();
- }, null, 0, WatcherThreadRunEveryNSeconds);
- });
-
- LivewatcherThread.Start();
- }
-
- public static void InitializeSingularFilewatcher(string directoryPath, string searchPattern, bool includeSubdirectories)
- {
-#if ImmersiveVrTools_DebugEnabled
- Debug.Log("Initializing hashes for directory: " + directoryPath);
-#endif
-
- var thread = new Thread(() =>
- {
- lock (StateLock)
- {
- var hashes = new Dictionary();
- var files = Directory.GetFiles(directoryPath, searchPattern, includeSubdirectories ? SearchOption.AllDirectories : SearchOption.TopDirectoryOnly);
-
- foreach (var filePath in files)
- {
- var hash = GetFileHash(filePath);
- hashes[filePath] = hash;
- }
-
- FileHashes[directoryPath] = new HashEntry(hashes, searchPattern, includeSubdirectories);
- }
- });
- thread.Start();
- }
-
- private static void CheckForChanges(string directoryPath, string searchPattern, bool includeSubdirectories)
- {
- // Not really sure if this nuclear locking is needed
- lock (StateLock)
- {
- var hashes = FileHashes[directoryPath].Hashes;
-
- // Time profiling: Start the stopwatch for Directory.GetFiles
-#if ImmersiveVrTools_DebugEnabled
-
- System.Diagnostics.Stopwatch getFilesStopwatch = new System.Diagnostics.Stopwatch();
- getFilesStopwatch.Start();
-#endif
-
- string[] files = Directory.GetFiles(directoryPath, searchPattern, includeSubdirectories ? SearchOption.AllDirectories : SearchOption.TopDirectoryOnly);
-
-#if ImmersiveVrTools_DebugEnabled
-
- // Time profiling: Stop the stopwatch for Directory.GetFiles and log the elapsed time
- getFilesStopwatch.Stop();
- Debug.Log("Directory.GetFiles elapsed time: " + getFilesStopwatch.ElapsedMilliseconds + " ms");
-#endif
-
- // Check if files were created or modified
- // Time profiling: Start the stopwatch for file creation/modification
- var fileChangeStopwatch = new System.Diagnostics.Stopwatch();
- fileChangeStopwatch.Start();
-
- foreach (var file in files)
- {
- if (!hashes.ContainsKey(file))
- {
- // New file
-#if ImmersiveVrTools_DebugEnabled
- Debug.Log("New file: " + file);
-#endif
- continue;
- }
-
- else if (hashes[file] != GetFileHash(file))
- {
- // File changed
-#if ImmersiveVrTools_DebugEnabled
- Debug.Log("File changed: " + file);
-#endif
- RecordChange(file);
- }
- }
-
-#if ImmersiveVrTools_DebugEnabled
- // Time profiling: Stop the stopwatch for file creation/modification and log the elapsed time
- fileChangeStopwatch.Stop();
- Debug.Log("File creation/modification elapsed time: " + fileChangeStopwatch.ElapsedMilliseconds + " ms");
-#endif
-
- // Check if any files were deleted
- // Time profiling: Start the stopwatch for file deletion
- var fileDeletionStopwatch = new System.Diagnostics.Stopwatch();
- fileDeletionStopwatch.Start();
-
- foreach (var kvp in hashes)
- {
- if (!File.Exists(kvp.Key))
- {
-#if ImmersiveVrTools_DebugEnabled
- Debug.Log("File deleted: " + kvp.Key);
-#endif
- }
- }
-
- // Time profiling: Stop the stopwatch for file deletion and log the elapsed time
-#if ImmersiveVrTools_DebugEnabled
- fileDeletionStopwatch.Stop();
- Debug.Log("File deletion elapsed time: " + fileDeletionStopwatch.ElapsedMilliseconds + " ms");
-#endif
-
- // Update hashes
- hashes.Clear();
- foreach (var file in files)
- {
- var hash = GetFileHash(file);
- hashes[file] = hash;
- }
- }
- }
-
-
- private static string GetFileHash(string filePath)
- {
- using (var md5 = MD5.Create())
- using (var stream = File.OpenRead(filePath))
- {
- var hashBytes = md5.ComputeHash(stream);
- var sb = new StringBuilder();
- for (var i = 0; i < hashBytes.Length; i++)
- {
- sb.Append(hashBytes[i].ToString("x2"));
- }
- return sb.ToString();
- }
- }
-
- private static void RecordChange(string path)
- {
- if (FastScriptReloadManager.Instance.ShouldIgnoreFileChange()) return;
-
- lock (ListLock)
- {
- FastScriptReloadManager.Instance.AddFileChangeToProcess(path);
- }
- }
-}
diff --git a/Assets/FastScriptReload/Scripts/Editor/CustomFileWatcher.cs.meta b/Assets/FastScriptReload/Scripts/Editor/CustomFileWatcher.cs.meta
deleted file mode 100644
index 24dde56..0000000
--- a/Assets/FastScriptReload/Scripts/Editor/CustomFileWatcher.cs.meta
+++ /dev/null
@@ -1,18 +0,0 @@
-fileFormatVersion: 2
-guid: 550c0c3f77d436e4fb133b8d029eb6a6
-MonoImporter:
- externalObjects: {}
- serializedVersion: 2
- defaultReferences: []
- executionOrder: 0
- icon: {instanceID: 0}
- userData:
- assetBundleName:
- assetBundleVariant:
-AssetOrigin:
- serializedVersion: 1
- productId: 239351
- packageName: Fast Script Reload
- packageVersion: 1.6.1
- assetPath: Assets/FastScriptReload/Scripts/Editor/CustomFileWatcher.cs
- uploadId: 710802
diff --git a/Assets/FastScriptReload/Scripts/Editor/FastScriptReload.Editor.asmdef b/Assets/FastScriptReload/Scripts/Editor/FastScriptReload.Editor.asmdef
deleted file mode 100644
index c71d557..0000000
--- a/Assets/FastScriptReload/Scripts/Editor/FastScriptReload.Editor.asmdef
+++ /dev/null
@@ -1,25 +0,0 @@
-{
- "name": "FastScriptReload.Editor",
- "rootNamespace": "",
- "references": [
- "GUID:b75b497805046c443a21f90e84a5ff4f"
- ],
- "includePlatforms": [
- "Editor"
- ],
- "excludePlatforms": [],
- "allowUnsafeCode": true,
- "overrideReferences": true,
- "precompiledReferences": [
- "0Harmony.dll",
- "Microsoft.CodeAnalysis.dll",
- "Microsoft.CodeAnalysis.CSharp.dll",
- "ImmersiveVRTools.Common.Editor.dll",
- "ImmersiveVRTools.Common.Runtime.dll",
- "System.Collections.Immutable.FSR.dll"
- ],
- "autoReferenced": false,
- "defineConstraints": [],
- "versionDefines": [],
- "noEngineReferences": false
-}
\ No newline at end of file
diff --git a/Assets/FastScriptReload/Scripts/Editor/FastScriptReload.Editor.asmdef.meta b/Assets/FastScriptReload/Scripts/Editor/FastScriptReload.Editor.asmdef.meta
deleted file mode 100644
index 00ef5c8..0000000
--- a/Assets/FastScriptReload/Scripts/Editor/FastScriptReload.Editor.asmdef.meta
+++ /dev/null
@@ -1,14 +0,0 @@
-fileFormatVersion: 2
-guid: 97dcf6b63da809f4aa9573d9e792e540
-AssemblyDefinitionImporter:
- externalObjects: {}
- userData:
- assetBundleName:
- assetBundleVariant:
-AssetOrigin:
- serializedVersion: 1
- productId: 239351
- packageName: Fast Script Reload
- packageVersion: 1.6.1
- assetPath: Assets/FastScriptReload/Scripts/Editor/FastScriptReload.Editor.asmdef
- uploadId: 710802
diff --git a/Assets/FastScriptReload/Scripts/Editor/FastScriptReloadManager.cs b/Assets/FastScriptReload/Scripts/Editor/FastScriptReloadManager.cs
deleted file mode 100644
index 9b774c3..0000000
--- a/Assets/FastScriptReload/Scripts/Editor/FastScriptReloadManager.cs
+++ /dev/null
@@ -1,863 +0,0 @@
-using System;
-using System.Collections.Generic;
-using System.IO;
-using System.Linq;
-using System.Text;
-using System.Threading.Tasks;
-using FastScriptReload.Editor.Compilation;
-using FastScriptReload.Editor.Compilation.ScriptGenerationOverrides;
-using FastScriptReload.Runtime;
-using ImmersiveVRTools.Editor.Common.Utilities;
-using ImmersiveVRTools.Runtime.Common;
-using ImmersiveVrToolsCommon.Runtime.Logging;
-using UnityEditor;
-using UnityEditor.Compilation;
-using UnityEngine;
-
-namespace FastScriptReload.Editor
-{
- [InitializeOnLoad]
- [PreventHotReload]
- public class FastScriptReloadManager
- {
- private static FastScriptReloadManager _instance;
- public static FastScriptReloadManager Instance
- {
- get {
- if (_instance == null)
- {
- _instance = new FastScriptReloadManager();
- LoggerScoped.LogDebug("Created Manager");
- }
-
- return _instance;
- }
- }
-
- private static string DataPath = Application.dataPath;
-
-
- public const string FileWatcherReplacementTokenForApplicationDataPath = "";
- private const int BaseMenuItemPriority_ManualScriptOverride = 100;
- private const int BaseMenuItemPriority_Exclusions = 200;
- private const int BaseMenuItemPriority_FileWatcher = 300;
-
- public Dictionary> FileWatcherTokensToResolvePathFn = new Dictionary>
- {
- [FileWatcherReplacementTokenForApplicationDataPath] = () => DataPath
- };
-
- private Dictionary _lastProcessedDynamicFileHotReloadStatesInSession = new Dictionary();
- public IReadOnlyDictionary LastProcessedDynamicFileHotReloadStatesInSession => _lastProcessedDynamicFileHotReloadStatesInSession;
- public event Action> HotReloadFailed;
- public event Action> HotReloadSucceeded;
-
- private bool _wasLockReloadAssembliesCalled;
- private PlayModeStateChange _lastPlayModeStateChange;
- private List _fileWatchers = new List();
- private IEnumerable _currentFileExclusions;
- private int _triggerDomainReloadIfOverNDynamicallyLoadedAssembles = 100;
- public bool EnableExperimentalThisCallLimitationFix { get; private set; }
- public bool IsPartialClassSupportEnabled { get; private set; }
-#pragma warning disable 0618
- public AssemblyChangesLoaderEditorOptionsNeededInBuild AssemblyChangesLoaderEditorOptionsNeededInBuild { get; private set; } = new AssemblyChangesLoaderEditorOptionsNeededInBuild();
-
-#pragma warning restore 0618
-
- private List _dynamicFileHotReloadStateEntries = new List();
-
- private DateTime _lastTimeChangeBatchRun = default(DateTime);
- private bool _assemblyChangesLoaderResolverResolutionAlreadyCalled;
- private bool _isEditorModeHotReloadEnabled;
- private int _hotReloadPerformedCount = 0;
- private bool _isOnDemandHotReloadEnabled;
-
- private void OnWatchedFileChange(object source, FileSystemEventArgs e)
- {
- if (ShouldIgnoreFileChange()) return;
-
- var filePathToUse = e.FullPath;
- if (!File.Exists(filePathToUse))
- {
- if (!TryWorkaroundForUnityFileWatcherBug(e, ref filePathToUse))
- return;
- }
-
- AddFileChangeToProcess(filePathToUse);
- }
-
- public void AddFileChangeToProcess(string filePath)
- {
- if (!File.Exists(filePath))
- {
- LoggerScoped.LogWarning($"Specified file: '{filePath}' does not exist. Hot-Reload will not be performed.");
- return;
- }
-
- if (_currentFileExclusions != null && _currentFileExclusions.Any(fp => filePath.Replace("\\", "/").EndsWith(fp)))
- {
- LoggerScoped.LogWarning($"FastScriptReload: File: '{filePath}' changed, but marked as exclusion. Hot-Reload will not be performed. You can manage exclusions via" +
- $"\r\nRight click context menu (Fast Script Reload > Add / Remove Hot-Reload exclusion)" +
- $"\r\nor via Window -> Fast Script Reload -> Start Screen -> Exclusion menu");
-
- return;
- }
-
- const int msThresholdToConsiderSameChangeFromDifferentFileWatchers = 500;
- var isDuplicatedChangesComingFromDifferentFileWatcher = _dynamicFileHotReloadStateEntries
- .Any(f => f.FullFileName == filePath
- && (DateTime.UtcNow - f.FileChangedOn).TotalMilliseconds < msThresholdToConsiderSameChangeFromDifferentFileWatchers);
- if (isDuplicatedChangesComingFromDifferentFileWatcher)
- {
- LoggerScoped.LogWarning($"FastScriptReload: Looks like change to: {filePath} have already been added for processing. This can happen if you have multiple file watchers set in a way that they overlap.");
- return;
- }
-
- _dynamicFileHotReloadStateEntries.Add(new DynamicFileHotReloadState(filePath, DateTime.UtcNow));
- }
-
- public bool ShouldIgnoreFileChange()
- {
- if (!_isEditorModeHotReloadEnabled && _lastPlayModeStateChange != PlayModeStateChange.EnteredPlayMode)
- {
-#if ImmersiveVrTools_DebugEnabled
- LoggerScoped.Log($"Application not playing, change to: {e.Name} won't be compiled and hot reloaded");
-#endif
- return true;
- }
-
- return false;
- }
-
- private void StartWatchingDirectoryAndSubdirectories(string directoryPath, string filter, bool includeSubdirectories)
- {
- foreach (var kv in FileWatcherTokensToResolvePathFn)
- {
- directoryPath = directoryPath.Replace(kv.Key, kv.Value());
- }
-
- var directoryInfo = new DirectoryInfo(directoryPath);
- if (!directoryInfo.Exists)
- {
- LoggerScoped.LogWarning($"FastScriptReload: Directory: '{directoryPath}' does not exist, make sure file-watcher setup is correct. You can access via: Window -> Fast Script Reload -> File Watcher (Advanced Setup)");
- }
-
- switch ((FileWatcherImplementation)FastScriptReloadPreference.FileWatcherImplementationInUse.GetEditorPersistedValueOrDefault())
- {
- case FileWatcherImplementation.UnityDefault:
- var fileWatcher = new FileSystemWatcher();
-
- fileWatcher.Path = directoryInfo.FullName;
- fileWatcher.IncludeSubdirectories = includeSubdirectories;
- fileWatcher.Filter = filter;
- fileWatcher.NotifyFilter = NotifyFilters.LastWrite;
- fileWatcher.Changed += OnWatchedFileChange;
-
- fileWatcher.EnableRaisingEvents = true;
-
- _fileWatchers.Add(fileWatcher);
-
- break;
-#if UNITY_2021_1_OR_NEWER && UNITY_EDITOR_WIN
- case FileWatcherImplementation.DirectWindowsApi:
- // On Windows, this is a WindowsFileSystemWatcher.
- // On other platforms, it's the default Mono implementation.
- // The WindowsFileSystemWatcher has much lower latency on Windows.
- // However, there's a small issue:
- // The WindowsFileSystemWatcher can, theoretically, miss events.
- // This is true in Microsoft's implementation as well as ours.
- // (Actually, ours should be slightly better.)
- // This can happen if a change occurs during the brief moment
- // during which the previous batch of changes are being
- // recorded and queued.
- // It can also happen if too many changes occur at once, overwhelming
- // the buffer.
- // People seem to routinely use the basic MS filewatcher and ignore
- // these issues, treating them as acceptably unlikely.
- // Our current implementation here does that too, but we may want
- // to look at eliminating this issue.
- // Unfortunately, it's a limitation of the Windows API, and to
- // my knowledge can't be avoided directly.
- // The solution is to combine the file watcher with a polling
- // mechanism which can (slowly, but reliably) catch any missed events.
- var windowsFileSystemWatcher = new WindowsFileSystemWatcher()
- {
- Path = directoryInfo.FullName,
- IncludeSubdirectories = includeSubdirectories,
- Filter = filter,
- NotifyFilter = NotifyFilters.LastWrite | NotifyFilters.FileName
- };
- windowsFileSystemWatcher.Changed += OnWatchedFileChange;
-
- // Visual Studio is annoying.
- // It doesn't actually trigger a nice Changed event.
- // Instead, it goes through some elaborate procedure.
- // When changing player.cs, it does:
- // CREATE: Code\ua4tt1aw.4ae~
- // CHANGE: Code\ua4tt1aw.4ae~
- // CREATE: Code\Player.cs~RF70560f7.TMP
- // REMOVE: Code\Player.cs~RF70560f7.TMP
- // RENAME: Code\Player.cs -> Code\Player.cs~RF70560f7.TMP
- // RENAME: Code\ua4tt1aw.4ae~ -> Code\Player.cs
- // REMOVE: Code\Player.cs~RF70560f7.TMP - again, somehow?
- //
- // This was fine before, because the watcher implementation was polling.
- // I guess this usually happens fast between polls, so it just looks like a change.
- // Note that that may mean there's a potential bug if polling happens in the middle of this procedure.
- //
- // This fix is a temporary measure.
- // We should probably think more seriously about maybe being able to catch file additions and renames.
- // If we dealt with those extra events smoothly, this would probably just work.
- //
- // Other IDEs may do similar but different things. We want a general purpose solution, not a VS specific one.
- // Perhaps the approach should be to keep track of touched files, then do some diff procedure to work out what's happened to them?
- // This could, perhaps, be integrated into the file watcher robustness polling solution discussed above.
- // The two systems share a need for some type of event debouncing.
- windowsFileSystemWatcher.Renamed += (source, e) =>
- {
- if (e.Name.EndsWith(".cs"))
- OnWatchedFileChange(source, e);
- };
-
- windowsFileSystemWatcher.EnableRaisingEvents = true;
-
- _fileWatchers.Add(windowsFileSystemWatcher);
- break;
-#endif
-
- case FileWatcherImplementation.CustomPolling:
- CustomFileWatcher.InitializeSingularFilewatcher(directoryPath, filter, includeSubdirectories);
- break;
-
- default:
- throw new ArgumentOutOfRangeException();
- }
- }
-
- static FastScriptReloadManager()
- {
- //do not add init code in here as with domain reload turned off it won't be properly set on play-mode enter, use Init method instead
- EditorApplication.update += Instance.Update;
- EditorApplication.playModeStateChanged += Instance.OnEditorApplicationOnplayModeStateChanged;
-
- ///if is enabled, disable auto reload automatically when launching editor. Will be enabled automatically when adding file watcher manually
- if ((bool)FastScriptReloadPreference.WatchOnlySpecified.GetEditorPersistedValueOrDefault() && SessionState.GetBool("NEED_EDITOR_SESSION_INIT", true))
- {
- SessionState.SetBool("NEED_EDITOR_SESSION_INIT", false);
- ClearFileWatchersEntries();
- }
- }
-
- ~FastScriptReloadManager()
- {
- LoggerScoped.LogDebug("Destroying FSR Manager ");
- if (_instance != null)
- {
- if (_lastPlayModeStateChange == PlayModeStateChange.EnteredPlayMode)
- {
- LoggerScoped.LogError("Manager is being destroyed in play session, this indicates some sort of issue where static variables were reset, hot reload will not function properly please reset. " +
- "This is usually caused by Unity triggering that reset for some reason that's outside of asset control - other static variables will also be affected and recovering just hot reload would hide wider issue.");
- }
- ClearFileWatchers();
- }
- }
-
- private const string WatchSpecificFileOrFolderMenuItemName = "Assets/Fast Script Reload/Watch File\\Folder";
- [MenuItem(WatchSpecificFileOrFolderMenuItemName, true, BaseMenuItemPriority_FileWatcher + 1)]
- public static bool ToggleSelectionFileWatchersSetupValidation()
- {
- if (!(bool)FastScriptReloadPreference.WatchOnlySpecified.GetEditorPersistedValueOrDefault())
- {
- return false;
- }
-
- Menu.SetChecked(WatchSpecificFileOrFolderMenuItemName, false);
-
- var isSelectionContaininingFolderOrScript = false;
- for (var i = 0; i < Selection.objects.Length; i++)
- {
- if (Selection.objects[i] is MonoScript selectedMonoScript)
- {
- isSelectionContaininingFolderOrScript = true;
-
- if (IsFileWatcherSetupEntryAlreadyPresent(selectedMonoScript))
- {
- Menu.SetChecked(WatchSpecificFileOrFolderMenuItemName, true);
- break;
- }
- }
- else if (Selection.objects[i] is DefaultAsset selectedAsset)
- {
- isSelectionContaininingFolderOrScript = true;
-
- if (IsFileWatcherSetupEntryAlreadyPresent(selectedAsset))
- {
- Menu.SetChecked(WatchSpecificFileOrFolderMenuItemName, true);
- break;
- }
- }
- }
-
- return isSelectionContaininingFolderOrScript;
- }
-
- /// Used to add/remove scripts/folders to the
- [MenuItem(WatchSpecificFileOrFolderMenuItemName, false, BaseMenuItemPriority_FileWatcher + 1)]
- public static void ToggleSelectionFileWatchersSetup()
- {
- var isFileWatchersChange = false;
- for (var i = 0; i < Selection.objects.Length; i++)
- {
- if (Selection.objects[i] is MonoScript selectedMonoScript)
- {
- if (IsFileWatcherSetupEntryAlreadyPresent(selectedMonoScript, out var foundFileWatcherSetupEntry))
- {
- FastScriptReloadPreference.FileWatcherSetupEntries.RemoveElement(JsonUtility.ToJson(foundFileWatcherSetupEntry));
- }
- else
- {
- FastScriptReloadPreference.FileWatcherSetupEntries.AddElement(JsonUtility.ToJson(foundFileWatcherSetupEntry));
- }
-
- isFileWatchersChange = true;
- }
- else if (Selection.objects[i] is DefaultAsset selectedAsset)
- {
- if (IsFileWatcherSetupEntryAlreadyPresent(selectedAsset, out var foundFileWatcherSetupEntry))
- {
- FastScriptReloadPreference.FileWatcherSetupEntries.RemoveElement(JsonUtility.ToJson(foundFileWatcherSetupEntry));
- }
- else
- {
- FastScriptReloadPreference.FileWatcherSetupEntries.AddElement(JsonUtility.ToJson(foundFileWatcherSetupEntry));
- }
-
- isFileWatchersChange = true;
- }
- }
-
- if (isFileWatchersChange)
- {
- FastScriptReloadPreference.FileWatcherSetupEntriesChanged = true; // Ensures file watcher are updated in play mode
-
- /// When in mode, state is managed automatically (disabled when no file watcher)
- if ((bool)FastScriptReloadPreference.WatchOnlySpecified.GetEditorPersistedValueOrDefault())
- {
- var isAnyFileWatcherSet = FastScriptReloadPreference.FileWatcherSetupEntries.GetElements().Any();
- FastScriptReloadPreference.EnableAutoReloadForChangedFiles.SetEditorPersistedValue(isAnyFileWatcherSet);
- }
- }
- }
-
- [MenuItem("Assets/Fast Script Reload/Clear Watched Files", true, BaseMenuItemPriority_FileWatcher + 2)]
- public static bool ClearFastScriptReloadValidation()
- {
- if (!(bool)FastScriptReloadPreference.WatchOnlySpecified.GetEditorPersistedValueOrDefault())
- {
- return false;
- }
-
- return FastScriptReloadPreference.FileWatcherSetupEntries.GetElements().Any();
- }
- [MenuItem("Assets/Fast Script Reload/Clear Watched Files", false, BaseMenuItemPriority_FileWatcher + 2)]
- public static void ClearFileWatchersEntries()
- {
- foreach (var item in FastScriptReloadPreference.FileWatcherSetupEntries.GetElements())
- {
- FastScriptReloadPreference.FileWatcherSetupEntries.RemoveElement(item);
- }
- Debug.LogWarning("File Watcher Setup has been cleared - make sure to add some.");
-
- FastScriptReloadPreference.EnableAutoReloadForChangedFiles.SetEditorPersistedValue(false);
-
- ClearFileWatchers();
- }
-
-
- [MenuItem("Assets/Fast Script Reload/Add \\ Open User Script Rewrite Override", false, BaseMenuItemPriority_ManualScriptOverride + 1)]
- public static void AddHotReloadManualScriptOverride()
- {
- if (Selection.activeObject is MonoScript script)
- {
- ScriptGenerationOverridesManager.AddScriptOverride(script);
- }
- }
-
- [MenuItem("Assets/Fast Script Reload/Add \\ Open User Script Rewrite Override", true)]
- public static bool AddHotReloadManualScriptOverrideValidateFn()
- {
- return Selection.activeObject is MonoScript;
- }
-
- [MenuItem("Assets/Fast Script Reload/Remove User Script Rewrite Override", false, BaseMenuItemPriority_ManualScriptOverride + 2)]
- public static void RemoveHotReloadManualScriptOverride()
- {
- if (Selection.activeObject is MonoScript script)
- {
- ScriptGenerationOverridesManager.TryRemoveScriptOverride(script);
- }
- }
-
- [MenuItem("Assets/Fast Script Reload/Remove User Script Rewrite Override", true)]
- public static bool RemoveHotReloadManualScriptOverrideValidateFn()
- {
- if (Selection.activeObject is MonoScript script)
- {
- return ScriptGenerationOverridesManager.TryGetScriptOverride(
- new FileInfo(Path.Combine(Path.Combine(Application.dataPath + "//..", AssetDatabase.GetAssetPath(script)))),
- out var _
- );
- }
-
- return false;
- }
-
- [MenuItem("Assets/Fast Script Reload/Show User Script Rewrite Overrides", false, BaseMenuItemPriority_ManualScriptOverride + 3)]
- public static void ShowManualScriptRewriteOverridesInUi()
- {
- var window = FastScriptReloadWelcomeScreen.Init();
- window.OpenUserScriptRewriteOverridesSection();
- }
-
- [MenuItem("Assets/Fast Script Reload/Add Hot-Reload Exclusion", false, BaseMenuItemPriority_Exclusions + 1)]
- public static void AddFileAsExcluded()
- {
- FastScriptReloadPreference.FilesExcludedFromHotReload.AddElement(ResolveRelativeToAssetDirectoryFilePath(Selection.activeObject));
- }
-
- [MenuItem("Assets/Fast Script Reload/Add Hot-Reload Exclusion", true)]
- public static bool AddFileAsExcludedValidateFn()
- {
- return Selection.activeObject is MonoScript
- && !((FastScriptReloadPreference.FilesExcludedFromHotReload.GetEditorPersistedValueOrDefault() as IEnumerable) ?? Array.Empty())
- .Contains(ResolveRelativeToAssetDirectoryFilePath(Selection.activeObject));
- }
-
- [MenuItem("Assets/Fast Script Reload/Remove Hot-Reload Exclusion", false, BaseMenuItemPriority_Exclusions + 2)]
- public static void RemoveFileAsExcluded()
- {
- FastScriptReloadPreference.FilesExcludedFromHotReload.RemoveElement(ResolveRelativeToAssetDirectoryFilePath(Selection.activeObject));
- }
-
- [MenuItem("Assets/Fast Script Reload/Remove Hot-Reload Exclusion", true)]
- public static bool RemoveFileAsExcludedValidateFn()
- {
- return Selection.activeObject is MonoScript
- && ((FastScriptReloadPreference.FilesExcludedFromHotReload.GetEditorPersistedValueOrDefault() as IEnumerable) ?? Array.Empty())
- .Contains(ResolveRelativeToAssetDirectoryFilePath(Selection.activeObject));
- }
-
- [MenuItem("Assets/Fast Script Reload/Show Exclusions", false, BaseMenuItemPriority_Exclusions + 3)]
- public static void ShowExcludedFilesInUi()
- {
- var window = FastScriptReloadWelcomeScreen.Init();
- window.OpenExclusionsSection();
- }
-
- private static string ResolveRelativeToAssetDirectoryFilePath(UnityEngine.Object obj)
- {
- return AssetDatabase.GetAssetPath(obj.GetInstanceID());
- }
-
- public void Update()
- {
- _isEditorModeHotReloadEnabled = (bool)FastScriptReloadPreference.EnableExperimentalEditorHotReloadSupport.GetEditorPersistedValueOrDefault();
- if (_lastPlayModeStateChange == PlayModeStateChange.ExitingPlayMode && Instance._fileWatchers.Any())
- {
- ClearFileWatchers();
- }
-
- if (!_isEditorModeHotReloadEnabled && !EditorApplication.isPlaying)
- {
- return;
- }
-
- if (_isEditorModeHotReloadEnabled)
- {
- EnsureInitialized();
- }
- else if (_lastPlayModeStateChange == PlayModeStateChange.EnteredPlayMode)
- {
-
- EnsureInitialized();
-
- // if (_lastPlayModeStateChange != PlayModeStateChange.ExitingPlayMode && Application.isPlaying && Instance._fileWatchers.Count == 0 && FastScriptReloadPreference.FileWatcherSetupEntries.GetElementsTyped().Count > 0)
- // {
- // LoggerScoped.LogWarning("Reinitializing file-watchers as defined configuration does not match current instance setup. If hot reload still doesn't work you'll need to reset play session.");
- // ClearFileWatchers();
- // EnsureInitialized();
- // }
- }
-
- AssignConfigValuesThatCanNotBeAccessedOutsideOfMainThread();
-
- if (!_assemblyChangesLoaderResolverResolutionAlreadyCalled)
- {
- AssemblyChangesLoaderResolver.Instance.Resolve(); //WARN: need to resolve initially in case monobehaviour singleton is not created
- _assemblyChangesLoaderResolverResolutionAlreadyCalled = true;
- }
-
- if ((bool)FastScriptReloadPreference.EnableAutoReloadForChangedFiles.GetEditorPersistedValueOrDefault() &&
- (DateTime.UtcNow - _lastTimeChangeBatchRun).TotalSeconds > (int)FastScriptReloadPreference.BatchScriptChangesAndReloadEveryNSeconds.GetEditorPersistedValueOrDefault())
- {
- TriggerReloadForChangedFiles();
- }
- }
-
- private static void ClearFileWatchers()
- {
- foreach (var fileWatcher in Instance._fileWatchers)
- {
- fileWatcher.Dispose();
- }
-
- Instance._fileWatchers.Clear();
- }
-
- private void AssignConfigValuesThatCanNotBeAccessedOutsideOfMainThread()
- {
- //TODO: PERF: needed in file watcher but when run on non-main thread causes exception.
- _currentFileExclusions = FastScriptReloadPreference.FilesExcludedFromHotReload.GetElements();
- _triggerDomainReloadIfOverNDynamicallyLoadedAssembles = (int)FastScriptReloadPreference.TriggerDomainReloadIfOverNDynamicallyLoadedAssembles.GetEditorPersistedValueOrDefault();
- _isOnDemandHotReloadEnabled = (bool)FastScriptReloadPreference.EnableOnDemandReload.GetEditorPersistedValueOrDefault();
- EnableExperimentalThisCallLimitationFix = (bool)FastScriptReloadPreference.EnableExperimentalThisCallLimitationFix.GetEditorPersistedValueOrDefault();
- AssemblyChangesLoaderEditorOptionsNeededInBuild.UpdateValues(
- (bool)FastScriptReloadPreference.IsDidFieldsOrPropertyCountChangedCheckDisabled.GetEditorPersistedValueOrDefault(),
- (bool)FastScriptReloadPreference.EnableExperimentalAddedFieldsSupport.GetEditorPersistedValueOrDefault()
- );
- IsPartialClassSupportEnabled = (bool)FastScriptReloadPreference.IsPartialClassSupportEnabled.GetEditorPersistedValueOrDefault();
- }
-
- public void TriggerReloadForChangedFiles()
- {
- if (!Application.isPlaying && _hotReloadPerformedCount > _triggerDomainReloadIfOverNDynamicallyLoadedAssembles)
- {
- _hotReloadPerformedCount = 0;
- LoggerScoped.LogWarning($"Dynamically created assembles reached over: {_triggerDomainReloadIfOverNDynamicallyLoadedAssembles} - triggering full domain reload to clean up. You can adjust that value in settings.");
-#if UNITY_2019_3_OR_NEWER
- CompilationPipeline.RequestScriptCompilation(); //TODO: add some timer to ensure this does not go into some kind of loop
-#elif UNITY_2017_1_OR_NEWER
- var editorAssembly = Assembly.GetAssembly(typeof(Editor));
- var editorCompilationInterfaceType = editorAssembly.GetType("UnityEditor.Scripting.ScriptCompilation.EditorCompilationInterface");
- var dirtyAllScriptsMethod = editorCompilationInterfaceType.GetMethod("DirtyAllScripts", BindingFlags.Static | BindingFlags.Public);
- dirtyAllScriptsMethod.Invoke(editorCompilationInterfaceType, null);
-#endif
- ClearLastProcessedDynamicFileHotReloadStates();
- }
-
- var assemblyChangesLoader = AssemblyChangesLoaderResolver.Instance.Resolve();
- var changesAwaitingHotReload = _dynamicFileHotReloadStateEntries
- .Where(e => e.IsAwaitingCompilation)
- .ToList();
-
- if (changesAwaitingHotReload.Any())
- {
- UpdateLastProcessedDynamicFileHotReloadStates(changesAwaitingHotReload);
- foreach (var c in changesAwaitingHotReload)
- {
- c.IsBeingProcessed = true;
- }
-
- var unityMainThreadDispatcher = UnityMainThreadDispatcher.Instance.EnsureInitialized(); //need to pass that in, resolving on other than main thread will cause exception
- Task.Run(() =>
- {
- List sourceCodeFilesWithUniqueChangesAwaitingHotReload = null;
- try
- {
- sourceCodeFilesWithUniqueChangesAwaitingHotReload = changesAwaitingHotReload
- .GroupBy(e => e.FullFileName)
- .Select(e => e.First().FullFileName).ToList();
-
- var dynamicallyLoadedAssemblyCompilerResult = DynamicAssemblyCompiler.Compile(sourceCodeFilesWithUniqueChangesAwaitingHotReload, unityMainThreadDispatcher);
- if (!dynamicallyLoadedAssemblyCompilerResult.IsError)
- {
- changesAwaitingHotReload.ForEach(c =>
- {
- c.FileCompiledOn = DateTime.UtcNow;
- c.AssemblyNameCompiledIn = dynamicallyLoadedAssemblyCompilerResult.CompiledAssemblyPath;
- });
-
- //TODO: return some proper results to make sure entries are correctly updated
- assemblyChangesLoader.DynamicallyUpdateMethodsForCreatedAssembly(dynamicallyLoadedAssemblyCompilerResult.CompiledAssembly, AssemblyChangesLoaderEditorOptionsNeededInBuild);
- changesAwaitingHotReload.ForEach(c =>
- {
- c.HotSwappedOn = DateTime.UtcNow;
- c.IsBeingProcessed = false;
- }); //TODO: technically not all were hot swapped at same time
-
- _hotReloadPerformedCount++;
-
- SafeInvoke(HotReloadSucceeded, changesAwaitingHotReload);
- }
- else
- {
- if (dynamicallyLoadedAssemblyCompilerResult.MessagesFromCompilerProcess.Count > 0)
- {
- var msg = new StringBuilder();
- foreach (string message in dynamicallyLoadedAssemblyCompilerResult.MessagesFromCompilerProcess)
- {
- msg.AppendLine($"Error when compiling, it's best to check code and make sure it's compilable \r\n {message}\n");
- }
-
- var errorMessage = msg.ToString();
-
- changesAwaitingHotReload.ForEach(c =>
- {
- c.ErrorOn = DateTime.UtcNow;
- c.ErrorText = errorMessage;
- });
-
- throw new Exception(errorMessage);
- }
- }
- }
- catch (Exception ex)
- {
- if (ex is SourceCodeHasErrorsException e)
- LoggerScoped.LogError(e.Message + Environment.NewLine);
- else
- LoggerScoped.LogError($"Error when updating files: '{(sourceCodeFilesWithUniqueChangesAwaitingHotReload != null ? string.Join(",", sourceCodeFilesWithUniqueChangesAwaitingHotReload.Select(fn => new FileInfo(fn).Name)) : "unknown")}', {ex}");
-
- changesAwaitingHotReload.ForEach(c =>
- {
- c.ErrorOn = DateTime.UtcNow;
- c.ErrorText = ex.Message;
- c.SourceCodeCombinedFilePath = (ex as HotReloadCompilationException)?.SourceCodeCombinedFileCreated;
- });
-
- SafeInvoke(HotReloadFailed, changesAwaitingHotReload);
- }
- });
- }
-
- _lastTimeChangeBatchRun = DateTime.UtcNow;
- }
-
- private void SafeInvoke(Action> ev, List changesAwaitingHotReload)
- {
- try
- {
- ev?.Invoke(changesAwaitingHotReload);
- }
- catch (Exception e)
- {
- Debug.LogError($"Error when executing event, {e}");
- }
- }
-
- private void AddToLastProcessedDynamicFileHotReloadStates(DynamicFileHotReloadState c)
- {
- var assetGuid = AssetDatabaseHelper.AbsolutePathToGUID(c.FullFileName);
- if (!string.IsNullOrEmpty(assetGuid))
- {
- _lastProcessedDynamicFileHotReloadStatesInSession[assetGuid] = c;
- }
- }
-
- private void ClearLastProcessedDynamicFileHotReloadStates()
- {
- _lastProcessedDynamicFileHotReloadStatesInSession.Clear();
- }
-
- //Success entries will always be cleared - errors will remain till another change fixes them
- private void UpdateLastProcessedDynamicFileHotReloadStates(List changesToHotReload)
- {
- var succeededReloads = _lastProcessedDynamicFileHotReloadStatesInSession
- .Where(s => s.Value.IsChangeHotSwapped).ToList();
- foreach (var kv in succeededReloads)
- {
- _lastProcessedDynamicFileHotReloadStatesInSession.Remove(kv.Key);
- }
-
- foreach (var changeToHotReload in changesToHotReload)
- {
- AddToLastProcessedDynamicFileHotReloadStates(changeToHotReload);
- }
- }
-
- private void OnEditorApplicationOnplayModeStateChanged(PlayModeStateChange obj)
- {
- Instance._lastPlayModeStateChange = obj;
-
- if ((bool)FastScriptReloadPreference.IsForceLockAssembliesViaCode.GetEditorPersistedValueOrDefault())
- {
- if (obj == PlayModeStateChange.EnteredPlayMode)
- {
- EditorApplication.LockReloadAssemblies();
- _wasLockReloadAssembliesCalled = true;
- }
- }
-
- if(obj == PlayModeStateChange.EnteredEditMode && _wasLockReloadAssembliesCalled)
- {
- EditorApplication.UnlockReloadAssemblies();
- _wasLockReloadAssembliesCalled = false;
- }
- }
-
- private static bool TryWorkaroundForUnityFileWatcherBug(FileSystemEventArgs e, ref string filePathToUse)
- {
- LoggerScoped.LogWarning(@"Fast Script Reload - Unity File Path Bug - Warning!
-Path for changed file passed by Unity does not exist. This is a known editor bug, more info: https://issuetracker.unity3d.com/issues/filesystemwatcher-returns-bad-file-path
-
-Best course of action is to update editor as issue is already fixed in newer (minor and major) versions.
-
-As a workaround asset will try to resolve paths via directory search.
-
-Workaround will search in all folders (under project root) and will use first found file. This means it's possible it'll pick up wrong file as there's no directory information available.");
-
- var changedFileName = new FileInfo(filePathToUse).Name;
- //TODO: try to look in all file watcher configured paths, some users might have code outside of assets, eg packages
- // var fileFoundInAssets = FastScriptReloadPreference.FileWatcherSetupEntries.GetElementsTyped().SelectMany(setupEntries => Directory.GetFiles(DataPath, setupEntries.path, SearchOption.AllDirectories)).ToList();
-
- var fileFoundInAssets = Directory.GetFiles(DataPath, changedFileName, SearchOption.AllDirectories);
- if (fileFoundInAssets.Length == 0)
- {
- LoggerScoped.LogError($"FileWatcherBugWorkaround: Unable to find file '{changedFileName}', changes will not be reloaded. Please update unity editor.");
- return false;
- }
- else if (fileFoundInAssets.Length == 1)
- {
- LoggerScoped.Log($"FileWatcherBugWorkaround: Original Unity passed file path: '{e.FullPath}' adjusted to found: '{fileFoundInAssets[0]}'");
- filePathToUse = fileFoundInAssets[0];
- return true;
- }
- else
- {
- LoggerScoped.LogWarning($"FileWatcherBugWorkaround: Multiple files found. Original Unity passed file path: '{e.FullPath}' adjusted to found: '{fileFoundInAssets[0]}'");
- filePathToUse = fileFoundInAssets[0];
- return true;
- }
- }
-
- private static bool HotReloadDisabled_WarningMessageShownAlready;
- private static void EnsureInitialized()
- {
- if (!(bool)FastScriptReloadPreference.EnableAutoReloadForChangedFiles.GetEditorPersistedValueOrDefault()
- && !(bool)FastScriptReloadPreference.EnableOnDemandReload.GetEditorPersistedValueOrDefault()
- && !(bool)FastScriptReloadPreference.WatchOnlySpecified.GetEditorPersistedValueOrDefault())
- {
- if (!HotReloadDisabled_WarningMessageShownAlready)
- {
- LoggerScoped.LogWarning($"Neither auto hot reload / on-demand reload / or watch specific is specified, file watchers will not be initialized. Please adjust settings and restart if you want hot reload to work.");
- HotReloadDisabled_WarningMessageShownAlready = true;
- }
- return;
- }
-
- var isUsingCustomFileWatchers = (FileWatcherImplementation)FastScriptReloadPreference.FileWatcherImplementationInUse.GetEditorPersistedValueOrDefault()
- == FileWatcherImplementation.CustomPolling;
- if (!isUsingCustomFileWatchers)
- {
- if (Instance._fileWatchers.Count == 0 || FastScriptReloadPreference.FileWatcherSetupEntriesChanged)
- {
- FastScriptReloadPreference.FileWatcherSetupEntriesChanged = false;
-
- InitializeFromFileWatcherSetupEntries();
- }
- }
- else if(!CustomFileWatcher.InitSignaled)
- {
- CustomFileWatcher.TryEnableLivewatching();
- InitializeFromFileWatcherSetupEntries();
- CustomFileWatcher.InitSignaled = true;
- }
- }
-
- private static void InitializeFromFileWatcherSetupEntries()
- {
- var fileWatcherSetupEntries = FastScriptReloadPreference.FileWatcherSetupEntries.GetElementsTyped();
- if (fileWatcherSetupEntries.Count == 0)
- {
- LoggerScoped.LogWarning($"There are no file watcher setup entries. Tool will not be able to pick changes automatically");
- }
-
- foreach (var fileWatcherSetupEntry in fileWatcherSetupEntries)
- {
- Instance.StartWatchingDirectoryAndSubdirectories(
- fileWatcherSetupEntry.path,
- fileWatcherSetupEntry.filter,
- fileWatcherSetupEntry.includeSubdirectories
- );
- }
- }
-
- private static bool IsFileWatcherSetupEntryAlreadyPresent(FileWatcherSetupEntry fileWatcherSetupEntry)
- {
- //TODO: could be a bit of a per hit, GetElementsTypes will parse json every time
- return FastScriptReloadPreference.FileWatcherSetupEntries.GetElementsTyped()
- .Any(e => e.path == fileWatcherSetupEntry.path
- && e.filter == fileWatcherSetupEntry.filter
- && e.includeSubdirectories == fileWatcherSetupEntry.includeSubdirectories);
- }
-
- private static bool IsFileWatcherSetupEntryAlreadyPresent(DefaultAsset selectedAsset)
- {
- FileWatcherSetupEntry fileWatcherSetupEntry;
- return IsFileWatcherSetupEntryAlreadyPresent(selectedAsset, out fileWatcherSetupEntry);
- }
-
- private static bool IsFileWatcherSetupEntryAlreadyPresent(DefaultAsset selectedAsset, out FileWatcherSetupEntry fileWatcherSetupEntry)
- {
- var path = FileWatcherReplacementTokenForApplicationDataPath + AssetDatabase.GetAssetPath(selectedAsset).Remove(0, "Assets".Length);
- fileWatcherSetupEntry = new FileWatcherSetupEntry(path, "*.cs", true);
-
- var isFileWatcherSetupEntryAlreadyPresent = IsFileWatcherSetupEntryAlreadyPresent(fileWatcherSetupEntry);
- return isFileWatcherSetupEntryAlreadyPresent;
- }
-
- private static bool IsFileWatcherSetupEntryAlreadyPresent(MonoScript selectedMonoScript)
- {
- FileWatcherSetupEntry fileWatcherSetupEntry;
- return IsFileWatcherSetupEntryAlreadyPresent(selectedMonoScript, out fileWatcherSetupEntry);
- }
-
- private static bool IsFileWatcherSetupEntryAlreadyPresent(MonoScript selectedMonoScript, out FileWatcherSetupEntry fileWatcherSetupEntry)
- {
- var path = FileWatcherReplacementTokenForApplicationDataPath + AssetDatabase.GetAssetPath(selectedMonoScript).Remove(0, "Assets".Length);
- var fileSeperatorIndex = path.LastIndexOf('/');
- var fileName = path.Substring(fileSeperatorIndex + 1);
- path = path.Substring(0, fileSeperatorIndex);
-
- fileWatcherSetupEntry = new FileWatcherSetupEntry(path, fileName, false);
- var isFileWatcherSetupEntryAlreadyPresent = IsFileWatcherSetupEntryAlreadyPresent(fileWatcherSetupEntry);
- return isFileWatcherSetupEntryAlreadyPresent;
- }
- }
-
- public class DynamicFileHotReloadState
- {
- public string FullFileName { get; set; }
- public DateTime FileChangedOn { get; set; }
- public bool IsAwaitingCompilation => !IsFileCompiled && !ErrorOn.HasValue && !IsBeingProcessed;
- public bool IsFileCompiled => FileCompiledOn.HasValue;
- public DateTime? FileCompiledOn { get; set; }
-
- public string AssemblyNameCompiledIn { get; set; }
-
- public bool IsAwaitingHotSwap => IsFileCompiled && !HotSwappedOn.HasValue;
- public DateTime? HotSwappedOn { get; set; }
- public bool IsChangeHotSwapped => HotSwappedOn.HasValue;
-
- public string ErrorText { get; set; }
- public DateTime? ErrorOn { get; set; }
- public bool IsFailed => ErrorOn.HasValue;
- public bool IsBeingProcessed { get; set; }
- public string SourceCodeCombinedFilePath { get; set; }
-
- public DynamicFileHotReloadState(string fullFileName, DateTime fileChangedOn)
- {
- FullFileName = fullFileName;
- FileChangedOn = fileChangedOn;
- }
- }
-
- public enum FileWatcherImplementation
- {
- UnityDefault = 0,
-#if UNITY_EDITOR_WIN && UNITY_2021_1_OR_NEWER
- DirectWindowsApi = 1,
-#endif
- CustomPolling = 2
- }
-}
\ No newline at end of file
diff --git a/Assets/FastScriptReload/Scripts/Editor/FastScriptReloadManager.cs.meta b/Assets/FastScriptReload/Scripts/Editor/FastScriptReloadManager.cs.meta
deleted file mode 100644
index 3072b20..0000000
--- a/Assets/FastScriptReload/Scripts/Editor/FastScriptReloadManager.cs.meta
+++ /dev/null
@@ -1,18 +0,0 @@
-fileFormatVersion: 2
-guid: 6bcc689ed0625e04d8117933c1ccadd8
-MonoImporter:
- externalObjects: {}
- serializedVersion: 2
- defaultReferences: []
- executionOrder: 0
- icon: {instanceID: 0}
- userData:
- assetBundleName:
- assetBundleVariant:
-AssetOrigin:
- serializedVersion: 1
- productId: 239351
- packageName: Fast Script Reload
- packageVersion: 1.6.1
- assetPath: Assets/FastScriptReload/Scripts/Editor/FastScriptReloadManager.cs
- uploadId: 710802
diff --git a/Assets/FastScriptReload/Scripts/Editor/FastScriptReloadWelcomeScreen.cs b/Assets/FastScriptReload/Scripts/Editor/FastScriptReloadWelcomeScreen.cs
deleted file mode 100644
index f57f29d..0000000
--- a/Assets/FastScriptReload/Scripts/Editor/FastScriptReloadWelcomeScreen.cs
+++ /dev/null
@@ -1,1092 +0,0 @@
-using System;
-using System.Collections.Generic;
-using System.IO;
-using System.Linq;
-using FastScriptReload.Editor.Compilation;
-using FastScriptReload.Editor.Compilation.ScriptGenerationOverrides;
-using FastScriptReload.Runtime;
-using ImmersiveVRTools.Editor.Common.Utilities;
-using ImmersiveVRTools.Editor.Common.WelcomeScreen;
-using ImmersiveVRTools.Editor.Common.WelcomeScreen.GuiElements;
-using ImmersiveVRTools.Editor.Common.WelcomeScreen.PreferenceDefinition;
-using ImmersiveVRTools.Editor.Common.WelcomeScreen.Utilities;
-using ImmersiveVrToolsCommon.Runtime.Logging;
-using UnityEditor;
-using UnityEditor.Compilation;
-using UnityEditorInternal;
-using UnityEngine;
-using UnityEngine.Rendering;
-
-namespace FastScriptReload.Editor
-{
- public class FastScriptReloadWelcomeScreen : ProductWelcomeScreenBase
- {
- public static string BaseUrl = "https://immersivevrtools.com";
- public static string GenerateGetUpdatesUrl(string userId, string versionId)
- {
- //WARN: the URL can sometimes be adjusted, make sure updated correctly
- return $"{BaseUrl}/updates/fast-script-reload/{userId}?CurrentVersion={versionId}";
- }
- public static string VersionId = "1.8";
- private static readonly string ProjectIconName = "ProductIcon64";
- public static readonly string ProjectName = "fast-script-reload";
-
- private static Vector2 _WindowSizePx = new Vector2(650, 500);
- private static string _WindowTitle = "Fast Script Reload";
-
- public static ChangeMainViewButton ExclusionsSection { get; private set; }
- public static ChangeMainViewButton EditorHotReloadSection { get; private set; }
- public static ChangeMainViewButton NewFieldsSection { get; private set; }
- public static ChangeMainViewButton UserScriptRewriteOverrides { get; private set; }
- public static ChangeMainViewButton InspectError { get; private set; }
-
- public static DynamicFileHotReloadState LastInspectFileHotReloadStateError;
-
- public void OpenInspectError(DynamicFileHotReloadState fileHotReloadState)
- {
- LastInspectFileHotReloadStateError = fileHotReloadState;
- InspectError.OnClick(this);
- }
-
- public void OpenExclusionsSection()
- {
- ExclusionsSection.OnClick(this);
- }
-
- public void OpenUserScriptRewriteOverridesSection()
- {
- UserScriptRewriteOverrides.OnClick(this);
- }
-
- public void OpenEditorHotReloadSection()
- {
- EditorHotReloadSection.OnClick(this);
- }
-
- public void OpenNewFieldsSection()
- {
- NewFieldsSection.OnClick(this);
- }
-
- private static readonly ScrollViewGuiSection MainScrollViewSection = new ScrollViewGuiSection(
- "", (screen) =>
- {
- GUILayout.Label(
-@"Thanks for using the asset! If at any stage you got some questions or need help please let me know.
-
-Asset is released as open source and I'd like to dedicate as much time to it as possible.
-For that to happen though it needs a community around it. It's HUGE help if you can:
-
-1) Spread the word, let other devs know how you're using it
-2) Star Github Repo - it helps build visibility
-3) Donate - this allows me to spend more time on the project instead of paid client's work
-
-There are some options that you can customise, those are visible in sections on the left.
-
-You can always get back to this screen via:
-1) Window -> Fast Script Reload -> Start Screen
-2) Edit -> Preferences... -> Fast Script Reload", screen.TextStyle, GUILayout.ExpandHeight(true));
-
- GUILayout.Label("Enabled Features:", screen.LabelStyle);
- using (LayoutHelper.LabelWidth(350))
- {
- /// When is enabled, state is handled automatically (disabled when empty file watcher)
- using (new EditorGUI.DisabledGroupScope((bool)FastScriptReloadPreference.WatchOnlySpecified.GetEditorPersistedValueOrDefault()))
- {
- ProductPreferenceBase.RenderGuiAndPersistInput(FastScriptReloadPreference.EnableAutoReloadForChangedFiles);
- }
-
- RenderSettingsWithCheckLimitationsButton(FastScriptReloadPreference.EnableExperimentalAddedFieldsSupport, true, () => ((FastScriptReloadWelcomeScreen)screen).OpenNewFieldsSection());
- RenderSettingsWithCheckLimitationsButton(FastScriptReloadPreference.EnableExperimentalEditorHotReloadSupport, false, () => ((FastScriptReloadWelcomeScreen)screen).OpenEditorHotReloadSection());
- }
- }
- );
-
- private static void RenderSettingsWithCheckLimitationsButton(ToggleProjectEditorPreferenceDefinition preferenceDefinition, bool allowChange, Action onCheckLimitationsClick)
- {
- EditorGUILayout.BeginHorizontal();
- if (!allowChange)
- {
- using (LayoutHelper.LabelWidth(313))
- {
- EditorGUILayout.LabelField(preferenceDefinition.Label);
- }
- }
- else
- {
- ProductPreferenceBase.RenderGuiAndPersistInput(preferenceDefinition);
- }
-
- if (GUILayout.Button("Check limitations"))
- {
- onCheckLimitationsClick();
- }
-
- EditorGUILayout.EndHorizontal();
- }
-
- private static readonly List LeftSections = CreateLeftSections(new List
- {
- new ChangeMainViewButton("On-Device\r\nHot-Reload",
- (screen) =>
- {
- EditorGUILayout.LabelField("Live Script Reload", screen.BoldTextStyle);
-
- GUILayout.Space(10);
- EditorGUILayout.LabelField(@"There's an extension to this asset that'll allow you to include Hot-Reload capability in builds (standalone / Android), please click the button below to learn more.", screen.TextStyle);
-
- GUILayout.Space(20);
- if (GUILayout.Button("View Live Script Reload on Asset Store"))
- {
- Application.OpenURL($"{RedirectBaseUrl}/live-script-reload-extension");
- }
- }
- )
- },
- new LaunchSceneButton("Basic Example", (s) =>
- {
- var path = GetScenePath("ExampleScene");
- if (path == null)
- {
- var userChoice = EditorUtility.DisplayDialogComplex("Example not found",
- "Example scene was not found. If you got FSR via package manager, please make sure to import samples.",
- "Ok", "Close", "Open Package Manager");
- if (userChoice == 2)
- {
- UnityEditor.PackageManager.UI.Window.Open("com.fastscriptreload");
- }
- }
-
- return path;
- }, (screen) =>
- {
- GUILayout.Label(
- $@"Asset is very simple to use:
-
-1) Hit play to start.
-2) Go to 'FunctionLibrary.cs' ({@"Assets/FastScriptReload/Examples/Scripts/"})", screen.TextStyle);
-
- CreateOpenFunctionLibraryOnRippleMethodButton();
-
-
- GUILayout.Label(
- $@"3) Change 'Ripple' method (eg change line before return statement to 'p.z = v * 10'
-4) Save file
-5) See change immediately",
- screen.TextStyle
- );
-
- GUILayout.Space(10);
- EditorGUILayout.HelpBox("There are some limitations to what can be Hot-Reloaded, documentation lists them under 'limitations' section.", MessageType.Warning);
- }), MainScrollViewSection);
-
- static void OnScriptHotReloadNoInstance()
- {
- Debug.Log("Reloaded - start");
- LastInspectFileHotReloadStateError = (DynamicFileHotReloadState) HarmonyLib.AccessTools
- .Field("FastScriptReload.Editor.FastScriptReloadWelcomeScreen:LastInspectFileHotReloadStateError")
- .GetValue(null);
- Debug.Log("Reloaded - end");
- }
-
- protected static List CreateLeftSections(List additionalSections, LaunchSceneButton launchSceneButton, ScrollViewGuiSection mainScrollViewSection)
- {
- return new List() {
- new GuiSection("", new List
- {
- (InspectError = new ChangeMainViewButton("Error - Inspect", (screen) =>
- {
- if (FastScriptReloadWelcomeScreen.LastInspectFileHotReloadStateError == null)
- {
- GUILayout.Label(
- @"No error selected. Possibly it's been cleared by domain reload.
-
-Choose other tab on the left.", screen.TextStyle);
- return;
- }
-
-
- EditorGUILayout.HelpBox(
- @"Errors are usually down to compilation / rewrite issue. There are ways you can mitigate those.",
- MessageType.Warning);
- GUILayout.Space(10);
-
- GUILayout.Label("1) Review compilation error, especially looking for specific lines that caused error:");
- EditorGUILayout.HelpBox(
- @"For example following error below shows line 940 as causing compilation issue due to missing #endif directive.
-
-System.Exception: Compiler failed to produce the assembly.
-Output: '.SourceCodeCombined.cs(940,1): error CS1027: #endif directive expected'",
- MessageType.Info);
-
- GUILayout.Space(10);
- GUILayout.Label("Error:");
- GUILayout.TextArea(LastInspectFileHotReloadStateError.ErrorText);
-
- GUILayout.Space(10);
- if (GUILayout.Button("2) Click here to open generated file that failed to compile"))
- {
- InternalEditorUtility.OpenFileAtLineExternal(LastInspectFileHotReloadStateError.SourceCodeCombinedFilePath, 1);
- }
-
- GUILayout.Label(
- @"Error could be caused by a normal compilation issue that you created in source file
-(eg typo), in that case please fix and it'll recompile.
-
-It's possible compilation fails due to existing limitation, while I work continuously
-on mitigating limitations it's best that you're aware where they are.
-
-Please see documentation (link above) to understand them better
-They also contain workarounds if needed.");
-
- GUILayout.Space(10);
- GUILayout.Label(
- @"You can also create one-off override file that'll allow to specify
-custom rewrites for methods.", screen.BoldTextStyle);
- if (GUILayout.Button("3) Create User Defined Script Override"))
- {
- ScriptGenerationOverridesManager.AddScriptOverride(new FileInfo(FastScriptReloadWelcomeScreen.LastInspectFileHotReloadStateError.FullFileName));
- }
-
- GUILayout.Space(10);
- GUILayout.Label(@"You can help make FSR better!", screen.BoldTextStyle);
- EditorGUILayout.HelpBox(@"Could you please assist in improving the tool by providing me with the details of the error?
-I can use those to recreate the issue and fix the limitation.
-
-Simply click the button below - it'll create a support pack automatically.
-
-Support pack contains:
-1) Original script file that caused error
-2) Patched script file that was generated
-3) Error message", MessageType.Warning);
-
- if (GUILayout.Button("4) Click here to create support-pack"))
- {
- try
- {
- var folder = EditorUtility.OpenFolderPanel("Select Folder", "", "");
- var sourceCodeCombinedFile = new FileInfo(LastInspectFileHotReloadStateError.SourceCodeCombinedFilePath);
- var originalFile = new FileInfo(LastInspectFileHotReloadStateError.FullFileName);
- File.Copy(LastInspectFileHotReloadStateError.SourceCodeCombinedFilePath, Path.Combine(folder, sourceCodeCombinedFile.Name));
- File.Copy(LastInspectFileHotReloadStateError.FullFileName, Path.Combine(folder, originalFile.Name));
- File.WriteAllText(Path.Combine(folder, "error-message.txt"), LastInspectFileHotReloadStateError.ErrorText);
-
- EditorUtility.DisplayDialog("Support Pack Created", $"Thanks!\r\n\r\nPlease send files from folder:\r\n'{folder}'\r\n\r\nto:\r\n\r\nsupport@immersivevrtools.com", "Ok, copy email to clipboard");
- EditorGUIUtility.systemCopyBuffer = "support@immersivevrtools.com";
- }
- catch (Exception e)
- {
- Debug.LogError($"Unable to create support pack., {e}");
- }
- }
- })).WithShouldRender(() => LastInspectFileHotReloadStateError != null),
- new LastUpdateButton("New Update!", (screen) => LastUpdateUpdateScrollViewSection.RenderMainScrollViewSection(screen)),
- new ChangeMainViewButton("Welcome", (screen) => mainScrollViewSection.RenderMainScrollViewSection(screen)),
- }),
- new GuiSection("Options", new List
- {
- new ChangeMainViewButton("Reload", (screen) =>
- {
- const int sectionBreakHeight = 15;
- GUILayout.Label(
- @"Asset watches all script files and automatically hot-reloads on change, you can disable that behaviour and reload on demand.",
- screen.TextStyle
- );
-
- using (new EditorGUI.DisabledGroupScope((bool)FastScriptReloadPreference.WatchOnlySpecified.GetEditorPersistedValueOrDefault()))
- using (LayoutHelper.LabelWidth(320))
- {
- ProductPreferenceBase.RenderGuiAndPersistInput(FastScriptReloadPreference.EnableAutoReloadForChangedFiles);
- }
- GUILayout.Space(sectionBreakHeight);
-
- using (LayoutHelper.LabelWidth(320))
- {
- ProductPreferenceBase.RenderGuiAndPersistInput(FastScriptReloadPreference.WatchOnlySpecified);
- }
-
- if ((bool)FastScriptReloadPreference.WatchOnlySpecified.GetEditorPersistedValueOrDefault())
- {
- EditorGUILayout.HelpBox(@"With manual watching you need to right click on file/folder in project window and select 'Watch File'", MessageType.Info);
- }
- GUILayout.Space(sectionBreakHeight);
-
- EditorGUILayout.HelpBox("On demand reload :\r\n(only works if you opted in below, this is to avoid unnecessary file watching)\r\nvia Window -> Fast Script Reload -> Force Reload, \r\nor by calling 'FastScriptIterationManager.Instance.TriggerReloadForChangedFiles()'", MessageType.Warning);
-
- using (LayoutHelper.LabelWidth(320))
- {
- ProductPreferenceBase.RenderGuiAndPersistInput(FastScriptReloadPreference.EnableOnDemandReload);
- }
-
- GUILayout.Space(sectionBreakHeight);
-
- GUILayout.Label(
- @"For performance reasons script changes are batched are reloaded every N seconds",
- screen.TextStyle
- );
-
- using (LayoutHelper.LabelWidth(300))
- {
- ProductPreferenceBase.RenderGuiAndPersistInput(FastScriptReloadPreference.BatchScriptChangesAndReloadEveryNSeconds);
- }
-
- GUILayout.Space(sectionBreakHeight);
-
- using (LayoutHelper.LabelWidth(350))
- {
- ProductPreferenceBase.RenderGuiAndPersistInput(FastScriptReloadPreference.EnableExperimentalThisCallLimitationFix);
- }
- EditorGUILayout.HelpBox("Method calls utilizing 'this' will trigger compiler exception, if enabled tool will rewrite the calls to have proper type after adjustments." +
- "\r\n\r\nIn case you're seeing compile errors relating to 'this' keyword please let me know via support page. Also turning this setting off will prevent rewrite.", MessageType.Info);
-
- GUILayout.Space(sectionBreakHeight);
-
- using (LayoutHelper.LabelWidth(350))
- {
- ProductPreferenceBase.RenderGuiAndPersistInput(FastScriptReloadPreference.IsForceLockAssembliesViaCode);
- }
- EditorGUILayout.HelpBox(
-@"Sometimes Unity continues to reload assemblies on change in playmode even when Auto-Refresh is turned off.
-
-Use this setting to force lock assemblies via code."
-, MessageType.Info);
- GUILayout.Space(sectionBreakHeight);
-
- using (LayoutHelper.LabelWidth(350))
- {
- ProductPreferenceBase.RenderGuiAndPersistInput(FastScriptReloadPreference.IsDidFieldsOrPropertyCountChangedCheckDisabled);
- }
- EditorGUILayout.HelpBox("By default if you add / remove fields, tool will not redirect method calls for recompiled class." +
- "\r\nYou can also enable added-fields support (experimental)." +
- "\r\n\r\nSome assets however will use IL weaving to adjust your classes (eg Mirror) as a post compile step. In that case it's quite likely hot-reload will still work. " +
- "\r\n\r\nTick this box for tool to try and reload changes when that happens."
-
- , MessageType.Info);
- GUILayout.Space(sectionBreakHeight);
-
- using (LayoutHelper.LabelWidth(430))
- {
- ProductPreferenceBase.RenderGuiAndPersistInput(FastScriptReloadPreference.IsVisualHotReloadIndicationShownInProjectWindow);
- }
-
- GUILayout.Space(sectionBreakHeight);
- }),
- (UserScriptRewriteOverrides = new ChangeMainViewButton("User Script\r\nRewrite Overrides", (screen) =>
- {
- EditorGUILayout.HelpBox(
- $@"For tool to work it'll need to slightly adjust your code to make it compilable. Sometimes due to existing limitations this can fail and you'll see an error.
-
-You can specify custom script rewrite overrides, those are specified for specific parts of code that fail, eg method.
-
-It will help overcome limitations in the short run while I work on implementing proper solution."
- , MessageType.Info);
-
- EditorGUILayout.HelpBox(
- $@"To add:
-1) right-click in project panel on the file that causes the issue.
-2) select Fast Script Reload -> Add / Open User Script Rewrite Override
-
-It'll open override file with template already in. You can read top comments that describe how to use it."
- , MessageType.Warning);
-
- EditorGUILayout.LabelField("Existing User Defined Script Overrides:", screen.BoldTextStyle);
- Action executeAfterIteration = null;
- foreach (var scriptOverride in ScriptGenerationOverridesManager.UserDefinedScriptOverrides)
- {
- EditorGUILayout.BeginHorizontal();
-
- EditorGUILayout.LabelField(scriptOverride.File.Name);
- if (GUILayout.Button("Open"))
- {
- InternalEditorUtility.OpenFileAtLineExternal(scriptOverride.File.FullName, 0);
- }
-
- if (GUILayout.Button("Delete"))
- {
- executeAfterIteration = () =>
- {
- if (EditorUtility.DisplayDialog("Are you sure", "This will permanently remove override file.", "Delete", "Keep File"))
- {
- ScriptGenerationOverridesManager.TryRemoveScriptOverride(scriptOverride);
- }
- };
- }
-
- EditorGUILayout.EndHorizontal();
- }
- executeAfterIteration?.Invoke();
- })),
- (ExclusionsSection = new ChangeMainViewButton("Exclusions", (screen) =>
- {
- EditorGUILayout.HelpBox("Those are easiest to manage from Project window by right clicking on script file and selecting: " +
- "\r\nFast Script Reload -> Add Hot-Reload Exclusion " +
- "\r\nFast Script Reload -> Remove Hot-Reload Exclusion", MessageType.Info);
- GUILayout.Space(10);
-
- ProductPreferenceBase.RenderGuiAndPersistInput(FastScriptReloadPreference.FilesExcludedFromHotReload);
- })),
- new ChangeMainViewButton("Debugging", (screen) =>
- {
- EditorGUILayout.HelpBox(
- @"To debug you'll need to set breakpoints in dynamically-compiled file.
-
-BREAKPOINTS IN ORIGINAL FILE WON'T BE HIT!", MessageType.Error);
-
- EditorGUILayout.HelpBox(
-@"You can do that via:
- - clicking link in console-window after change, eg
- 'FSR: Files: FunctionLibrary.cs changed (click here to debug [in bottom details pane]) (...)'
- (it needs to be clicked in bottom details pane, double click will simply take you to log location)", MessageType.Warning);
- GUILayout.Space(10);
-
- EditorGUILayout.HelpBox(@"Tool can also auto-open generated file on every change, to do so select below option", MessageType.Info);
- using (LayoutHelper.LabelWidth(350))
- {
- ProductPreferenceBase.RenderGuiAndPersistInput(FastScriptReloadPreference.IsAutoOpenGeneratedSourceFileOnChangeEnabled);
- if ((bool)FastScriptReloadPreference.IsAutoOpenGeneratedSourceFileOnChangeEnabled.GetEditorPersistedValueOrDefault())
- {
- EditorGUILayout.HelpBox(@"Do not edit debug file created. It'll be removed.", MessageType.Error);
- }
- }
-
- GUILayout.Space(20);
- using (LayoutHelper.LabelWidth(350))
- {
- EditorGUILayout.LabelField("Logging", screen.BoldTextStyle);
- GUILayout.Space(5);
- ProductPreferenceBase.RenderGuiAndPersistInput(FastScriptReloadPreference.EnableDetailedDebugLogging);
- ProductPreferenceBase.RenderGuiAndPersistInput(FastScriptReloadPreference.LogHowToFixMessageOnCompilationError);
- ProductPreferenceBase.RenderGuiAndPersistInput(FastScriptReloadPreference.StopShowingAutoReloadEnabledDialogBox);
- ProductPreferenceBase.RenderGuiAndPersistInput(FastScriptReloadPreference.DebugWriteRewriteReasonAsComment);
- }
- })
- }.Concat(additionalSections).ToList()),
- new GuiSection("Experimental", new List
- {
- (NewFieldsSection = new ChangeMainViewButton("New Fields", (screen) =>
- {
-#if LiveScriptReload_Enabled
- EditorGUILayout.HelpBox(
- @"On Device Reload (in running build) - Not Supported
-If you enable - new fields WILL show in editor and work as expected but link with the device will be broken and changes won't be visible there!", MessageType.Error);
- GUILayout.Space(10);
-#endif
-
- EditorGUILayout.HelpBox(
- @"Adding new fields is still in experimental mode, it will have issues.
-
-When you encounter them please get in touch (via any support links above) and I'll be sure to sort them out. Thanks!", MessageType.Error);
- GUILayout.Space(10);
-
- EditorGUILayout.HelpBox(
- @"Adding new fields will affect performance, behind the scenes your code is rewritten to access field via static dictionary.
-
-Once you exit playmode and do a full recompile they'll turn to standard fields as you'd expect.
-
-New fields will also show in editor - you can tweak them as normal variables.", MessageType.Warning);
- GUILayout.Space(10);
-
- EditorGUILayout.HelpBox(
- @"LIMITATIONS: (full list and more info in docs)
-- outside classes can not call new fields added at runtime
-- new fields will only show in editor if they were already used at least once", MessageType.Info);
- GUILayout.Space(10);
-
- using (LayoutHelper.LabelWidth(300))
- {
- ProductPreferenceBase.RenderGuiAndPersistInput(FastScriptReloadPreference.EnableExperimentalAddedFieldsSupport);
- }
- GUILayout.Space(10);
-
- if (Application.isPlaying)
- {
- EditorGUILayout.HelpBox(@"You're in playmode, for option to start working you need to restart playmode.", MessageType.Warning);
- }
-
- GUILayout.Space(10);
- })),
- (EditorHotReloadSection = new ChangeMainViewButton("Editor Hot-Reload", (screen) =>
- {
- EditorGUILayout.HelpBox(@"Currently asset hot-reloads only in play-mode, you can enable experimental editor mode support here.
-
-Please make sure to read limitation section as not all changes can be performed", MessageType.Warning);
-
- EditorGUILayout.HelpBox(@"As an experimental feature it may be unstable and is not as reliable as play-mode workflow.
-
-In some cases it can lock/crash editor.", MessageType.Error);
- GUILayout.Space(10);
-
- using (LayoutHelper.LabelWidth(320))
- {
- var valueBefore = (bool)FastScriptReloadPreference.EnableExperimentalEditorHotReloadSupport.GetEditorPersistedValueOrDefault();
- ProductPreferenceBase.RenderGuiAndPersistInput(FastScriptReloadPreference.EnableExperimentalEditorHotReloadSupport);
- var valueAfter = (bool)FastScriptReloadPreference.EnableExperimentalEditorHotReloadSupport.GetEditorPersistedValueOrDefault();
- if (!valueBefore && valueAfter)
- {
- EditorUtility.DisplayDialog("Experimental feature",
- "Reloading outside of playmode is still in experimental phase. " +
- "\r\n\r\nIt's not as good as in-playmode workflow",
- "Ok");
-
-#if UNITY_2019_3_OR_NEWER
- CompilationPipeline.RequestScriptCompilation();
-#elif UNITY_2017_1_OR_NEWER
- var editorAssembly = Assembly.GetAssembly(typeof(Editor));
- var editorCompilationInterfaceType = editorAssembly.GetType("UnityEditor.Scripting.ScriptCompilation.EditorCompilationInterface");
- var dirtyAllScriptsMethod = editorCompilationInterfaceType.GetMethod("DirtyAllScripts", BindingFlags.Static | BindingFlags.Public);
- dirtyAllScriptsMethod.Invoke(editorCompilationInterfaceType, null);
-#endif
- }
- }
-
- GUILayout.Space(10);
-
- EditorGUILayout.HelpBox(@"Tool will automatically trigger full domain reload after number of hot-reloads specified below has been reached.
-This is to ensure dynamically created and loaded assembles are cleared out properly", MessageType.Info);
- GUILayout.Space(10);
-
- using (LayoutHelper.LabelWidth(420))
- {
- ProductPreferenceBase.RenderGuiAndPersistInput(FastScriptReloadPreference.TriggerDomainReloadIfOverNDynamicallyLoadedAssembles);
- }
- GUILayout.Space(10);
- })),
- new ChangeMainViewButton("Partial Class", (screen) =>
- {
- using (LayoutHelper.LabelWidth(350))
- {
- ProductPreferenceBase.RenderGuiAndPersistInput(FastScriptReloadPreference.IsPartialClassSupportEnabled);
- }
- EditorGUILayout.HelpBox("Partial class support can be file-read heavy which could make FSR slower.", MessageType.Warning);
- })
- }),
- new GuiSection("Advanced", new List
- {
- new ChangeMainViewButton("File Watchers", (screen) =>
- {
- EditorGUILayout.HelpBox(
- $@"Asset watches .cs files for changes. Unfortunately Unity's FileWatcher
-implementation has some performance issues.
-
-By default all project directories can be watched, you can adjust that here.
-
-path - which directory to watch
-filter - narrow down files to match filter, eg all *.cs files (*.cs)
-includeSubdirectories - whether child directories should be watched as well
-
-{FastScriptReloadManager.FileWatcherReplacementTokenForApplicationDataPath} - you can use that token and it'll be replaced with your /Assets folder"
- , MessageType.Info);
-
- EditorGUILayout.HelpBox("Recompile after making changes for file watchers to re-load.", MessageType.Warning);
- GUILayout.Space(10);
-
- using (LayoutHelper.LabelWidth(240))
- {
- ProductPreferenceBase.RenderGuiAndPersistInput(FastScriptReloadPreference.FileWatcherImplementationInUse);
- }
- EditorGUILayout.HelpBox(
-@"DefaultUnity - on some editor versions it could be slow or not trigger at all
-DirectWindowsApi - (experimental) uses Windows API directly, faster (symlinks not supported)
-CustomPolling - (experimental) watches files by manual polling for changes, slowest. Make sure to narrow down watchers scope to script folders", MessageType.Info);
-
- ProductPreferenceBase.RenderGuiAndPersistInput(FastScriptReloadPreference.FileWatcherSetupEntries);
- }),
- new ChangeMainViewButton("Exclude References", (screen) =>
- {
- EditorGUILayout.HelpBox(
- $@"Asset pulls in all the references from changed assembly. If you're encountering some compilation errors relating to those - please use list below to exclude specific ones."
- , MessageType.Info);
-
- EditorGUILayout.HelpBox($@"By default asset removes ExCSS.Unity as it collides with the Tuple type. If you need that library in changed code - please remove from the list", MessageType.Warning);
-
- ProductPreferenceBase.RenderGuiAndPersistInput(FastScriptReloadPreference.ReferencesExcludedFromHotReload);
- })
- }),
- new GuiSection("Launch Demo", new List
- {
- launchSceneButton
- })
- };
- }
-
- private static readonly string RedirectBaseUrl = "https://immersivevrtools.com/redirect/fast-script-reload";
- private static readonly GuiSection TopSection = CreateTopSectionButtons(RedirectBaseUrl);
-
- protected static GuiSection CreateTopSectionButtons(string redirectBaseUrl)
- {
- return new GuiSection("Support", new List
- {
- new OpenUrlButton("Documentation", $"{redirectBaseUrl}/documentation"),
- new OpenUrlButton("Discord", $"{redirectBaseUrl}/discord"),
- new OpenUrlButton("Github", $"{redirectBaseUrl}/github"),
- new OpenUrlButton("Donate", $"{redirectBaseUrl}/donate", "sv_icon_name3")
- }
- );
- }
-
- private static readonly GuiSection BottomSection = new GuiSection(
- "I want to make this tool better. And I need your help!",
- $"Please spread the word and star github repo. Alternatively if you're in a position to make a donation I'd hugely appreciate that. It allows me to spend more time on the tool instead of paid client projects.",
- new List
- {
- new OpenUrlButton(" Star on Github", $"{RedirectBaseUrl}/github"),
- new OpenUrlButton(" Donate", $"{RedirectBaseUrl}/donate"),
- }
- );
-
- public override string WindowTitle { get; } = _WindowTitle;
- public override Vector2 WindowSizePx { get; } = _WindowSizePx;
-
-#if !LiveScriptReload_Enabled
- [MenuItem("Window/Fast Script Reload/Start Screen", false, 1999)]
-#endif
- public static FastScriptReloadWelcomeScreen Init()
- {
- return OpenWindow(_WindowTitle, _WindowSizePx);
- }
-
-#if !LiveScriptReload_Enabled
- [MenuItem("Window/Fast Script Reload/Force Reload", true, 1999)]
-#endif
- public static bool ForceReloadValidate()
- {
- return EditorApplication.isPlaying && (bool)FastScriptReloadPreference.EnableOnDemandReload.GetEditorPersistedValueOrDefault();
- }
-
-#if !LiveScriptReload_Enabled
- [MenuItem("Window/Fast Script Reload/Force Reload", false, 1999)]
-#endif
- public static void ForceReload()
- {
- if (!(bool)FastScriptReloadPreference.EnableOnDemandReload.GetEditorPersistedValueOrDefault())
- {
- LoggerScoped.LogWarning("On demand hot reload is disabled, can't perform. You can enable it via 'Window -> Fast Script Reload -> Start Screen -> Reload -> Enable on demand reload'");
- return;
- }
-
- FastScriptReloadManager.Instance.TriggerReloadForChangedFiles();
- }
-
- public void OnEnable()
- {
- OnEnableCommon(ProjectIconName);
- }
-
- public void OnGUI()
- {
- RenderGUI(LeftSections, TopSection, BottomSection, MainScrollViewSection);
- }
-
- protected static void CreateOpenFunctionLibraryOnRippleMethodButton()
- {
- if (GUILayout.Button("Open 'FunctionLibrary.cs'"))
- {
- var codeComponent = AssetDatabase.LoadAssetAtPath(AssetDatabase.GUIDToAssetPath(AssetDatabase.FindAssets($"t:Script FunctionLibrary")[0]));
- CodeEditorManager.GotoScript(codeComponent, "Ripple");
- }
- }
- }
-
- public class FastScriptReloadPreference : ProductPreferenceBase
- {
- public const string BuildSymbol_DetailedDebugLogging = "ImmersiveVrTools_DebugEnabled";
-
- public const string ProductName = "Fast Script Reload";
- private static string[] ProductKeywords = new[] { "productivity", "tools" };
-
- /// Used to know when file watchers have changed from project window contextual menu (so when to update file watchers)
- public static bool FileWatcherSetupEntriesChanged = false;
-
- public static readonly IntProjectEditorPreferenceDefinition BatchScriptChangesAndReloadEveryNSeconds = new IntProjectEditorPreferenceDefinition(
- "Batch script changes and reload every N seconds", "BatchScriptChangesAndReloadEveryNSeconds", 1);
-
- public static readonly ToggleProjectEditorPreferenceDefinition EnableAutoReloadForChangedFiles = new ToggleProjectEditorPreferenceDefinition(
- "Enable auto Hot-Reload for changed files (in play mode)", "EnableAutoReloadForChangedFiles", true);
-
- public static readonly ToggleProjectEditorPreferenceDefinition EnableOnDemandReload = new ToggleProjectEditorPreferenceDefinition(
- "Enable on demand hot reload", "EnableOnDemandReload", false);
-
- public static readonly ToggleProjectEditorPreferenceDefinition EnableExperimentalThisCallLimitationFix = new ToggleProjectEditorPreferenceDefinition(
- "(Experimental) Enable method calls with 'this' as argument fix", "EnableExperimentalThisCallLimitationFix", true, (object newValue, object oldValue) =>
- {
- DynamicCompilationBase.EnableExperimentalThisCallLimitationFix = (bool)newValue;
- },
- (value) =>
- {
- DynamicCompilationBase.EnableExperimentalThisCallLimitationFix = (bool)value;
- });
-
- public static readonly StringListProjectEditorPreferenceDefinition FilesExcludedFromHotReload = new StringListProjectEditorPreferenceDefinition(
- "Files excluded from Hot-Reload", "FilesExcludedFromHotReload", new List {}, isReadonly: true);
-
- public static readonly StringListProjectEditorPreferenceDefinition ReferencesExcludedFromHotReload = new StringListProjectEditorPreferenceDefinition(
- "References to exclude from Hot-Reload", "ReferencesExcludedFromHotReload", new List
- {
- "ExCSS.Unity.dll"
- }, (newValue, oldValue) =>
- {
- DynamicCompilationBase.ReferencesExcludedFromHotReload = (List)newValue;
- },
- (value) =>
- {
- DynamicCompilationBase.ReferencesExcludedFromHotReload = (List)value;
- });
-
- public static readonly ToggleProjectEditorPreferenceDefinition LogHowToFixMessageOnCompilationError = new ToggleProjectEditorPreferenceDefinition(
- "Log how to fix message on compilation error", "LogHowToFixMessageOnCompilationError", true, (object newValue, object oldValue) =>
- {
- DynamicCompilationBase.LogHowToFixMessageOnCompilationError = (bool)newValue;
- },
- (value) =>
- {
- DynamicCompilationBase.LogHowToFixMessageOnCompilationError = (bool)value;
- }
- );
-
- public static readonly ToggleProjectEditorPreferenceDefinition DebugWriteRewriteReasonAsComment = new ToggleProjectEditorPreferenceDefinition(
- "Write rewrite reason as comment in changed file", "DebugWriteRewriteReasonAsComment", false, (object newValue, object oldValue) =>
- {
- DynamicCompilationBase.DebugWriteRewriteReasonAsComment = (bool)newValue;
- },
- (value) =>
- {
- DynamicCompilationBase.DebugWriteRewriteReasonAsComment = (bool)value;
- });
-
- public static readonly ToggleProjectEditorPreferenceDefinition IsAutoOpenGeneratedSourceFileOnChangeEnabled = new ToggleProjectEditorPreferenceDefinition(
- "Auto-open generated source file for debugging", "IsAutoOpenGeneratedSourceFileOnChangeEnabled", false);
-
- public static readonly ToggleProjectEditorPreferenceDefinition StopShowingAutoReloadEnabledDialogBox = new ToggleProjectEditorPreferenceDefinition(
- "Stop showing assets/script auto-reload enabled warning", "StopShowingAutoReloadEnabledDialogBox", false);
- public static readonly ToggleProjectEditorPreferenceDefinition EnableDetailedDebugLogging = new ToggleProjectEditorPreferenceDefinition(
- "Enable detailed debug logging", "EnableDetailedDebugLogging", false,
- (object newValue, object oldValue) =>
- {
- BuildDefineSymbolManager.SetBuildDefineSymbolState(BuildSymbol_DetailedDebugLogging, (bool)newValue);
- },
- (value) =>
- {
- BuildDefineSymbolManager.SetBuildDefineSymbolState(BuildSymbol_DetailedDebugLogging, (bool)value);
- }
- );
-
- public static readonly ToggleProjectEditorPreferenceDefinition IsDidFieldsOrPropertyCountChangedCheckDisabled = new ToggleProjectEditorPreferenceDefinition(
- "Disable added/removed fields check", "IsDidFieldsOrPropertyCountChangedCheckDisabled", false,
- (object newValue, object oldValue) =>
- {
- FastScriptReloadManager.Instance.AssemblyChangesLoaderEditorOptionsNeededInBuild.IsDidFieldsOrPropertyCountChangedCheckDisabled = (bool)newValue;
- },
- (value) =>
- {
- FastScriptReloadManager.Instance.AssemblyChangesLoaderEditorOptionsNeededInBuild.IsDidFieldsOrPropertyCountChangedCheckDisabled = (bool)value;
- }
- );
-
- public static readonly ToggleProjectEditorPreferenceDefinition IsVisualHotReloadIndicationShownInProjectWindow = new ToggleProjectEditorPreferenceDefinition(
- "Show red / green bar in project window to indicate hot reload state for file", "IsVisualHotReloadIndicationShownInProjectWindow", true);
-
- public static readonly ToggleProjectEditorPreferenceDefinition IsPartialClassSupportEnabled = new ToggleProjectEditorPreferenceDefinition(
- "(Experimental) Partial class support", "IsPartialClassSupportEnabled", true);
-
- public static readonly ToggleProjectEditorPreferenceDefinition IsForceLockAssembliesViaCode = new ToggleProjectEditorPreferenceDefinition(
- "Force prevent assembly reload during playmode", "IsForceLockAssembliesViaCode", false);
-
- public static readonly JsonObjectListProjectEditorPreferenceDefinition FileWatcherSetupEntries = new JsonObjectListProjectEditorPreferenceDefinition(
- "File Watchers Setup", "FileWatcherSetupEntries", new List
- {
- JsonUtility.ToJson(new FileWatcherSetupEntry(FastScriptReloadManager.FileWatcherReplacementTokenForApplicationDataPath, "*.cs", true))
- },
- () => new FileWatcherSetupEntry(FastScriptReloadManager.FileWatcherReplacementTokenForApplicationDataPath, "*.cs", true)
- );
-
- public static readonly ToggleProjectEditorPreferenceDefinition EnableExperimentalAddedFieldsSupport = new ToggleProjectEditorPreferenceDefinition(
- "(Experimental) Enable runtime added field support", "EnableExperimentalAddedFieldsSupport", true,
- (object newValue, object oldValue) =>
- {
- FastScriptReloadManager.Instance.AssemblyChangesLoaderEditorOptionsNeededInBuild.EnableExperimentalAddedFieldsSupport = (bool)newValue;
- },
- (value) =>
- {
- FastScriptReloadManager.Instance.AssemblyChangesLoaderEditorOptionsNeededInBuild.EnableExperimentalAddedFieldsSupport = (bool)value;
- });
-
- public static readonly ToggleProjectEditorPreferenceDefinition EnableExperimentalEditorHotReloadSupport = new ToggleProjectEditorPreferenceDefinition(
- "(Experimental) Enable Hot-Reload outside of play mode", "EnableExperimentalEditorHotReloadSupport", false);
-
- [Obsolete("Use EnableExperimentalEditorHotReloadSupport instead")]
- public static readonly ToggleProjectEditorPreferenceDefinition EnableCustomFileWatcher = new ToggleProjectEditorPreferenceDefinition(
- "(Experimental) Use custom file watchers", "EnableCustomFileWatcher", false);
-
- public static readonly EnumProjectEditorPreferenceDefinition FileWatcherImplementationInUse = new EnumProjectEditorPreferenceDefinition(
- "File Watcher implementation", "FileWatcherImplementationInUse", FileWatcherImplementation.UnityDefault, typeof(FileWatcherImplementation));
-
- //TODO: potentially that's just a normal settings (also in playmode) - but in playmode user is unlikely to make this many changes
- public static readonly IntProjectEditorPreferenceDefinition TriggerDomainReloadIfOverNDynamicallyLoadedAssembles = new IntProjectEditorPreferenceDefinition(
- "Trigger full domain reload after N hot-reloads (when not in play mode)", "TriggerDomainReloadIfOverNDynamicallyLoadedAssembles", 50);
-
- public static readonly ToggleProjectEditorPreferenceDefinition WatchOnlySpecified = new ToggleProjectEditorPreferenceDefinition(
- "Specify watched files/folders manually", "WatchOnlySpecified", false);
-
-
- public static void SetCommonMaterialsShader(ShadersMode newShaderModeValue)
- {
- var rootToolFolder = AssetPathResolver.GetAssetFolderPathRelativeToScript(ScriptableObject.CreateInstance(typeof(FastScriptReloadWelcomeScreen)), 1);
- if (rootToolFolder.Contains("/Scripts"))
- {
- rootToolFolder = rootToolFolder.Replace("/Scripts", ""); //if nested remove that and go higher level
- }
- var assets = AssetDatabase.FindAssets("t:Material Point", new[] { rootToolFolder });
-
- try
- {
- Shader shaderToUse = null;
- switch (newShaderModeValue)
- {
- case ShadersMode.HDRP: shaderToUse = Shader.Find("Shader Graphs/Point URP"); break;
- case ShadersMode.URP: shaderToUse = Shader.Find("Shader Graphs/Point URP"); break;
- case ShadersMode.Surface: shaderToUse = Shader.Find("Graph/Point Surface"); break;
- default:
- throw new ArgumentOutOfRangeException();
- }
-
- foreach (var guid in assets)
- {
- var material = AssetDatabase.LoadAssetAtPath(AssetDatabase.GUIDToAssetPath(guid));
- if (material.shader.name != shaderToUse.name)
- {
- material.shader = shaderToUse;
- }
- }
- }
- catch (Exception ex)
- {
- LoggerScoped.LogWarning($"Shader does not exist: {ex.Message}");
- }
- }
-
- public static List