This file contains hidden or 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
| private string TranslateByProficiency(string s, float p) | |
| { | |
| if (p == 1) return s; | |
| if (p == 0) return CoverText.CoverTextWith(s, "x"); | |
| var words = s.Split(" "); | |
| for (int i = 0; i < words.Length; i++) | |
| { | |
| if (Random.value > p) | |
| { |
This file contains hidden or 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
| public class Durstenfeld<T> | |
| { | |
| public static void shuffle(T[] array) | |
| { | |
| int l = array.Length; | |
| for (int i = l - 1; i >= 0; i--) | |
| { | |
| int j = Random.Range(0, i); | |
| swap(array, i, j); | |
| } |
This file contains hidden or 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
| public static string CoverTextWith(string text, string x) | |
| { | |
| return Regex.Replace(text, "([A-Za-z0-9])", x); | |
| } |
This file contains hidden or 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
| public class SliderToText : MonoBehaviour | |
| { | |
| private Slider _slider; | |
| public TextMeshProUGUI label; | |
| void Start() | |
| { | |
| _slider = GetComponent<Slider>(); | |
| _slider.value = 69; | |
| } |
This file contains hidden or 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
| public class ToggleCallback : MonoBehaviour | |
| { | |
| public TextMeshProUGUI label; | |
| public List<Toggle> toggles; | |
| void Start() | |
| { | |
| string s = toggles | |
| .Select(t => t) | |
| .Where(t => t.isOn == true) |
This file contains hidden or 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
| private Image _mapImage; | |
| private Vector3 _mapPos = Vector3.zero; | |
| private Vector3 _elemPos = Vector3.zero; | |
| void Update() | |
| { | |
| _mapPos.x = _player.transform.position.x; | |
| _mapPos.y = _player.transform.position.z; | |
| _mapImage.rectTransform.localPosition = -_mapPos; |
This file contains hidden or 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
| private Mapper _player; | |
| private Dictionary<Transform, RectTransform> _images = new Dictionary<Transform, RectTransform>(); | |
| [SerializeField] | |
| private GameObject _elemTemplate; | |
| public void PaintNewElement(Mapper m) | |
| { | |
| var o = Instantiate(_elemTemplate); | |
| o.GetComponent<Image>().color = m.color; |
This file contains hidden or 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
| using System.Collections; | |
| using System.Collections.Generic; | |
| using UnityEngine; | |
| using UnityEngine.UI; | |
| public class Mapper : MonoBehaviour | |
| { | |
| public bool isPlayer; | |
| public Color color; |
This file contains hidden or 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
| public class LabelActivator : MonoBehaviour | |
| { | |
| public void LabelMuscle() | |
| { | |
| UIManager.Instance.UpdateLabel(1); | |
| } | |
| public void LabelBone() | |
| { | |
| UIManager.Instance.UpdateLabel(2); |
This file contains hidden or 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
| public void Play(int id) | |
| { | |
| _animator.SetInteger("stateId", id); | |
| UIManager.Instance.UpdateLabel(id); | |
| } |
NewerOlder