コード例 #1
0
    void Start()
    {
        score = 0;

        enemyDeathListener = (GameEventListener)ScriptableObject.CreateInstance("GameEventListener");
        enemyDeathListener.SetupListener(enemyDeathEvent, IncreaseScore);
    }
コード例 #2
0
    void Start()
    {
        hp = maxHealth;
        healthBar.GetComponent <Slider>().value = hp;

        GameEventListener computerAttackListener = (GameEventListener)ScriptableObject.CreateInstance("GameEventListener");

        computerAttackListener.SetupListener(computerAttackEvent, TakeDamage);
    }
コード例 #3
0
ファイル: PlayerMovement.cs プロジェクト: 2door/keep-it-alive
    void Start()
    {
        GameEventListener gameOverListener = (GameEventListener)ScriptableObject.CreateInstance("GameEventListener");

        gameOverListener.SetupListener(gameOverEvent, GameOver);
        GameEventListener pauseEventListener = (GameEventListener)ScriptableObject.CreateInstance("GameEventListener");

        pauseEventListener.SetupListener(pauseEvent, Pause);
        GameEventListener unpauseEventListener = (GameEventListener)ScriptableObject.CreateInstance("GameEventListener");

        unpauseEventListener.SetupListener(unpauseEvent, Unpause);
    }
コード例 #4
0
    void Start()
    {
        enemyAnimator.SetBool("Walk", true);

        GameEventListener gameOverListener = (GameEventListener)ScriptableObject.CreateInstance("GameEventListener");

        gameOverListener.SetupListener(gameOverEvent, GameOver);
        GameEventListener pauseEventListener = (GameEventListener)ScriptableObject.CreateInstance("GameEventListener");

        pauseEventListener.SetupListener(pauseEvent, Pause);
        GameEventListener unpauseEventListener = (GameEventListener)ScriptableObject.CreateInstance("GameEventListener");

        unpauseEventListener.SetupListener(unpauseEvent, Unpause);

        rb = gameObject.GetComponent <Rigidbody2D>();
    }
コード例 #5
0
    void Start()
    {
        GameEventListener gameOverListener = (GameEventListener)ScriptableObject.CreateInstance("GameEventListener");

        gameOverListener.SetupListener(gameOverEvent, GameOver);
    }