void Start() { spriteRenderer = GetComponent <SpriteRenderer>(); int index = Random.Range(0, ManageVars.GetManageVars().sprites.Count); spriteRenderer.sprite = ManageVars.GetManageVars().sprites[index]; }
private void OnRankButton() { if (GameCOntroller.Instance.isMusicOn) { AudioSource.PlayClipAtPoint(ManageVars.GetManageVars().ButtonClip, transform.position); } EventCenter.Broadcast(EventDefine.ShowRankPanel); }
void OnNoButton() { if (GameCOntroller.Instance.isMusicOn) { AudioSource.PlayClipAtPoint(ManageVars.GetManageVars().ButtonClip, transform.position); } gameObject.SetActive(false); }
private void Awake() { Vars = ManageVars.GetManageVars(); EventCenter.AddListener(EventDefine.Mute, Mute); EventCenter.AddListener(EventDefine.CharacterChangeSkin, CharacterChangeSkin); rgd = GetComponent <Rigidbody2D>(); CharacterAudio = GetComponent <AudioSource>(); Mute(); }
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]; }
private void OnShopButton() { if (GameCOntroller.Instance.isMusicOn) { AudioSource.PlayClipAtPoint(ManageVars.GetManageVars().ButtonClip, transform.position); } gameObject.SetActive(false); EventCenter.Broadcast(EventDefine.ShowShopUI); }
void OnTryAgain() { if (GameCOntroller.Instance.isMusicOn) { AudioSource.PlayClipAtPoint(ManageVars.GetManageVars().ButtonClip, transform.position); } SceneManager.LoadScene(SceneManager.GetActiveScene().name); GameData.isRestartGame = true; }
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); }
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; }
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(); }
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); }
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); }
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); }
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(); } }
private void Awake() { Vars = ManageVars.GetManageVars(); EventCenter.AddListener(EventDefine.FastLook, ToLookSkin); Init(); }
private void Awake() { Instance = this; vars = ManageVars.GetManageVars(); Init(); }
private void Awake() { EventCenter.AddListener(EventDefine.DecidePath, DecidePath); Vars = ManageVars.GetManageVars(); }
void BackTOMain() { AudioSource.PlayClipAtPoint(ManageVars.GetManageVars().ButtonClip, transform.position); EventCenter.Broadcast(EventDefine.ShowMainUI); gameObject.SetActive(false); }
private void Awake() { Vars = ManageVars.GetManageVars(); Destroy(gameObject, GameCOntroller.Instance.TimeToFall); }
private void Awake() { Vars = ManageVars.GetManageVars(); InitGameData(); _instance = this; }
private void Awake() { Vars = ManageVars.GetManageVars(); }
private void Awake() { Vars = ManageVars.GetManageVars(); rdg = GetComponent <Rigidbody2D>(); TimeTOFall = GameCOntroller.Instance.TimeToFall; }