Esempio n. 1
0
    void Start()       // Monobehavior start
    {
        logger      = UniLogger.GetLogger("GameCamera");
        feMain      = BeamMain.GetInstance();
        _thisCamera = (Camera)GetComponent("Camera");
        ModeNormal mode = (ModeNormal)SetMode(CamModeID.kNormal);

        mode.init(this);
    }
Esempio n. 2
0
    // You need to call this followed by the init() for your selected mode
    protected CameraMode SetMode(CamModeID modeID)
    {
        CameraMode newMode = null;

        switch (modeID)
        {
        case CamModeID.kNormal:
            newMode = new ModeNormal();
            break;

        case CamModeID.kMoveToPos:
            newMode = new ModeMovingToPos();
            break;

        case CamModeID.kMoveToTarget:
            newMode = new ModeMovingToTarget();
            break;

        case CamModeID.kOrbit:
            newMode = new ModeOrbit();
            break;

        case CamModeID.kBikeView:
            newMode = new ModeBikeView();
            break;

        case CamModeID.kOverheadView:
            newMode = new ModeOverheadView();
            break;

        case CamModeID.kEnemyView:
            newMode = new ModeEnemyView();
            break;
        }

        if (newMode != null)
        {
            if (_curMode != null)
            {
                _curMode.end();
            }
            _curMode   = newMode;
            _curModeID = modeID;
        }

        return(newMode);
    }
Esempio n. 3
0
 private void NewEmpty()
 {
     beziers = new List<BezierSet>();
     normalMode = new ModeNormal();
     WorkingMode = Mode.Normal;
     drawingPanel.Invalidate();
 }
Esempio n. 4
0
    // 점수 연산
    public void UpdateScore()
    {
        if (selectedDotList.Count < 2)
        {
            return;
        }

        // 연산
        int iLinked      = selectedDotList.Count - 1;
        int iGottenScore = (iLinked * iLinked) * iScoreBase;

        iScore   += iGottenScore;
        iLinkCnt += iLinked;
        if (iMaxLink < iLinked)
        {
            iMaxLink = iLinked;
        }

        // UI 수정
        Transform scoreTextTrans = uiobjScoreBoard.transform.FindChild("Score Text");

        scoreTextTrans.GetComponent <Text>().text = iScore.ToString();
        scoreTextTrans.GetComponent <ScoreText>().DoDynamicEffect();
        uiobjScoreBoard.transform.FindChild("Max Link Text").GetComponent <Text>().text   = "Max Link : " + iMaxLink.ToString();
        uiobjScoreBoard.transform.FindChild("Total Link Text").GetComponent <Text>().text = "Total Link : " + iLinkCnt.ToString();

        // UI 생성
        if (iGottenScore > 500)
        {
            GameObject objDynamicScoreText = Instantiate(GameData.pfabScoreTextUI, Camera.main.WorldToScreenPoint(
                                                             selectedDotList[iLinked].transform.position), Quaternion.identity, uiobjUI.transform);
            Text   dsText    = objDynamicScoreText.GetComponent <Text>();
            string strTail   = "";
            float  fDuration = 0.75f;

            if (iGottenScore > 10000)
            {
                dsText.fontSize = 70;
                strTail         = "!!!";
                fDuration       = 1.50f;
            }
            else if (iGottenScore > 7000)
            {
                dsText.fontSize = 65;
                strTail         = "!!";
                fDuration       = 1.25f;
            }
            else if (iGottenScore > 2000)
            {
                dsText.fontSize = 60;
                strTail         = "!";
                fDuration       = 1.00f;
            }
            else if (iGottenScore > 500)
            {
                dsText.fontSize = 50;
                strTail         = "";
                fDuration       = 0.75f;
            }

            dsText.text  = "+" + iGottenScore + strTail;
            dsText.color = selectedDotList[iLinked].GetComponent <DotObject>().GetDotColor();
            objDynamicScoreText.GetComponent <DynamicText>().SetDynamicText(fDuration, Vector3.up);
        }

        // 이벤트 함수 수행
        if (OnScoreUpdate != null)
        {
            OnScoreUpdate();
        }

        // Normal Mode시 시간초 증가
        if (gameMode.GetType() == typeof(ModeNormal))
        {
            ModeNormal mode = gameMode as ModeNormal;
            mode.AddTimeLeft(iLinked);
        }
    }