Ejemplo n.º 1
0
 void Awake()
 {
     m_audiosource = gameObject.GetComponent <AudioSource>();
     vars          = Managevars.GetManagevars();
     EventCenter.AddListener(EventDefine.PlayClickAudio, PlayAudio);
     EventCenter.AddListener <bool>(EventDefine.IsMusicOn, IsMusicOn);
 }
Ejemplo n.º 2
0
    void Awake()
    {
        vars = Managevars.GetManagevars();
        Init();
        EventCenter.AddListener(EventDefine.ShowMainPanel, Show);

        EventCenter.AddListener <int>(EventDefine.ChangeSkin, ChangeSkin);
    }
Ejemplo n.º 3
0
    void Awake()
    {
        vars           = Managevars.GetManagevars();
        m_spriterender = gameObject.GetComponent <SpriteRenderer>();
        int ranValue = Random.Range(0, vars.bgThemeSpriteList.Count);

        m_spriterender.sprite = vars.bgThemeSpriteList[ranValue];
    }
Ejemplo n.º 4
0
 void Awake()
 {
     EventCenter.AddListener <bool>(EventDefine.IsMusicOn, IsMusicOn);
     EventCenter.AddListener <int>(EventDefine.ChangeSkin, ChangeSkin);
     vars          = Managevars.GetManagevars();
     my_Body       = GetComponent <Rigidbody2D>();
     spriterender  = GetComponent <SpriteRenderer>();
     m_AudioSource = gameObject.GetComponent <AudioSource>();
 }
Ejemplo n.º 5
0
    void Awake()
    {
        vars     = Managevars.GetManagevars();
        Instance = this;
        EventCenter.AddListener(EventDefine.AddScore, AddGameScore);
        EventCenter.AddListener(EventDefine.PlayerMove, PlayerMove);
        EventCenter.AddListener(EventDefine.AddDiamond, AddGameDiamond);
        EventCenter.AddListener <int>(EventDefine.UpdateAllDiamond, UpdateAllDiamond);


        if (GameData.isRestartGame)
        {
            IsGameStarted = true;
        }

        InitGameData();
    }
Ejemplo n.º 6
0
    void Awake()
    {
        EventCenter.AddListener(EventDefine.ShowShopPanel, Show);

        parent   = transform.Find("ScrollRect/Parent");
        txt_Name = transform.Find("txt_Name").GetComponent <Text>();
        btn_Back = transform.Find("btn_back").GetComponent <Button>();
        btn_Back.onClick.AddListener(OnBackButtonClick);
        btn_select = transform.Find("btn_select").GetComponent <Button>();
        btn_select.onClick.AddListener(OnSelectBtnClick);
        btn_buy = transform.Find("btn_buy").GetComponent <Button>();
        btn_buy.onClick.AddListener(OnBuyButtonClick);
        txt_diamond = transform.Find("Diamond/Text").GetComponent <Text>();
        Debug.Log("jiazai wancheng");
        vars = Managevars.GetManagevars();
        //Init();
    }
Ejemplo n.º 7
0
 void Awake()
 {
     EventCenter.AddListener(EventDefine.DecidePath, DecidePath);
     vars = Managevars.GetManagevars();
 }
Ejemplo n.º 8
0
 private void Awake()
 {
     Instance = this;
     vars     = Managevars.GetManagevars();
     Init();
 }