Ejemplo n.º 1
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);
    }
Ejemplo n.º 2
0
    public void MoveCameraToTarget(GameObject target, float finalDist, float finalHeight, float moveSecs, float closeEnough = kZeroDist)
    {
        ModeMovingToTarget mode = (ModeMovingToTarget)SetMode(CamModeID.kMoveToTarget);

        mode.init(this, target, finalDist, finalHeight, moveSecs, closeEnough);
    }