Example #1
0
    public MyIntEvent observer; //my observer

    private void Awake()
    {
        if (observer == null)
        {
            observer = new MyIntEvent();
        }
    }
Example #2
0
    void Start()
    {
        // c# events

        myEvent        += OnEvent;
        myEventParams1 += OnEventParams1;
        myEventParams1 += OnEventParams1v2;
        myEventParams2 += OnEventParams2;
        myEventReturn  += OnEventReturn;
        myEventReturn  += OnEventReturn;
        myEventReturn  += OnEventReturnV2;

        // unity events

        if (myUnityEvent == null)
        {
            myUnityEvent = new UnityEvent();
        }

        myUnityEvent.AddListener(OnUnityEvent);

        if (myUnityIntEvent == null)
        {
            myUnityIntEvent = new MyIntEvent();
        }

        myUnityIntEvent.AddListener(OnUnityIntEvent);
    }
Example #3
0
    void Start()
    {
        if (m_MyEvent == null)
        {
            m_MyEvent = new MyIntEvent();
        }

        m_MyEvent.AddListener(Ping);
    }
Example #4
0
    private void Start()
    {
        animator = GetComponent <Animator>();

        animState = animator.GetCurrentAnimatorStateInfo(0);

        //girl_Combo_ZZZ.AddListener(qwe);

        m_MyEvent = new MyIntEvent();

        m_MyEvent.AddListener(qwe);
    }
Example #5
0
    private void InitEventHandlers()
    {
        if (_scoreCountingEvent == null)
        {
            _scoreCountingEvent = new MyIntEvent();
        }

        if (_totalScoreCountingEvent == null)
        {
            _totalScoreCountingEvent = new MyIntEvent();
        }

        _scoreCountingEvent.AddListener(CountCurrentScore);

        _totalScoreCountingEvent.AddListener(CountTotalScore);
    }
Example #6
0
 public Graph(int columns, int rows, string[,] data)
 {
     OnLocationChanged   = new MyIntEvent();
     this.obstacleHandle = false;
     this.columns        = columns;
     this.rows           = rows;
     this.data           = data;
     ClearData();
     this.tiles = rows * columns;
     this.adj   = new LinkedList <int> [tiles];
     for (int i = 0; i < tiles; ++i)
     {
         this.adj[i] = new LinkedList <int>();
     }
     this.fillTheMap();
     this.CreateAdjacencies();
 }
Example #7
0
 // Start is called before the first frame update
 void Start()
 {
     creationPosition   = transform.position;
     creationPosition.y = creationPosition.y - 0.5f;
     buttonPressed      = 0; //default, 0 means no button pressed
     colorPressed       = 0; //default, 0 means no color pressed
     if (unpressButton == null)
     {
         unpressButton = new MyIntEvent();
     }
     if (unpressColorButton == null)
     {
         unpressColorButton = new MyIntEvent();
     }
     if (blockFinished == null)
     {
         blockFinished = new MyIntEvent();
     }
 }
    private void InitEventHandling()
    {
        // MyIntEvent class is found inside Student script
        if (_asleepEvent == null)
        {
            _asleepEvent = new MyIntEvent();
        }
        _asleepEvent.AddListener(SetVisible);

        if (_awakeEvent == null)
        {
            _awakeEvent = new MyIntEvent();
        }
        _awakeEvent.AddListener(SetInvisible);

        if (_fallOkEvent == null)
        {
            _fallOkEvent = new MyIntEvent();
        }
        _fallOkEvent.AddListener(SetFallOk);
    }
Example #9
0
    private void Start()
    {
        MyIntEvent observer = FindObjectOfType <Score>().observer;

        observer.AddListener(SetScore);
    }