Exemplo n.º 1
0
    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);
    }
Exemplo n.º 2
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);
    }
Exemplo n.º 3
0
    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);
    }
Exemplo n.º 4
0
 public void UpdateHandPreview(ChooseHandController.HandSetting setting)
 {
     CurrentChoosedHand.sprite = setting.HandPalmSprite;
 }
Exemplo n.º 5
0
 public void SetCurrentChoosedHand(ChooseHandController.HandColour hand)
 {
     selectedHandSetting = ChooseHandController.Instance.HandsList.Find(h => h.ColourOfHand == hand);
 }