addEventListener() public method

public addEventListener ( string eventType, GameObject listener, string function ) : bool
eventType string
listener GameObject
function string
return bool
Esempio n. 1
0
    public TestStateMachine()
    {
        this._state = States.Idle;

        EventManager.addEventListener("Attack", transitionToAttack);
        EventManager.addEventListener("Move", transitionToMove);
    }
Esempio n. 2
0
    // Use this for initialization
    void Start()
    {
        EventManager.addEventListener("RotateClockwise", () => { rotateCamera(90); });
        EventManager.addEventListener("RotateCounterClockwise", () => { rotateCamera(-90); });

        screenWidth  = Screen.width;
        screenHeight = Screen.height;
        screen       = new Rect(0, 0, screenWidth, screenHeight);
        cam          = Camera.main;
    }
Esempio n. 3
0
    // Use this for initialization
    private void Start()
    {
        string       jsonData     = File.ReadAllText(filePath);
        BattleConfig battleConfig = JsonUtility.FromJson <BattleConfig>(jsonData);

        MapConfig mapConfig = battleConfig.map;

        initializeMap(mapConfig);
        //initializeTurnTracker();
        //initializeUnits(battleConfig.Allies, battleConfig.Enemies);

        EventManager.addEventListener("Save", save);
    }
Esempio n. 4
0
 private void subscribeToEvents()
 {
     EventManager.addEventListener("NewGame", NewGame);
     EventManager.addEventListener("LoadGame", LoadGame);
 }
Esempio n. 5
0
 public void subscribeToEvents()
 {
     EventManager.addEventListener("StartAIBattle", startBattleVsAI);
 }