Beispiel #1
0
 private void Awake()
 {
     vars            = ManagerVars.GetManagerVars();
     bgsprite        = GetComponent <SpriteRenderer>();
     bgsprite.sprite = vars.bgThemeSpriteList[Random.Range(0, vars.bgThemeSpriteList.Count)];
     // bgsprite.sprite = vars.bgThemeSpriteList[2];
 }
Beispiel #2
0
 private void Awake()
 {
     EventCenter.AddListener <int>(EventDefine.ChangeSkin, ChangeSkin);
     vars           = ManagerVars.GetManagerVars();
     spriteRenderer = GetComponent <SpriteRenderer>();
     my_Body        = GetComponent <Rigidbody2D>();
 }
Beispiel #3
0
 private void Awake()
 {
     vars = ManagerVars.GetManagerVars();
     EventCenter.AddListener(EventDefine.ShowMainPanel, Show);
     EventCenter.AddListener <int>(EventDefine.ChangeSkin, ChangeSkin);
     Init();
 }
    private void Awake()
    {
        m_instance    = this;
        m_managerVars = ManagerVars.GetManagerVars();

        InitGameData();
    }
Beispiel #5
0
    private void Start()
    {
        ManagerVars vars    = ManagerVars.GetManagerVars();
        int         iRandom = Random.Range(0, vars.m_listBgTheme.Count);

        m_spriteRenderer.sprite = vars.m_listBgTheme[iRandom];
    }
Beispiel #6
0
 void Awake()
 {
     EventCenter.AddListener(EventDefine.PlayButtonAudio, PlayButtonAudio);
     EventCenter.AddListener <bool>(EventDefine.isMuteOn, IsMuteOn);
     source = GetComponent <AudioSource>();
     vars   = ManagerVars.GetManagerVars();
 }
Beispiel #7
0
 private void Awake()
 {
     Instance = this;
     vars     = ManagerVars.GetManagerVars();
     AddLift();
     Init();
 }
Beispiel #8
0
    private void Awake()
    {
        EventCenter.AddListener(EventDefine.ClickButtonAudio, ClickBtnAudio);

        m_managerVars = ManagerVars.GetManagerVars();
        m_as          = GetComponent <AudioSource>();
    }
Beispiel #9
0
 private void Awake()
 {
     vars          = ManagerVars.GetManagerVars();
     m_AudioSource = GetComponent <AudioSource>();
     EventCenter.AddListener(EventDefine.PlayClickAudio, PlayAudio);
     EventCenter.AddListener <bool>(EventDefine.IsMusicOn, IsMusicOn);
 }
Beispiel #10
0
    private void Awake()
    {
        EventCenter.AddListener <int>(EventType.SelectSkin, SelectSkin);

        vars = ManagerVars.GetManagerVars();
        Init();
    }
Beispiel #11
0
    private ManagerVars vars;              // 管理器容器

    private void Awake()
    {
        vars           = ManagerVars.GetManagerVars();             // 获取管理器容器
        spriteRenderer = gameObject.GetComponent <SpriteRenderer>();
        int index = Random.Range(0, vars.bgThemeSpriteList.Count); // 随机背景图

        spriteRenderer.sprite = vars.bgThemeSpriteList[index];     // 设置背景图
    }
Beispiel #12
0
    private void Awake()
    {
        vars   = ManagerVars.GetManagerVars();
        sprite = GetComponent <SpriteRenderer>();
        int value = Random.Range(0, vars.bgSprites.Count);

        sprite.sprite = vars.bgSprites[value];
    }
Beispiel #13
0
    private ManagerVars Vars;    //bgTheme容器
    private void Awake()
    {
        Vars             = ManagerVars.GetManagerVars();
        m_SpriteRenderer = transform.GetComponent <SpriteRenderer>();
        int ranValue = Random.Range(0, Vars.bgSpriteList.Count);

        m_SpriteRenderer.sprite = Vars.bgSpriteList[ranValue];
    }
Beispiel #14
0
 private void Awake()
 {
     EventCenter.AddListener(EventType.ShowMainPanel, Show);
     EventCenter.AddListener <int>(EventType.ChangeSkin, ChangeSkin);
     Init();
     //GameManager.Instance.IsGameStarted = false;
     vars = ManagerVars.GetManagerVars();
 }
Beispiel #15
0
 private void Awake()
 {
     Init();
     vars    = ManagerVars.GetManagerVars();
     Myaudio = transform.GetComponent <AudioSource>();
     EventCenter.AddListener(EventDefine.ShowDeadPanel, Show);
     gameObject.SetActive(false);
 }
Beispiel #16
0
 private void Awake()
 {
     vars = ManagerVars.GetManagerVars();
     Init();
     gameObject.SetActive(false);
     //监听显示游戏结束面板事件
     EventCenter.AddListener(EventDefine.ShowGameOverPanel, ShowGameOverPanel);
 }
    private void Awake()
    {
        vars             = ManagerVars.GetManagerVars();
        m_SpriteRenderer = GetComponent <SpriteRenderer>();
        int ranValue = Random.Range(0, vars.bgThemeSpriteList.Count);

        m_SpriteRenderer.sprite = vars.bgThemeSpriteList[ranValue];
    }
Beispiel #18
0
    protected override void Init()
    {
        vars             = ManagerVars.GetManagerVars();
        m_SpriteRenderer = GetComponent <SpriteRenderer>();
        int ranValue = Random.Range(0, vars.bgThemeSpriteList.Count);

        m_SpriteRenderer.sprite = vars.bgThemeSpriteList[ranValue];
    }
Beispiel #19
0
    private void Awake()
    {
        vars = ManagerVars.GetManagerVars();
        EventCenter.AddListener(EventType.ShowMainPanel, ShowMainPanel);
        EventCenter.AddListener <int>(EventType.SelectSkin, Changebtn_ShopImage);

        Init();
    }
Beispiel #20
0
 void Awake()
 {
     vars = ManagerVars.GetManagerVars();
     EventCenter.AddListener(EventDefine.AddScore, AddScore);
     EventCenter.AddListener(EventDefine.PlayerMove, PlayerMove);
     EventCenter.AddListener(EventDefine.AddDiamond, AddDiamond);
     Instance = this;
     InitGameDate();
 }
    private void Awake()
    {
        player = GameObject.Find("Player");

        //通过单独的管理器容器类的静态方法,来获取管理器中的对象
        barragePrefab = ManagerVars.GetManagerVars().barragePrefab;

        mushroomPos = transform.position;
    }
Beispiel #22
0
 private void Awake()
 {
     vars = ManagerVars.GetManagerVars();
     EventCenter.AddListener <bool>(EventDefine.IsMusicOn, IsMusicOn);
     EventCenter.AddListener <int>(EventDefine.ChangeSkin, ChangeSkin);
     my_Body        = GetComponent <Rigidbody2D>();
     spriteRenderer = GetComponent <SpriteRenderer>();
     m_AudioSource  = GetComponent <AudioSource>();
 }
Beispiel #23
0
 private void Awake()
 {
     vars = ManagerVars.GetManagerVars();
     EventCenter.AddListener(EventDefine.ShowMenu, Show);
     Continue.onClick.AddListener(ContinueGame);
     Exit.onClick.AddListener(ExitGame);
     Sound.onClick.AddListener(OnSoundClick);
     gameObject.SetActive(false);
 }
Beispiel #24
0
    public void Awake()
    {
        vars             = ManagerVars.GetManagerVars();
        m_spriteRenderer = transform.GetComponent <SpriteRenderer>();

        int ranVal = Random.Range(0, vars.bgThemes.Count);

        m_spriteRenderer.sprite = vars.bgThemes[ranVal];
    }
Beispiel #25
0
    private void Awake()
    {
        //生成随机背景
        vars = ManagerVars.GetManagerVars();
        int varsIndex = Random.Range(0, vars.bgThemeSprite.Count);

        m_SpriteRenderer        = GetComponent <SpriteRenderer>();
        m_SpriteRenderer.sprite = vars.bgThemeSprite[varsIndex];
    }
Beispiel #26
0
    // Use this for initialization
    private void Awake()
    {
        sr_ = GetComponent <SpriteRenderer>();

        // 生成随机的背景图
        vars = ManagerVars.GetManagerVars();
        int i = Random.Range(0, vars.bgThemeSpriteList.Count);

        sr_.sprite = vars.bgThemeSpriteList[i];
    }
Beispiel #27
0
    void Start()
    {
        vars = ManagerVars.GetManagerVars();
        sr   = GetComponent <SpriteRenderer>();

        //随机获取背景
        int ranValue = Random.Range(0, vars.bgTheme.Count);

        sr.sprite = vars.bgTheme[ranValue];
    }
Beispiel #28
0
    private int diamondCount;    // 记录钻石数量

    #endregion

    private void Awake()
    {
        Instance = this;
        vars     = ManagerVars.GetManagerVars();
        //  DontDestroyOnLoad(this);  // 没有多个场景不需要
        EventCenter.AddListener(EventDefine.AddScore, AddGameScore);
        EventCenter.AddListener(EventDefine.PlayerMove, PlayerMove);
        EventCenter.AddListener(EventDefine.AddDiamond, AddGameDiamond);
        InitGameData();
    }
Beispiel #29
0
    private void Awake()
    {
        // 从管理器中随机获取需要的sprite
        vars = ManagerVars.GetManagerVars();
        int ranValue = Random.Range(0, vars.bgThemeSpriteList.Count);

        // 给当前的背景随机切换
        m_spriteRenderer        = GetComponent <SpriteRenderer>();
        m_spriteRenderer.sprite = vars.bgThemeSpriteList[ranValue];
    }
 // Start is called before the first frame update
 void Start()
 {
     vars       = ManagerVars.GetManagerVars();
     startPoint = GameObject.Find("StartPoint").transform;
     spawnPoint = GameObject.Find("SpawnPoint").transform;
     txt_Score  = GameObject.Find("UI/Txt_Score").GetComponent <Text>();
     mainCamera = Camera.main;
     pinPrefab  = vars.pinPrefab;
     SpawnPin();
 }