示例#1
0
 public void OnClickBtnReset()
 {
     CGameDataMgr.GetInst().HighScore.Value = 0;
     CGameDataMgr.GetInst().Gold.Value = 0;
     SetTextHighScore(CGameDataMgr.GetInst().HighScore.Value);
     SetTextGold(CGameDataMgr.GetInst().Gold.Value);
 }
示例#2
0
 public static CGameDataMgr GetInst()
 {
     if (mInstance == null)
     {
         mInstance = new CGameDataMgr();
     }
     return(mInstance);
 }
示例#3
0
文件: CUITest.cs 项目: kcwzzz/KCW
 public void OnClickBtnNext()
 {
     mpTxtDialogue.text = CGameDataMgr.GetInst().mDialogueInfoArray[mCurIndex].mDialogue;
     if (mCurIndex < CGameDataMgr.GetInst().mDialogueInfoArray.Count - 1)
     {
         mCurIndex++;
     }
 }
示例#4
0
 public CCsvDataManager()
 {
     SerABVerDataMgr   = new CServerABVerDataMgr();
     LocalABVerDataMgr = new CLocalABVerDataMgr();
     ShopItemDataMgr   = new CShopItemDataMgr();
     GameDataMgr       = new CGameDataMgr();
     TipsDataMgr       = new CTipsDataMgr();
     VipDataMgr        = new CVipDataMgr();
     GameUIDataMgr     = new CGameUIDataMgr();
 }
示例#5
0
    protected CMissile CreateMissile(Vector3 dir, Color color)
    {
        CMissile tMissile = Instantiate <CMissile>(CGameDataMgr.GetInst().PFMissile, transform.position, Quaternion.identity);

        tMissile.Direction = dir.normalized;
        tMissile.SetTargetTag("tagPlayer");
        tMissile.SetColor(color);
        tMissile.SetATK(mATK);
        return(tMissile);
    }
示例#6
0
    void Start()
    {
        CGameDataMgr.GetInst().CreateRyu();

        mpTxtDialogue.text = CGameDataMgr.GetInst().mDialogueInfoArray[mCurIndex].mDialogue;

        if (mCurIndex < CGameDataMgr.GetInst().mDialogueInfoArray.Count - 1)
        {
            //mCurIndex++;
        }
    }
示例#7
0
 public void OnClickBtnNext()
 {
     mpTxtDialogue.text = CGameDataMgr.GetInst().mDialogueInfoArray[mCurIndex].mDialogue;
     if (mCurIndex < CGameDataMgr.GetInst().mDialogueInfoArray.Count - 1)
     {
         mCurIndex++;
     }
     else
     {
         Invoke("CLoadScene", 2.0f);
     }
 }
示例#8
0
    private void Start()
    {
        //this.UpdateAsObservable()
        Observable.EveryGameObjectUpdate()
        .Where((t) => Input.GetKeyDown(KeyCode.Space))
        .First()
        .Subscribe((t) => OnClickBtnStartGame())
        .AddTo(this.gameObject);

        SetTextHighScore(CGameDataMgr.GetInst().HighScore.Value);
        SetTextGold(CGameDataMgr.GetInst().Gold.Value);
    }
示例#9
0
    private void DoMove()
    {
        float tHorizontal = Input.GetAxis("Horizontal");
        float tVertical   = Input.GetAxis("Vertical");

        mAnimator.SetInteger("aniMoveHorizontal", Mathf.CeilToInt(tHorizontal));
        if (mAnimator.GetInteger("aniMoveHorizontal") == -1)
        {
            mSpriteBody.flipX = true;
        }
        else
        {
            mSpriteBody.flipX = false;
        }
        mAnimator.SetInteger("aniMoveVertical", Mathf.CeilToInt(tVertical));


        Vector2 pos = transform.localPosition;

        pos.x = Mathf.Clamp(pos.x + (tHorizontal * mMoveSpeed * Time.deltaTime), -mMapWidth, mMapWidth);
        pos.y = Mathf.Clamp(pos.y + (tVertical * mMoveSpeed * Time.deltaTime), -mMapHeight, mMapHeight - mCollider.size.y / 2);
        transform.localPosition = pos;

        if (mFireTime >= mFireDelay)
        {
            Vector2 tFireDirection = Vector2.zero;
            tFireDirection.x = Input.GetAxisRaw("FireHorizontal");
            tFireDirection.y = Input.GetAxisRaw("FireVertical");
            if (tFireDirection.x != 0)
            {
                CMissile tMissile = Instantiate <CMissile>(CGameDataMgr.GetInst().PFMissile, mFireTransform.position, Quaternion.identity);
                tMissile.Direction = new Vector2(tFireDirection.x, 0);
                tMissile.SetTargetTag("tagEnemy");
                tMissile.SetATK(mATK);
                mFireTime = 0;
            }
            else if (tFireDirection.y != 0)
            {
                CMissile tMissile = Instantiate <CMissile>(CGameDataMgr.GetInst().PFMissile, mFireTransform.position, Quaternion.identity);
                tMissile.Direction = new Vector2(0, tFireDirection.y);
                tMissile.SetTargetTag("tagEnemy");
                tMissile.SetATK(mATK);
                mFireTime = 0;
            }
        }
        else
        {
            mFireTime += Time.deltaTime;
        }
    }
示例#10
0
    private IEnumerator SeqGameClear()
    {
        CGameDataMgr.GetInst().Gold.Value += mCurrentGold.Value;

        int prevScore = CGameDataMgr.GetInst().HighScore.Value;

        if (prevScore < mCurrentScore.Value)
        {
            CGameDataMgr.GetInst().HighScore.Value = mCurrentScore.Value;
        }

        yield return(new WaitForSeconds(2.3f));

        SceneManager.LoadScene("CSceneTitle");
    }
示例#11
0
    // Use this for initialization
    void Start()
    {
        CGameDataMgr.GetInst().Create();
        mCurrentMap = FindObjectOfType <CMap>();
        mCurrentMap.SetScene(this);

        mPlayer = Instantiate(CGameDataMgr.GetInst().PFPlayer, Vector2.zero, Quaternion.identity);
        mPlayer.transform.SetParent(mCurrentMap.mRoomList[0].transform);
        mPlayer.transform.localPosition = Vector3.zero;
        mPlayer.SetScene(this);

        mUIPlayGame = FindObjectOfType <CUIPlayGame>();
        mUIPlayGame.SetScene(this);

        mCurrentMap.mRoomList[0].OnPlayerEnter();
    }
示例#12
0
    public void OnClickBtnNext()
    {
        if (mIsDialoguePlay == false)
        {
            mIsDialoguePlay = true;

            mCurrentDialogue = CGameDataMgr.GetInst().mDialogueList.mDialogues[mDialogueIndex];

            mDialogueIndex++;

            if (mDialogueIndex >= CGameDataMgr.GetInst().mDialogueList.mDialogues.Count)
            {
                mDialogueIndex = 0;
            }
        }
    }
示例#13
0
 protected CGameDataMgr()
 {
     mInstance = null;
 }
示例#14
0
 // Use this for initialization
 void Start()
 {
     CGameDataMgr.GetInst().Create();
     SceneManager.LoadScene("CScenePlayGame");
 }
示例#15
0
 // Use this for initialization
 void Start()
 {
     CGameDataMgr.GetInst().CreateMy();
 }