Exemplo n.º 1
0
 private void SelectedState()
 {
     ChangeColorTo(Color.yellow);
     currentState = LightStatesEnum.Selected;
     EventManager.Instance.ButtonClickedEvent(gameObject.transform);
     StartCoroutine(KillLight());
 }
Exemplo n.º 2
0
 private void Start()
 {
     EventManager.DisableInteractability += DisableInteractive;
     EventManager.EnableInteractability  += MakeInteractive;
     light        = GetComponent <Button>();
     currentState = LightStatesEnum.Alive;
     light.onClick.AddListener(SelectedState);
 }
Exemplo n.º 3
0
    private IEnumerator KillLight()
    {
        currentState = LightStatesEnum.Dead;
        yield return(new WaitForEndOfFrame());

        CallDisableEvent();
        yield return(new WaitForSeconds(1));

        ChangeColorTo(Color.red);
        EventManager.DisableInteractability -= DisableInteractive;
        EventManager.EnableInteractability  -= MakeInteractive;
        yield return(new WaitForEndOfFrame());

        CallEnableEvent();
    }