コード例 #1
0
    /* Abstract Factory Calling Concrete Factories of Cameras */
    static public CameraBase Factory(CameraType type, GameObject gameObject, GameObject target)
    {
        switch (type)
        {
        case CameraType.thirdPerson:
            var camera = CameraFactory.ThirdPersonFactory(gameObject, target);
            return(camera);

            break;

        case CameraType.overTheShoulder:
            var shoulderCamera = CameraFactory.OverShoulderFactory(gameObject, target);
            return(shoulderCamera);

            break;

        default:
            return(CameraFactory.BasicCamera(gameObject));

            break;
        }
        ;
    }