Example #1
0
    private void HeardTraverseNode()
    {
        if (EnergyLauncher.instance.CurrentSymbolData.IsMatchingKey(CorrectKeyFormation))
        {
            Debug.Log("GAME WON!");
        }

        if (NodeBehaviour.AllNodesClosed())
        {
            ResetGame();
        }
    }
Example #2
0
    private void HeardTraverseNode(NodeBehaviour node)
    {
        if (m_history.Count > 0)
        {
            m_history.Peek().m_Symbol.gameObject.SetActive(true);
        }
        m_history.Push(node);

        bool hardReset = false;

        switch (node.m_Operator)
        {
        case EBoolOperator.Union:
            m_YourSymbol.UnionWith(node.m_Symbol);
            break;

        case EBoolOperator.Intersection:
            m_YourSymbol.IntersectionWith(node.m_Symbol);
            break;

        case EBoolOperator.Complement:

            m_YourSymbol.UnionWith(node.m_Symbol);
            break;

        case EBoolOperator.EndComparison:
            m_history.Pop();
            if (m_YourSymbol.IsEquivalentSymbol(CurrentLevel.m_SymbolToCompleteLevel))
            {
                OnCorrectSymbol();
            }
            else
            {
                hardReset = true;
            }
            break;

        default:
            Debug.Log("You shouldn't be here bud");
            break;
        }

        MoveYourSymbolTo(node.m_Symbol);
        node.m_Symbol.gameObject.SetActive(false);

        if ((NodeBehaviour.AllNodesClosed() && !CurrentLevel.LevelComplete) || hardReset)
        {
            node.m_Symbol.gameObject.SetActive(true);
            ResetGame();
        }
    }