Exemplo n.º 1
0
    void Start()
    {
        spriteRenderer = GetComponent <SpriteRenderer>();
        int index = Random.Range(0, ManageVars.GetManageVars().sprites.Count);

        spriteRenderer.sprite = ManageVars.GetManageVars().sprites[index];
    }
Exemplo n.º 2
0
 private void OnRankButton()
 {
     if (GameCOntroller.Instance.isMusicOn)
     {
         AudioSource.PlayClipAtPoint(ManageVars.GetManageVars().ButtonClip, transform.position);
     }
     EventCenter.Broadcast(EventDefine.ShowRankPanel);
 }
Exemplo n.º 3
0
 void OnNoButton()
 {
     if (GameCOntroller.Instance.isMusicOn)
     {
         AudioSource.PlayClipAtPoint(ManageVars.GetManageVars().ButtonClip, transform.position);
     }
     gameObject.SetActive(false);
 }
Exemplo n.º 4
0
 private void Awake()
 {
     Vars = ManageVars.GetManageVars();
     EventCenter.AddListener(EventDefine.Mute, Mute);
     EventCenter.AddListener(EventDefine.CharacterChangeSkin, CharacterChangeSkin);
     rgd            = GetComponent <Rigidbody2D>();
     CharacterAudio = GetComponent <AudioSource>();
     Mute();
 }
Exemplo n.º 5
0
    private void Awake()
    {
        Debug.Log("Awake is called");
        Vars             = ManageVars.GetManageVars();
        m_SpriteRenderer = GetComponent <SpriteRenderer>();
        int RanValue = Random.Range(0, Vars.bgTheme.Count);

        m_SpriteRenderer.sprite = Vars.bgTheme[RanValue];
    }
Exemplo n.º 6
0
 private void OnShopButton()
 {
     if (GameCOntroller.Instance.isMusicOn)
     {
         AudioSource.PlayClipAtPoint(ManageVars.GetManageVars().ButtonClip, transform.position);
     }
     gameObject.SetActive(false);
     EventCenter.Broadcast(EventDefine.ShowShopUI);
 }
Exemplo n.º 7
0
 void OnTryAgain()
 {
     if (GameCOntroller.Instance.isMusicOn)
     {
         AudioSource.PlayClipAtPoint(ManageVars.GetManageVars().ButtonClip, transform.position);
     }
     SceneManager.LoadScene(SceneManager.GetActiveScene().name);
     GameData.isRestartGame = true;
 }
Exemplo n.º 8
0
 private void Awake()
 {
     Vars      = ManageVars.GetManageVars();
     YesButton = transform.Find("YesButton").GetComponent <Button>();
     YesButton.onClick.AddListener(OnYesButton);
     NOButton = transform.Find("NoButton").GetComponent <Button>();
     NOButton.onClick.AddListener(OnNoButton);
     EventCenter.AddListener(EventDefine.ShowResetPanel, ShowResetPanel);
     gameObject.SetActive(false);
 }
Exemplo n.º 9
0
 void OnPauseButton()
 {
     if (GameCOntroller.Instance.isMusicOn)
     {
         AudioSource.PlayClipAtPoint(ManageVars.GetManageVars().ButtonClip, transform.position);
     }
     PlayButton.gameObject.SetActive(true);
     PauseButton.gameObject.SetActive(false);
     Time.timeScale = 1;
     GameCOntroller.Instance.isGamePause = false;
 }
Exemplo n.º 10
0
    void SelectCharacter()
    {
        if (GameCOntroller.Instance.isMusicOn)
        {
            AudioSource.PlayClipAtPoint(ManageVars.GetManageVars().ButtonClip, transform.position);
        }
        int index = transform.Find("ScrollRect").GetComponent <DragController>().TOBackScrollIndex;

        Debug.Log(index);
        Vars.SkinChoose.GetComponent <Image>().sprite = Vars.BackCharacter[index];
        GameCOntroller.Instance.SelectCharacterIndex  = index;
        EventCenter.Broadcast(EventDefine.CharacterChangeSkin);
        EventCenter.Broadcast(EventDefine.FastLook);
        BackTOMain();
    }
Exemplo n.º 11
0
 private void Awake()
 {
     Vars = ManageVars.GetManageVars();
     EventCenter.AddListener(EventDefine.ShowShopUI, ShowShopUI);
     EventCenter.AddListener <bool>(EventDefine.ShowBuyOrSelect, ShowBuyOrSelectButton);
     BuyButton = transform.Find("BuyButton").GetComponent <Button>();
     BuyButton.onClick.AddListener(BuyCharacter);
     SelectButton = transform.Find("SelectButton").GetComponent <Button>();
     SelectButton.onClick.AddListener(SelectCharacter);
     BackToMainButton = transform.Find("BackButton_Shop").GetComponent <Button>();
     BackToMainButton.onClick.AddListener(BackTOMain);
     DiamondText = transform.Find("DiamonPanel/Diamond_Shop/Text").GetComponent <Text>();
     ScrollRect  = transform.Find("ScrollRect");
     Choose      = transform.Find("ScrollRect/Choose").gameObject;
     gameObject.SetActive(false);
 }
Exemplo n.º 12
0
 void OnYesButton()
 {
     if (GameCOntroller.Instance.isMusicOn)
     {
         AudioSource.PlayClipAtPoint(ManageVars.GetManageVars().ButtonClip, transform.position);
     }
     GameCOntroller.Instance.isMusicOn            = true;
     GameCOntroller.Instance.BestScore            = new int[3];
     GameCOntroller.Instance.CharacterIsUnlock    = new bool[Vars.CharacterSpriteList.Count];
     GameCOntroller.Instance.CharacterIsUnlock[0] = true;
     GameCOntroller.Instance.SelectCharacterIndex = 0;
     GameCOntroller.Instance.DiamondCount         = 10;
     GameCOntroller.Instance.isFirstGame          = false;
     GameCOntroller.Instance.Restore();
     EventCenter.Broadcast(EventDefine.FastLook);
     Vars.SkinChoose.GetComponent <Image>().sprite = Vars.BackCharacter[0];
     gameObject.SetActive(false);
 }
Exemplo n.º 13
0
 private void OnSoundButton()
 {
     if (GameCOntroller.Instance.isMusicOn)
     {
         AudioSource.PlayClipAtPoint(ManageVars.GetManageVars().ButtonClip, transform.position);
     }
     GameCOntroller.Instance.isMusicOn = !GameCOntroller.Instance.isMusicOn;
     if (GameCOntroller.Instance.isMusicOn)
     {
         SoundButton.transform.Find("Image").gameObject.SetActive(true);
         SoundButton.transform.Find("mute").gameObject.SetActive(false);
     }
     else
     {
         SoundButton.transform.Find("Image").gameObject.SetActive(false);
         SoundButton.transform.Find("mute").gameObject.SetActive(true);
     }
     EventCenter.Broadcast(EventDefine.Mute);
 }
Exemplo n.º 14
0
    void BuyCharacter()
    {
        if (GameCOntroller.Instance.isMusicOn)
        {
            AudioSource.PlayClipAtPoint(ManageVars.GetManageVars().ButtonClip, transform.position);
        }
        int index  = transform.Find("ScrollRect").GetComponent <DragController>().TOBackScrollIndex;
        int result = Vars.CharacterCost[index];

        if (GameCOntroller.Instance.DiamondCount >= result)
        {
            GameCOntroller.Instance.DiamondCount            -= result;
            GameCOntroller.Instance.CharacterIsUnlock[index] = true;
            ShowBuyOrSelectButton(true);
            DiamondText.text = GameCOntroller.Instance.DiamondCount.ToString();
            EventCenter.Broadcast(EventDefine.ShowGreyForCharacter);
        }
        else
        {
            Text textForDiamond = BuyButton.transform.Find("Text").GetComponent <Text>();
            textForDiamond.DOColor(Color.red, 0.1f).SetEase(Ease.InBounce).SetLoops(3).From();
        }
    }
Exemplo n.º 15
0
 private void Awake()
 {
     Vars = ManageVars.GetManageVars();
     EventCenter.AddListener(EventDefine.FastLook, ToLookSkin);
     Init();
 }
Exemplo n.º 16
0
 private void Awake()
 {
     Instance = this;
     vars     = ManageVars.GetManageVars();
     Init();
 }
Exemplo n.º 17
0
 private void Awake()
 {
     EventCenter.AddListener(EventDefine.DecidePath, DecidePath);
     Vars = ManageVars.GetManageVars();
 }
Exemplo n.º 18
0
 void BackTOMain()
 {
     AudioSource.PlayClipAtPoint(ManageVars.GetManageVars().ButtonClip, transform.position);
     EventCenter.Broadcast(EventDefine.ShowMainUI);
     gameObject.SetActive(false);
 }
Exemplo n.º 19
0
 private void Awake()
 {
     Vars = ManageVars.GetManageVars();
     Destroy(gameObject, GameCOntroller.Instance.TimeToFall);
 }
Exemplo n.º 20
0
 private void Awake()
 {
     Vars = ManageVars.GetManageVars();
     InitGameData();
     _instance = this;
 }
Exemplo n.º 21
0
 private void Awake()
 {
     Vars = ManageVars.GetManageVars();
 }
Exemplo n.º 22
0
 private void Awake()
 {
     Vars       = ManageVars.GetManageVars();
     rdg        = GetComponent <Rigidbody2D>();
     TimeTOFall = GameCOntroller.Instance.TimeToFall;
 }