protected void Start() { status = GameStatus.INITIALIZE; hud.StartListeners(); EventMessenger.StartListener(GameEvents.START_GAME, StartGame); EventMessenger.StartListener(GameEvents.DEFEATE, Defeat); EventMessenger.StartListener(GameEvents.VICTORY, Victory); EventMessenger.StartListener(GameEvents.UPDATE_CRISTAL_COUNT, UpdateCristalCount); status = GameStatus.READY; }
void Start() { gameCamera = Camera.main.GetComponent <GameCamera>(); playerRigidbody = GetComponent <Rigidbody>(); animator = GetComponent <Animator>(); audioSource = GetComponent <AudioSource>(); gameCamera.target = transform; gameCamera.Init(); moveState = MoveState.STAND; playerTransform = transform; EventMessenger <int> .StartListener(GameEvents.CHANGE_SPEED, ChangeSpeed); }
public void StartRules() { EventMessenger <Enemy, Collider> .StartListener(GameEvents.ENEMY_TAKE_DAMAGE, EnemyTakeDamage); EventMessenger <Player, Collider> .StartListener(GameEvents.PLAYER_TAKE_DAMAGE, PlayerTakeDamage); EventMessenger <Shell, Collision> .StartListener(GameEvents.DESTROY_SHELL, DestroyShell); EventMessenger <Gate, Collision> .StartListener(GameEvents.GATE_TAKE_DAMAGE, DestroyGate); EventMessenger <Collector, Collider> .StartListener(GameEvents.COLLECT_CRISTAL, CollectCristal); EventMessenger <Collector, Collider> .StartListener(GameEvents.WARP_CRISTAL, WarpCristal); EventMessenger <Collector, Collider> .StartListener(GameEvents.STOP_WARP, StopWarp); }
public void StartListeners() { EventMessenger.StartListener(GameEvents.CHARGE, Charge); EventMessenger.StartListener(GameEvents.DISCHARGE, Discharge); EventMessenger.StartListener(GameEvents.UPDATE_HUD, UpdateHUD); }