reinitialize texture.
This commit is contained in:
@@ -116,11 +116,12 @@ public class Texture : MonoBehaviour
|
|||||||
if (monitor == null) {
|
if (monitor == null) {
|
||||||
monitor = Manager.primary;
|
monitor = Manager.primary;
|
||||||
}
|
}
|
||||||
|
Manager.onReinitialized += Reinitialize;
|
||||||
}
|
}
|
||||||
|
|
||||||
void OnDisable()
|
void OnDisable()
|
||||||
{
|
{
|
||||||
Destroy(material);
|
Manager.onReinitialized -= Reinitialize;
|
||||||
}
|
}
|
||||||
|
|
||||||
void Update()
|
void Update()
|
||||||
@@ -129,6 +130,12 @@ public class Texture : MonoBehaviour
|
|||||||
UpdateMaterial();
|
UpdateMaterial();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void Reinitialize()
|
||||||
|
{
|
||||||
|
// Monitor instance is released here when initialized.
|
||||||
|
monitor = Manager.GetMonitor(monitor.id);
|
||||||
|
}
|
||||||
|
|
||||||
void UpdateMaterial()
|
void UpdateMaterial()
|
||||||
{
|
{
|
||||||
Invert();
|
Invert();
|
||||||
|
|||||||
Reference in New Issue
Block a user