timed button stand puzzle

This commit is contained in:
2023-04-12 12:18:04 +02:00
parent 7e803a5279
commit 42ef7cc9bd
22 changed files with 1145 additions and 365 deletions

View File

@@ -13,6 +13,7 @@ namespace Station46.Scripts
[Tooltip("The colour of the emission.")]
[ColorUsage(false, true)]
public Color color;
public bool startActive;
[BoxGroup("Internal")] [Required]
public MeshRenderer emissionRenderer;
@@ -32,6 +33,11 @@ namespace Station46.Scripts
private void Start()
{
if (startActive)
{
active = true;
}
ChangedToggle();
ChangedColor();
}

View File

@@ -11,6 +11,7 @@ namespace Station46.Scripts
private static readonly int FresnelColor = Shader.PropertyToID("_FresnelColor");
private static readonly int Color = Shader.PropertyToID("_Color");
public bool hideWhenDisabled, startInactive;
[BoxGroup("Internal")] [Required] public MeshRenderer holoRenderer;
private Material _material;
@@ -35,9 +36,16 @@ namespace Station46.Scripts
color = EscapeRoomEngine.Engine.Runtime.Engine.Theme.activeColor;
}
holoRenderer.enabled = Active || !hideWhenDisabled;
_material.SetColor(FresnelColor, color.hdr);
_material.SetColor(Color, color.hdr);
};
if (startInactive)
{
Active = false;
}
}
}
}