예제 #1
0
    public override void Deactivate(GameObject activatorGameObject)
    {
        DeactivateableActivator activator = activatorGameObject.GetComponent <DeactivateableActivator>();

        if (activeActivators.Contains(activator))
        {
            activeActivators.Remove(activator);
            ExecuteDeactivation();
        }
    }
예제 #2
0
    private void FailPuzzle()
    {
        DeactivateableActivator[] auxArray = new DeactivateableActivator[activeActivators.Count];
        activeActivators.CopyTo(auxArray);

        foreach (DeactivateableActivator activator in auxArray)
        {
            activator.Deactivate();
        }
    }
예제 #3
0
    public override void Activate(GameObject activatorGameObject)
    {
        DeactivateableActivator activator = activatorGameObject.GetComponent <DeactivateableActivator>();

        if (!activeActivators.Contains(activator))
        {
            activeActivators.Add(activator);
            if (activeActivators.Count == activatorOrder.Length)
            {
                for (int i = 0; i < activatorOrder.Length; ++i)
                {
                    if (activatorOrder[i] != activeActivators[i])
                    {
                        FailPuzzle();
                        return;
                    }
                }
                ExecuteActivation();
            }
        }
    }