This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// An example snippet for: https://www.quizcanners.com/single-post/2018/04/20/Story-Trigger-Data-Interface-iSTD | |
public stdEncoder Encode() => new stdEncoder() | |
.Add("mrkP", mapMarkerPosition); | |
.Add("mrkC", mapMarkerColor); | |
public bool Decode (string tag, string data){ | |
switch (tag){ | |
case "mrkP": mapMarkerPosition = data.ToVactor2(); break; | |
case "mrkC": mapMarkerColor = data.ToColor(); break; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// How it would have been written with standard functions. Class palced inside Editor Folder. | |
EditorGUILayout.BeginHorizontal(); | |
int before = target.transparency; | |
target.transparency = EditorGUILayout.IntField("Transparency:", target.transparency); | |
if (target.transparency != before) | |
target.RecalculateShaderParameters(); | |
NewerOlder