Exemplo n.º 1
0
    void Start()
    {
        //iSavename[0] = 0;
        //iSavename[1] = 0;
        //iSavename[2] = 0;

        bIsEnd = false;  // 終了フラグ
        bIsUse = true;   // 使っているフラグ

        gPanel = GameObject.Find("NamePanel");

        /*
         * if (CSceneManager.GetRecently() != "ResultScene")
         * {
         *  gPanel.SetActive(false);
         *  bIsUse = false;
         *  bIsEnd = true;
         * }
         */
        // else

        gPanel.SetActive(true);


        csmScript = GameObject.Find("ScoreDisplay").GetComponent <CScoreManager>();
    }
Exemplo n.º 2
0
 private void OnDestroy()
 {
     if (_current != null)
     {
         Debug.Log("점수 관리자 제거");
         _current = null;
         Destroy(gameObject);
     }
 }
Exemplo n.º 3
0
    void OnTriggerEnter2D(Collider2D collision)
    {
        if (collision.name == "PlayerShip")
        {
            CScoreManager.AddScore(10);

            Destroy(gameObject);
            //CObjectPool.current.PoolObject(gameObject);
        }
    }
Exemplo n.º 4
0
    void Awake()
    {
        if (_inst != null && _inst != this)
        {
            Destroy(this.gameObject);
            return;
        }

        _inst = this;
    }
Exemplo n.º 5
0
 private void Awake()
 {
     if (_current == null)
     {
         _current = this;
     }
     else
     {
         DestroyImmediate(gameObject);
     }
 }
Exemplo n.º 6
0
    protected override void OnTriggerStay2D(Collider2D collision)
    {
        if (collision.tag == "Laser")
        {
            Hit(collision);

            GameObject player = GameObject.FindGameObjectWithTag("Player");

            if (player == null)
            {
                return;
            }
            player.GetComponent <CLaserTimerManager>().LaserPowerUp(0.0001f);
            CScoreManager.AddScore(scorePerHit * laserHitRate);
        }
    }
Exemplo n.º 7
0
    void Start()
    {
        //iSavename[0] = 0;
        //iSavename[1] = 0;
        //iSavename[2] = 0;


        bIsEnd = false;  // 終了フラグ
        bIsUse = true;   // 使っているフラグ


        gPanel = GameObject.Find("NamePanel");


        csmScript = GameObject.Find("ScoreDisplay").GetComponent <CScoreManager>();

        // カメラ(SE用)取得
        gCamera = Camera.main.gameObject;

        // コンポーネント取得
        aAudioSource = gCamera.GetComponent <AudioSource>();
    }
Exemplo n.º 8
0
    public long CheckDices(int x, int y)
    {
        long    score   = 0;
        DiceSet diceSet = GetDice(x, y);

        if (diceSet == null)
        {
            return(0);
        }

        int direction = diceSet.script.GetDirection();

        if (direction > 1)
        {
            diceSet.checking = true;
            m_aCheckDice.Add(diceSet);

            //주사위 기준으로 4방향을 재귀로 검사한다.
            CheckDiceSide(x + 1, y, direction);
            CheckDiceSide(x - 1, y, direction);
            CheckDiceSide(x, y + 1, direction);
            CheckDiceSide(x, y - 1, direction);

            //인접한 모든 같은 방향 주사위 정보 m_aCheckDice
            int defaultCount = 0;
            int bonusCount   = 0;
            int nCount       = 0;
            int nMaxChain    = 0;

            for (int i = 0; i < m_aCheckDice.Count; i++)
            {
                DiceSet ds = (DiceSet)m_aCheckDice[i];
                if (m_aCheckDice.Count >= direction)
                {
                    if (ds.script.GetState() == GameData.OBJECT_STATE_DISAPPEAR)
                    {
                        bonusCount++;
                        ds.script.PlusDisappearTime();
                    }
                    else
                    {
                        defaultCount++;
                        ds.script.DisappearDice();
                    }
                    nCount++;
                }
                //검사된 모든 주사위의 체크를 풀어준다.
                ds.checking = false;
            }

            if (defaultCount != 0 || bonusCount != 0)
            {
                if (defaultCount != 0 && bonusCount == 0)
                {
                    //처음 주사위 맞출때
                    SoundManager.g_Instance.PlayEffectSound("dice_clear_01");
                    result_DiceN[direction] += direction;
                }
                else if (defaultCount != 0 && bonusCount != 0)
                {
                    //체인 으로 맞출때
                    SoundManager.g_Instance.PlayEffectSound("chain_success_01");
                    string strName = "chain_random";
                    strName += "_";
                    strName += Random.Range(1, 7);
                    SoundManager.g_Instance.PlayEffectSound(strName);

                    for (int i = 0; i < m_aCheckDice.Count; ++i)
                    {
                        DiceSet ds = (DiceSet)m_aCheckDice[i];
                        ds.nChain++;
                        if (ds.nChain > nMaxChain)
                        {
                            nMaxChain = ds.nChain;
                        }
                    }

                    for (int i = 0; i < m_aCheckDice.Count; ++i)
                    {
                        DiceSet ds = (DiceSet)m_aCheckDice[i];
                        ds.nChain = nMaxChain;
                    }

                    ClearWaveEffect();

                    diceSet.nEmitterType   = DiceSet.EMITTER_TYPE_CURRENT;
                    m_aWaveEffectCheckDice = new ArrayList(m_aCheckDice);
                    ChainEffect(nMaxChain);

                    if (nMaxChain > CScoreManager.m_nMaxChain)
                    {
                        CScoreManager.m_nMaxChain = nMaxChain;
                    }

                    result_DiceN[direction] += 1;
                }

                score = CScoreManager.GetScore(direction, defaultCount, bonusCount, nMaxChain);

                //Debug.Log("? : " + result_DiceN.Length);

                if (ScoreLabelObj.instance != null)
                {
                    ScoreLabelObj.instance.createScoreLabel(score);
                }

                //result_DiceN[0] += 1;
                //result_DiceN[direction] += 1;
                if (nMaxChain > result_maxChain)
                {
                    result_maxChain = nMaxChain;
                }
                if (nMaxChain > 0 && score > result_maxChainScore)
                {
                    result_maxChainScore = score;
                }


                //Debug.Log("TEST !!!");
                //for(int i = 0 ; i < result_DiceN.Length; i++)
                //{
                //    Debug.Log(i + " : " + result_DiceN[i]);
                //}
                //Debug.Log("maxChain : " + result_maxChain);
                //Debug.Log("maxChainScore : " + result_maxChainScore);
            }

            m_aCheckDice.Clear();
        }

        return(score);
    }