Пример #1
0
    private void Awake()
    {
        if (m_instance != null)
        {
            Destroy(gameObject);
            return;
        }
        m_instance = this;
        DontDestroyOnLoad(gameObject);

        m_sources      = transform.Find("Sounds").GetComponentsInChildren <AudioSource>();
        m_musicSource1 = transform.Find("Music1").GetComponent <AudioSource>();
        m_musicSource2 = transform.Find("Music2").GetComponent <AudioSource>();

        m_subscriberList.Add(new Event <SettingsChangedEvent> .Subscriber(OnSettingsChanges));
        m_subscriberList.Add(new Event <PlayMusicEvent> .Subscriber(PlayMusic));
        m_subscriberList.Add(new Event <IsPlayingMusicEvent> .Subscriber(IsPlayingMusic));
        m_subscriberList.Add(new Event <StopMusicEvent> .Subscriber(StopMusic));
        m_subscriberList.Add(new Event <PlaySoundEvent> .Subscriber(PlaySound));
        m_subscriberList.Add(new Event <IsPlayingSoundEvent> .Subscriber(IsPlayingSound));
        m_subscriberList.Add(new Event <PlaySoundLoopEvent> .Subscriber(PlayLoop));
        m_subscriberList.Add(new Event <StopSoundLoopEvent> .Subscriber(StopLoop));

        m_subscriberList.Subscribe();
    }
Пример #2
0
    protected override void onAwake()
    {
        m_subscriberList.Add(new Event <MonsterEatenEvent> .Subscriber(onMonsterDie));
        m_subscriberList.Subscribe();

        m_animator = GetComponent <Animator>();
    }
Пример #3
0
    private void Awake()
    {
        m_subscriberList.Add(new Event <ObjectPickedEvent> .Subscriber(OnObjectPicked));
        m_subscriberList.Subscribe();

        m_instance = this;
    }
Пример #4
0
    public DataMaster()
    {
        _subscriberList.Add(new Event <PlayerHaveJumped> .Subscriber(OnJump));
        _subscriberList.Subscribe();

        Load();
    }
Пример #5
0
 void Awake()
 {
     _subscriberList.Add(new Event <UpdateAchievementUIEvent> .Subscriber(UpdateAchievementUI));
     _subscriberList.Add(new Event <ProgressAchievementEvent> .Subscriber(UpdateAchievementProgress));
     _subscriberList.Add(new Event <RefreshAchievementsEvent> .Subscriber(RefreshMe));
     _subscriberList.Subscribe();
 }
Пример #6
0
    private void Awake()
    {
        m_subscriberList.Add(new Event <ButtonPressEvent> .Subscriber(OnMenuSelect));
        m_subscriberList.Subscribe();

        m_instance = this;
    }
Пример #7
0
    void Awake()
    {
        m_subscriberList.Add(new Event <GoldChangedEvent> .Subscriber(OnGoldChange));
        m_subscriberList.Subscribe();

        m_texts = GetComponentsInChildren <Text>();
    }
    private void Awake()
    {
        m_angle = transform.rotation.eulerAngles;

        m_subscriberList.Add(new Event <GenerationFinishedEvent> .Subscriber(onGenerationEnd));
        m_subscriberList.Subscribe();
    }
Пример #9
0
 void OnEnable()
 {
     _myButton = gameObject.GetComponent <Button> ();
     _subscriberList.Add(new Event <ShopResetEvent> .Subscriber(Refresh));
     _subscriberList.Subscribe();
     Refresh(new ShopResetEvent());
 }
Пример #10
0
    void Awake()
    {
        G.Sys.powerupManager = this;

        _subscriberList.Add(new Event <PowerupCollectedEvent> .Subscriber(OnPowerupCollect));
        _subscriberList.Subscribe();
    }
Пример #11
0
    private void Awake()
    {
        m_subscriberList.Add(new Event <CameraEndEvent> .Subscriber(onCameraEnd));
        m_subscriberList.Subscribe();

        m_source = GetComponent <AudioSource>();
    }
Пример #12
0
    private void Awake()
    {
        m_subscriberList.Add(new Event <WeaponTargetChangeEvent> .Subscriber(OnCursorMove));
        m_subscriberList.Subscribe();

        m_renderer = GetComponentInChildren <SpriteRenderer>();
    }
Пример #13
0
    private void Awake()
    {
        m_subscriberList.Add(new Event <CamShakeEvent> .Subscriber(OnCamShake));
        m_subscriberList.Subscribe();

        m_camTransform = transform.Find("Cam");
    }
Пример #14
0
    private void Awake()
    {
        m_instance = this;

        m_subscriberList.Add(new Event <DoorUsedEvent> .Subscriber(OnDoorUse));
        m_subscriberList.Subscribe();
    }
Пример #15
0
 protected override void onAwake()
 {
     m_animator = GetComponent <Animator>();
     m_subscriberList.Add(new Event <BossDieEvent> .Subscriber(onBossDie));
     m_subscriberList.Add(new Event <DieEvent> .Subscriber(onDie));
     m_subscriberList.Subscribe();
 }
Пример #16
0
    void Start()
    {
        m_subscriberList.Add(new Event <DieEvent> .Subscriber(onDeath));
        m_subscriberList.Subscribe();

        gameObject.SetActive(false);
    }
Пример #17
0
 void Awake()
 {
     _subscriberList.Add(new Event <StartCountdownEvent> .Subscriber(onCountdownStart));
     _subscriberList.Add(new Event <PauseEvent> .Subscriber(onPause));
     _subscriberList.Add(new Event <EndLevelEvent> .Subscriber(onPlayerFinish));
     _subscriberList.Add(new Event <CollectEvent> .Subscriber(onCollect));
     _subscriberList.Subscribe();
 }
Пример #18
0
    private void Awake()
    {
        DontDestroyOnLoad(gameObject);
        m_source = GetComponent <AudioSource>();

        m_subscriberList.Add(new Event <PlaySoundEvent> .Subscriber(onPlaySound));
        m_subscriberList.Subscribe();
    }
Пример #19
0
    void Awake()
    {
        G.Sys.gameManager = this;

        _subscriberList.Add(new Event <PlayerKillEvent> .Subscriber(OnPlayerKill));
        _subscriberList.Add(new Event <TextTriggerEvent> .Subscriber(OnTextTrigger));
        _subscriberList.Subscribe();
    }
Пример #20
0
    void Awake()
    {
        m_target = transform.position;

        m_subscriberList.Add(new Event <CameraTargetChangeEvent> .Subscriber(OnTargetMove));
        m_subscriberList.Add(new Event <InstantMoveCameraEvent> .Subscriber(OnInstantMove));
        m_subscriberList.Subscribe();
    }
Пример #21
0
 private void Awake()
 {
     m_subscriberList.Add(new Event <UpdateMinimapEvent> .Subscriber(OnMapUpdate));
     m_subscriberList.Add(new Event <HideMapEvent> .Subscriber(OnHideMap));
     m_subscriberList.Add(new Event <AllEnemyKilledEvent> .Subscriber(OnAllEnemyKill));
     m_subscriberList.Add(new Event <EnemySpawnEvent> .Subscriber(OnEnemySpawn));
     m_subscriberList.Subscribe();
 }
Пример #22
0
    private void Awake()
    {
        m_rigidbody = GetComponent <Rigidbody2D>();
        m_animator  = GetComponent <Animator>();

        m_subscriberList.Add(new Event <ProcessFrameEvent> .Subscriber(OnFrame));
        m_subscriberList.Subscribe();
    }
Пример #23
0
    private void Awake()
    {
        m_subscriberList.Add(new Event <FrameStatusChangedEvent> .Subscriber(OnStatusChange));
        m_subscriberList.Add(new Event <ProcessFrameEvent> .Subscriber(OnFrame));
        m_subscriberList.Subscribe();

        m_pos = transform.position;
    }
Пример #24
0
    private void Awake()
    {
        m_camera = GetComponentInChildren <Camera>();

        m_subsctiberList.Add(new Event <AddScreenShakeEvent> .Subscriber(OnAddShake));
        m_subsctiberList.Add(new Event <StopScreenShakeEvent> .Subscriber(OnStopShake));
        m_subsctiberList.Subscribe();
    }
Пример #25
0
 void Awake()
 {
     _subscriberList.Add(new Event <PlayerMovedEvent> .Subscriber(OnPlayerMove));
     _subscriberList.Add(new Event <InstantMoveCameraEvent> .Subscriber(OnInstantMove));
     _subscriberList.Add(new Event <PauseRingEvent> .Subscriber(Pause));
     _subscriberList.Add(new Event <InitializeEvent> .Subscriber(OnInit));
     _subscriberList.Subscribe();
 }
Пример #26
0
    private void Awake()
    {
        m_animator = GetComponent <Animator>();
        m_light    = transform.Find("Light").gameObject;

        m_subscriberList.Add(new Event <AllEnemyKilledEvent> .Subscriber(OnAllEnemyKill));
        m_subscriberList.Add(new Event <EnemySpawnEvent> .Subscriber(OnEnemySpawn));
        m_subscriberList.Subscribe();
    }
Пример #27
0
    private void Awake()
    {
        m_CountLabel = transform.Find("CountLabel").GetComponent <Text>();
        m_image      = transform.Find("PhotoBack").Find("Photo").GetComponent <Image>();
        m_CountLabel.gameObject.SetActive(false);

        m_subscriberList.Add(new Event <PhotoTakenEvent> .Subscriber(onPhotoTaken));
        m_subscriberList.Subscribe();
    }
Пример #28
0
    void Start()
    {
        m_subscriberList.Add(new Event <ButtonTimeoutEvent> .Subscriber(onButtonTimeout));
        m_subscriberList.Subscribe();
        m_gameMap = GameObject.Find("GameMap");
        m_fadePlane.gameObject.SetActive(false);

        LevelMap.instance.time = 0;
    }
Пример #29
0
    private void Awake()
    {
        m_subscriberList.Add(new Event <TeleportPlayerEvent> .Subscriber(OnTeleport));
        m_subscriberList.Add(new Event <GoldChangedEvent> .Subscriber(OnGoldGain));
        m_subscriberList.Subscribe();

        m_visual = transform.Find("Visual").gameObject;

        m_instance = this;
    }
Пример #30
0
    void Awake()
    {
        G.Sys.chunkSpawner = this;
        _subscriberList.Add(new Event <CameraMovedEvent> .Subscriber(OnCameraMove));
        _subscriberList.Add(new Event <InitializeEvent> .Subscriber(OnInitialize));
        _subscriberList.Add(new Event <ResetEvent> .Subscriber(OnReset));
        _subscriberList.Subscribe();

        CreateChunkData();
    }