public addEventListener ( string eventType, GameObject listener, string function ) : bool | ||
eventType | string | |
listener | GameObject | |
function | string | |
return | bool |
public TestStateMachine() { this._state = States.Idle; EventManager.addEventListener("Attack", transitionToAttack); EventManager.addEventListener("Move", transitionToMove); }
// 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; }
// 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); }
private void subscribeToEvents() { EventManager.addEventListener("NewGame", NewGame); EventManager.addEventListener("LoadGame", LoadGame); }
public void subscribeToEvents() { EventManager.addEventListener("StartAIBattle", startBattleVsAI); }