예제 #1
0
    public void OnChosen(ElementChoiceButton button, Elements element)
    {
        if (button.IsSelected)
        {
            return;
        }

        chosenElements.Add(element);
        button.IsSelected = true;
        PrefabAndInstanceContainer.InstantiateAt(PrefabAndInstanceContainer.Instance.ParticlePrefab_ChooseElemental,
                                                 button.MyTransform.position);

        if (chosenElements.Count == 2)
        {
            FSM.Current = new Player(chosenElements[0], chosenElements[1], false);
            Elements[] aiEls = AI.ChooseElements(chosenElements);
            FSM.Opponent = new Player(aiEls[0], aiEls[1], true);

            FSM.StartCoroutine(DealOutCoroutine());
        }
        else if (chosenElements.Count > 2)
        {
            Debug.LogError("More than two elements somehow! " + chosenElements.Count);
        }
    }
예제 #2
0
    public void OnChosen(ElementChoiceButton button, Elements element)
    {
        if (button.IsSelected)
        {
            return;
        }

        chosenElements.Add(element);
        button.IsSelected = true;
        PrefabAndInstanceContainer.InstantiateAt(PrefabAndInstanceContainer.Instance.ParticlePrefab_ChooseElemental,
                                                 button.MyTransform.position);

        if (chosenElements.Count == 2)
        {
            FSM.Current = new Player(chosenElements[0], chosenElements[1], false);
            Elements[] aiEls = AI.ChooseElements(chosenElements);
            FSM.Opponent = new Player(aiEls[0], aiEls[1], true);

            FSM.StartCoroutine(DealOutCoroutine());
        }
        else if (chosenElements.Count > 2)
        {
            Debug.LogError("More than two elements somehow! " + chosenElements.Count);
        }
    }