public void Show() { gameObject.SetActive(true); var currentColor = (ChooseHandController.HandColour)PlayerPrefs.GetInt("PlayerChoosedHand"); currentHandSetting = ChooseHandController.Instance.HandsList.Find(h => h.ColourOfHand == currentColor); viewIndex = ChooseHandController.Instance.HandsList.IndexOf(currentHandSetting); ChooseHandController.Instance.SetCurrentChoosedHand(currentColor); ChooseHandController.Instance.UpdateGamePreview(currentColor); ChangeViewIndex(0); }
void ApplyOnClick() { PlayerPrefs.SetInt("PlayerChoosedHand", (int)selectedHandSetting.ColourOfHand); currentHandSetting = selectedHandSetting; var choosenHand = ChooseHandController.Instance.HandsList.Find(h => h.ColourOfHand == selectedHandSetting.ColourOfHand); if (playerMeshRendererHand != null) { playerMeshRendererHand.material = choosenHand.HandMaterial; } gameObject.SetActive(false); }
void Awake() { applyButton.onClick.AddListener(ApplyOnClick); cancelButton.onClick.AddListener(Cancel_OnClick); ChooseHandController.Instance.OnChooseColor += SetCurrentChoosedHand; ChooseHandController.Instance.OnUpdateHandPreview += UpdateHandPreview; var currentColor = (ChooseHandController.HandColour)PlayerPrefs.GetInt("PlayerChoosedHand"); currentHandSetting = ChooseHandController.Instance.HandsList.Find(h => h.ColourOfHand == currentColor); if (playerMeshRendererHand != null) { playerMeshRendererHand.material = currentHandSetting.HandMaterial; } gameObject.SetActive(false); }
public void UpdateHandPreview(ChooseHandController.HandSetting setting) { CurrentChoosedHand.sprite = setting.HandPalmSprite; }
public void SetCurrentChoosedHand(ChooseHandController.HandColour hand) { selectedHandSetting = ChooseHandController.Instance.HandsList.Find(h => h.ColourOfHand == hand); }